All URIs are relative to https://api.ordercloud.io/v1
Method | HTTP request | Description |
---|---|---|
Create | POST /buyers/{buyerID}/costcenters | |
Delete | DELETE /buyers/{buyerID}/costcenters/{costCenterID} | |
DeleteAssignment | DELETE /buyers/{buyerID}/costcenters/{costCenterID}/assignments | |
Get | GET /buyers/{buyerID}/costcenters/{costCenterID} | |
List | GET /buyers/{buyerID}/costcenters | |
ListAssignments | GET /buyers/{buyerID}/costcenters/assignments | |
Patch | PATCH /buyers/{buyerID}/costcenters/{costCenterID} | |
Save | PUT /buyers/{buyerID}/costcenters/{costCenterID} | |
SaveAssignment | POST /buyers/{buyerID}/costcenters/assignments |
CostCenter Create(buyerID, costCenter)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var costCenter = new OrderCloud.CostCenter(); // CostCenter |
apiInstance.Create(buyerID, costCenter).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
costCenter | CostCenter |
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json
Delete(buyerID, costCenterID)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var costCenterID = "costCenterID_example"; // String | ID of the cost center.
apiInstance.Delete(buyerID, costCenterID).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
costCenterID | String | ID of the cost center. |
null (empty response body)
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json
DeleteAssignment(buyerID, costCenterID, opts)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var costCenterID = "costCenterID_example"; // String | ID of the cost center.
var opts = {
'userID': "userID_example", // String | ID of the user.
'userGroupID': "userGroupID_example" // String | ID of the user group.
};
apiInstance.DeleteAssignment(buyerID, costCenterID, opts).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
costCenterID | String | ID of the cost center. | |
userID | String | ID of the user. | [optional] |
userGroupID | String | ID of the user group. | [optional] |
null (empty response body)
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json
CostCenter Get(buyerID, costCenterID)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var costCenterID = "costCenterID_example"; // String | ID of the cost center.
apiInstance.Get(buyerID, costCenterID).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
costCenterID | String | ID of the cost center. |
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json
ListCostCenter List(buyerID, opts)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var opts = {
'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(buyerID, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
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] |
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json
ListCostCenterAssignment ListAssignments(buyerID, opts)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var opts = {
'costCenterID': "costCenterID_example", // String | ID of the cost center.
'userID': "userID_example", // String | ID of the user.
'userGroupID': "userGroupID_example", // String | ID of the user group.
'level': "level_example", // String | Level of the cost center 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(buyerID, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
costCenterID | String | ID of the cost center. | [optional] |
userID | String | ID of the user. | [optional] |
userGroupID | String | ID of the user group. | [optional] |
level | String | Level of the cost center 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] |
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json
CostCenter Patch(buyerID, costCenterID, partialCostCenter)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var costCenterID = "costCenterID_example"; // String | ID of the cost center.
var partialCostCenter = new OrderCloud.CostCenter(); // CostCenter |
apiInstance.Patch(buyerID, costCenterID, partialCostCenter).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
costCenterID | String | ID of the cost center. | |
partialCostCenter | CostCenter |
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json
CostCenter Save(buyerID, costCenterID, costCenter)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var costCenterID = "costCenterID_example"; // String | ID of the cost center.
var costCenter = new OrderCloud.CostCenter(); // CostCenter |
apiInstance.Save(buyerID, costCenterID, costCenter).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
costCenterID | String | ID of the cost center. | |
costCenter | CostCenter |
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json
SaveAssignment(buyerID, costCenterAssignment)
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.CostCenters();
var buyerID = "buyerID_example"; // String | ID of the buyer.
var costCenterAssignment = new OrderCloud.CostCenterAssignment(); // CostCenterAssignment |
apiInstance.SaveAssignment(buyerID, costCenterAssignment).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
buyerID | String | ID of the buyer. | |
costCenterAssignment | CostCenterAssignment |
null (empty response body)
- Content-Type: application/json, text/plain; charset=utf-8
- Accept: application/json