Skip to content

Latest commit

 

History

History
executable file
·
430 lines (295 loc) · 13.6 KB

File metadata and controls

executable file
·
430 lines (295 loc) · 13.6 KB

KoronacloudApiV3.ProductsApi

All URIs are relative to https://www.koronacloud.com/web/api/v3

Method HTTP request Description
addProducts POST /accounts/{koronaAccountId}/products adds a batch of new products
deleteProduct DELETE /accounts/{koronaAccountId}/products/{productId} deletes the single product
getProduct GET /accounts/{koronaAccountId}/products/{productId} returns the single product
getProductStocks GET /accounts/{koronaAccountId}/products/{productId}/stocks lists the product stocks in different warehouses (KORONA.retail required)
getProducts GET /accounts/{koronaAccountId}/products lists all products
updateProduct PATCH /accounts/{koronaAccountId}/products/{productId} updates the single product
updateProducts PATCH /accounts/{koronaAccountId}/products updates a batch of products

addProducts

[AddOrUpdateResult] addProducts(body, koronaAccountId)

adds a batch of new products

Example

var KoronacloudApiV3 = require('cloud-api-v3-js-client');
var defaultClient = KoronacloudApiV3.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new KoronacloudApiV3.ProductsApi();

var body = [new KoronacloudApiV3.Product()]; // [Product] | array of new products

var koronaAccountId = "koronaAccountId_example"; // String | account id of the korona.cloud account


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.addProducts(body, koronaAccountId, callback);

Parameters

Name Type Description Notes
body [Product] array of new products
koronaAccountId String account id of the korona.cloud account

Return type

[AddOrUpdateResult]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteProduct

deleteProduct(productId, koronaAccountId)

deletes the single product

Example

var KoronacloudApiV3 = require('cloud-api-v3-js-client');
var defaultClient = KoronacloudApiV3.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new KoronacloudApiV3.ProductsApi();

var productId = "productId_example"; // String | id of the related object (important: id should match the uuid-format)

var koronaAccountId = "koronaAccountId_example"; // String | account id of the korona.cloud account


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteProduct(productId, koronaAccountId, callback);

Parameters

Name Type Description Notes
productId String id of the related object (important: id should match the uuid-format)
koronaAccountId String account id of the korona.cloud account

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getProduct

Product getProduct(productId, koronaAccountId)

returns the single product

Example

var KoronacloudApiV3 = require('cloud-api-v3-js-client');
var defaultClient = KoronacloudApiV3.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new KoronacloudApiV3.ProductsApi();

var productId = "productId_example"; // String | id of the related object (important: id should match the uuid-format)

var koronaAccountId = "koronaAccountId_example"; // String | account id of the korona.cloud account


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getProduct(productId, koronaAccountId, callback);

Parameters

Name Type Description Notes
productId String id of the related object (important: id should match the uuid-format)
koronaAccountId String account id of the korona.cloud account

Return type

Product

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getProductStocks

ResultListProductStock getProductStocks(productId, koronaAccountId, opts)

lists the product stocks in different warehouses (KORONA.retail required)

Example

var KoronacloudApiV3 = require('cloud-api-v3-js-client');
var defaultClient = KoronacloudApiV3.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new KoronacloudApiV3.ProductsApi();

var productId = "productId_example"; // String | id of the related object (important: id should match the uuid-format)

var koronaAccountId = "koronaAccountId_example"; // String | account id of the korona.cloud account

var opts = { 
  'page': 56, // Number | number of the page to fetch
  'size': 56, // Number | amount of objects to return per page
  'sort': "sort_example", // String | attribute to sort by (multiple separated by comma; max. 5)
  'revision': 789 // Number | last revision number, objects with a greater revision than this will be returned
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getProductStocks(productId, koronaAccountId, opts, callback);

Parameters

Name Type Description Notes
productId String id of the related object (important: id should match the uuid-format)
koronaAccountId String account id of the korona.cloud account
page Number number of the page to fetch [optional]
size Number amount of objects to return per page [optional]
sort String attribute to sort by (multiple separated by comma; max. 5) [optional]
revision Number last revision number, objects with a greater revision than this will be returned [optional]

Return type

ResultListProductStock

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getProducts

ResultListProduct getProducts(koronaAccountId, opts)

lists all products

Example

var KoronacloudApiV3 = require('cloud-api-v3-js-client');
var defaultClient = KoronacloudApiV3.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new KoronacloudApiV3.ProductsApi();

var koronaAccountId = "koronaAccountId_example"; // String | account id of the korona.cloud account

var opts = { 
  'page': 56, // Number | number of the page to fetch
  'size': 56, // Number | amount of objects to return per page
  'sort': "sort_example", // String | attribute to sort by (multiple separated by comma; max. 5)
  'revision': 789, // Number | last revision number, objects with a greater revision than this will be returned
  'includeDeleted': true, // Boolean | indicates deleted objects should be loaded or not (default: false)
  'productCodes': "productCodes_example", // String | at least one product code to filter by (multiple separated by comma; max. 10)
  'commodityGroup': "commodityGroup_example", // String | commodity group id  to filter by
  'assortment': "assortment_example", // String | assortment id to filter by
  'tag': "tag_example" // String | tag id to filter by
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getProducts(koronaAccountId, opts, callback);

Parameters

Name Type Description Notes
koronaAccountId String account id of the korona.cloud account
page Number number of the page to fetch [optional]
size Number amount of objects to return per page [optional]
sort String attribute to sort by (multiple separated by comma; max. 5) [optional]
revision Number last revision number, objects with a greater revision than this will be returned [optional]
includeDeleted Boolean indicates deleted objects should be loaded or not (default: false) [optional]
productCodes String at least one product code to filter by (multiple separated by comma; max. 10) [optional]
commodityGroup String commodity group id to filter by [optional]
assortment String assortment id to filter by [optional]
tag String tag id to filter by [optional]

Return type

ResultListProduct

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateProduct

updateProduct(productId, body, koronaAccountId)

updates the single product

if [number] is set, the number of the object will change and the resource location as well

Example

var KoronacloudApiV3 = require('cloud-api-v3-js-client');
var defaultClient = KoronacloudApiV3.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new KoronacloudApiV3.ProductsApi();

var productId = "productId_example"; // String | id of the related object (important: id should match the uuid-format)

var body = new KoronacloudApiV3.Product(); // Product | the properties to update of the product

var koronaAccountId = "koronaAccountId_example"; // String | account id of the korona.cloud account


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateProduct(productId, body, koronaAccountId, callback);

Parameters

Name Type Description Notes
productId String id of the related object (important: id should match the uuid-format)
body Product the properties to update of the product
koronaAccountId String account id of the korona.cloud account

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateProducts

[AddOrUpdateResult] updateProducts(body, koronaAccountId)

updates a batch of products

[number] must be set in the objects, otherwise the object cannot be updated

Example

var KoronacloudApiV3 = require('cloud-api-v3-js-client');
var defaultClient = KoronacloudApiV3.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new KoronacloudApiV3.ProductsApi();

var body = [new KoronacloudApiV3.Product()]; // [Product] | an array of existing products

var koronaAccountId = "koronaAccountId_example"; // String | account id of the korona.cloud account


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.updateProducts(body, koronaAccountId, callback);

Parameters

Name Type Description Notes
body [Product] an array of existing products
koronaAccountId String account id of the korona.cloud account

Return type

[AddOrUpdateResult]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json