Skip to content

Latest commit

 

History

History
683 lines (438 loc) · 18.8 KB

Categories.md

File metadata and controls

683 lines (438 loc) · 18.8 KB

OrderCloud.Categories

All URIs are relative to https://api.ordercloud.io/v1

Method HTTP request Description
Create POST /catalogs/{catalogID}/categories
Delete DELETE /catalogs/{catalogID}/categories/{categoryID}
DeleteAssignment DELETE /catalogs/{catalogID}/categories/{categoryID}/assignments
DeleteProductAssignment DELETE /catalogs/{catalogID}/categories/{categoryID}/productassignments/{productID}
Get GET /catalogs/{catalogID}/categories/{categoryID}
List GET /catalogs/{catalogID}/categories
ListAssignments GET /catalogs/{catalogID}/categories/assignments
ListProductAssignments GET /catalogs/{catalogID}/categories/productassignments
Patch PATCH /catalogs/{catalogID}/categories/{categoryID}
Save PUT /catalogs/{catalogID}/categories/{categoryID}
SaveAssignment POST /catalogs/{catalogID}/categories/assignments
SaveProductAssignment POST /catalogs/{catalogID}/categories/productassignments

Create

Category Create(catalogID, category)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var category = new OrderCloud.Category(); // Category | 

apiInstance.Create(catalogID, category).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
category Category

Return type

Category

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Delete

Delete(catalogID, categoryID)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var categoryID = "categoryID_example"; // String | ID of the category.

apiInstance.Delete(catalogID, categoryID).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryID String ID of the category.

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

DeleteAssignment

DeleteAssignment(catalogID, categoryID, buyerID, opts)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var categoryID = "categoryID_example"; // String | ID of the category.

var buyerID = "buyerID_example"; // String | ID of the buyer.

var opts = { 
  'userID': "userID_example", // String | ID of the user.
  'userGroupID': "userGroupID_example" // String | ID of the user group.
};
apiInstance.DeleteAssignment(catalogID, categoryID, buyerID, opts).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryID String ID of the category.
buyerID String ID of the buyer.
userID String ID of the user. [optional]
userGroupID String ID of the user group. [optional]

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

DeleteProductAssignment

DeleteProductAssignment(catalogID, categoryID, productID)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var categoryID = "categoryID_example"; // String | ID of the category.

var productID = "productID_example"; // String | ID of the product.

apiInstance.DeleteProductAssignment(catalogID, categoryID, productID).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryID String ID of the category.
productID String ID of the product.

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Get

Category Get(catalogID, categoryID)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var categoryID = "categoryID_example"; // String | ID of the category.

apiInstance.Get(catalogID, categoryID).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryID String ID of the category.

Return type

Category

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

List

ListCategory List(catalogID, opts)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var opts = { 
  'depth': "depth_example", // String | Depth of the category.
  'search': "search_example", // String | Word or phrase to search for.
  'searchOn': "searchOn_example", // String | Comma-delimited list of fields to search on.
  'sortBy': "sortBy_example", // String | Comma-delimited list of fields to sort by.
  'page': 56, // Number | Page of results to return. Default: 1
  'pageSize': 56, // Number | Number of results to return per page. Default: 20, max: 100.
  'filters': {key: "filters_example"} // {String: String} | Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
};
apiInstance.List(catalogID, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
depth String Depth of the category. [optional]
search String Word or phrase to search for. [optional]
searchOn String Comma-delimited list of fields to search on. [optional]
sortBy String Comma-delimited list of fields to sort by. [optional]
page Number Page of results to return. Default: 1 [optional]
pageSize Number Number of results to return per page. Default: 20, max: 100. [optional]
filters {String: String} Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???' [optional]

Return type

ListCategory

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

ListAssignments

ListCategoryAssignment ListAssignments(catalogID, opts)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var opts = { 
  'categoryID': "categoryID_example", // String | ID of the category.
  'buyerID': "buyerID_example", // String | ID of the buyer.
  'userID': "userID_example", // String | ID of the user.
  'userGroupID': "userGroupID_example", // String | ID of the user group.
  'level': "level_example", // String | Level of the category assignment. Possible values: User, Group, Company.
  'page': 56, // Number | Page of results to return. Default: 1
  'pageSize': 56 // Number | Number of results to return per page. Default: 20, max: 100.
};
apiInstance.ListAssignments(catalogID, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryID String ID of the category. [optional]
buyerID String ID of the buyer. [optional]
userID String ID of the user. [optional]
userGroupID String ID of the user group. [optional]
level String Level of the category assignment. Possible values: User, Group, Company. [optional]
page Number Page of results to return. Default: 1 [optional]
pageSize Number Number of results to return per page. Default: 20, max: 100. [optional]

Return type

ListCategoryAssignment

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

ListProductAssignments

ListCategoryProductAssignment ListProductAssignments(catalogID, opts)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var opts = { 
  'categoryID': "categoryID_example", // String | ID of the category.
  'productID': "productID_example", // String | ID of the product.
  'page': 56, // Number | Page of results to return. Default: 1
  'pageSize': 56 // Number | Number of results to return per page. Default: 20, max: 100.
};
apiInstance.ListProductAssignments(catalogID, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryID String ID of the category. [optional]
productID String ID of the product. [optional]
page Number Page of results to return. Default: 1 [optional]
pageSize Number Number of results to return per page. Default: 20, max: 100. [optional]

Return type

ListCategoryProductAssignment

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Patch

Category Patch(catalogID, categoryID, partialCategory)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var categoryID = "categoryID_example"; // String | ID of the category.

var partialCategory = new OrderCloud.Category(); // Category | 

apiInstance.Patch(catalogID, categoryID, partialCategory).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryID String ID of the category.
partialCategory Category

Return type

Category

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

Save

Category Save(catalogID, categoryID, category)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var categoryID = "categoryID_example"; // String | ID of the category.

var category = new OrderCloud.Category(); // Category | 

apiInstance.Save(catalogID, categoryID, category).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryID String ID of the category.
category Category

Return type

Category

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

SaveAssignment

SaveAssignment(catalogID, categoryAssignment)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var categoryAssignment = new OrderCloud.CategoryAssignment(); // CategoryAssignment | 

apiInstance.SaveAssignment(catalogID, categoryAssignment).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryAssignment CategoryAssignment

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json

SaveProductAssignment

SaveProductAssignment(catalogID, categoryProductAssignment)

Example

var OrderCloud = require('OrderCloud');
var defaultClient = OrderCloud.Sdk.default;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new OrderCloud.Categories();

var catalogID = "catalogID_example"; // String | ID of the catalog.

var categoryProductAssignment = new OrderCloud.CategoryProductAssignment(); // CategoryProductAssignment | 

apiInstance.SaveProductAssignment(catalogID, categoryProductAssignment).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
catalogID String ID of the catalog.
categoryProductAssignment CategoryProductAssignment

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json, text/plain; charset=utf-8
  • Accept: application/json