@doocacommerce/dooca-sdk

1.0.0-beta.10 • Public • Published

SDK - Dooca Commerce - Plataforma de Loja Virtual

Ecommerce Api / Api de Loja virtual

https://www.dooca.com.br

Como usar

$ sudo yarn add dooca-sdk
const dooca = require('dooca-sdk');

dooca.configure({
	mode: 'sandbox',
	shopId: '{shopId}',
	token: '{Token}',
});

Exemplo

const dooca = require('dooca-sdk');

try {
	const params = {}; // opcional params
	const getData = await dooca.brands.get(params);
	console.log('getData', getData);
} catch (err) {
	console.log(err.toString());
}

Ou pelo getFirst:

const { brands } = require('dooca-sdk');

try {
	const id = 123;
	const getData = await brands.getFirst(id);
	console.log('getData', getData);
} catch (err) {
	console.log(err.toString());
}

Desenvolvimento

Recursos

brand

const { brand } = require('dooca-sdk');

brand.create({ Object });
brand.get({ Object }); // params { limit:5, offset: 5 }
brand.getFirst(123);
brand.update(id, { Object });
brand.delete(123); // or { id: 123 }

category

const { category } = require('dooca-sdk');

category.create({ Object });
category.get({ Object }); // params { limit:5, offset: 5 }
category.getFirst(123);
category.getTree({ Object }); // árvore de categorias { limit: 5, offset: 5 }
category.update(id, { Object });
category.delete(123); // or { id: 123 }

Product

const { product } = require('dooca-sdk');

product.create({ Object });
product.get({ Object }); // params { limit:5, offset: 5 }
product.getFirst(123);
product.update(id, { Object });

Attributes

const { attributes } = require('dooca-sdk');

attributes.create({ Object });
attributes.get({ Object }); // params { limit:5, offset: 5 }
attributes.getFirst(123);
attributes.update(id, { Object });
attributes.delete(123); // or { id: 123 } - (productId as id)

Attribute Values

const { attributeValues } = require('dooca-sdk');
const variationId = 123;

attributeValues.create(variationId, { Object });
attributeValues.get({ Object }); // params { id: 123, limit:5, offset: 5 } - *required id of variation
attributeValues.getFirst(123); // buscar todos os valores de um atributo
attributeValues.update({ id: productId, valueId: skuId }, { Object });
attributeValues.delete({ id: productId, valueId: skuId });

Stocks

const { stocks } = require('dooca-sdk');

stocks.update([{ Object }]); // array de objetos

Orders

const { orders } = require('dooca-sdk');

orders.get();
orders.getFirst(123);
orders.create({ Object });
orders.update(123, { Object });

Fulfillments

const { fulfillments } = require('dooca-sdk');

fulfillments.get();
fulfillments.getFirst(123);
fulfillments.create({ Object });
fulfillments.updateStatus(123, 'status', { Object }); // in: attended | invoiced | shipped | delivered
fulfillments.delete(123);

Customers

const { customers } = require('dooca-sdk');

customers.get();
customers.getFirst(123);
customers.create({ Object });
customers.update(123, { Object });
customers.delete(123);

Package Sidebar

Install

npm i @doocacommerce/dooca-sdk

Weekly Downloads

0

Version

1.0.0-beta.10

License

MIT

Unpacked Size

17.6 kB

Total Files

30

Last publish

Collaborators

  • gabrieldooca
  • maicolbruski