Skip to content

Latest commit

 

History

History
510 lines (326 loc) · 14.4 KB

SpendingAccounts.md

File metadata and controls

510 lines (326 loc) · 14.4 KB

OrderCloud.SpendingAccounts

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

Method HTTP request Description
Create POST /buyers/{buyerID}/spendingaccounts
Delete DELETE /buyers/{buyerID}/spendingaccounts/{spendingAccountID}
DeleteAssignment DELETE /buyers/{buyerID}/spendingaccounts/{spendingAccountID}/assignments
Get GET /buyers/{buyerID}/spendingaccounts/{spendingAccountID}
List GET /buyers/{buyerID}/spendingaccounts
ListAssignments GET /buyers/{buyerID}/spendingaccounts/assignments
Patch PATCH /buyers/{buyerID}/spendingaccounts/{spendingAccountID}
Save PUT /buyers/{buyerID}/spendingaccounts/{spendingAccountID}
SaveAssignment POST /buyers/{buyerID}/spendingaccounts/assignments

Create

SpendingAccount Create(buyerID, spendingAccount)

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.SpendingAccounts();

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

var spendingAccount = new OrderCloud.SpendingAccount(); // SpendingAccount | 

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
spendingAccount SpendingAccount

Return type

SpendingAccount

Authorization

oauth2

HTTP request headers

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

Delete

Delete(buyerID, spendingAccountID)

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.SpendingAccounts();

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

var spendingAccountID = "spendingAccountID_example"; // String | ID of the spending account.

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
spendingAccountID String ID of the spending account.

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(buyerID, spendingAccountID, 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.SpendingAccounts();

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

var spendingAccountID = "spendingAccountID_example"; // String | ID of the spending account.

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
spendingAccountID String ID of the spending account.
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

Get

SpendingAccount Get(buyerID, spendingAccountID)

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.SpendingAccounts();

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

var spendingAccountID = "spendingAccountID_example"; // String | ID of the spending account.

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
spendingAccountID String ID of the spending account.

Return type

SpendingAccount

Authorization

oauth2

HTTP request headers

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

List

ListSpendingAccount List(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.SpendingAccounts();

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);
});

Parameters

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]

Return type

ListSpendingAccount

Authorization

oauth2

HTTP request headers

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

ListAssignments

ListSpendingAccountAssignment ListAssignments(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.SpendingAccounts();

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

var opts = { 
  'spendingAccountID': "spendingAccountID_example", // String | ID of the spending account.
  'userID': "userID_example", // String | ID of the user.
  'userGroupID': "userGroupID_example", // String | ID of the user group.
  'level': "level_example", // String | Level of the spending account 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);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
spendingAccountID String ID of the spending account. [optional]
userID String ID of the user. [optional]
userGroupID String ID of the user group. [optional]
level String Level of the spending account 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

ListSpendingAccountAssignment

Authorization

oauth2

HTTP request headers

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

Patch

SpendingAccount Patch(buyerID, spendingAccountID, partialSpendingAccount)

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.SpendingAccounts();

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

var spendingAccountID = "spendingAccountID_example"; // String | ID of the spending account.

var partialSpendingAccount = new OrderCloud.SpendingAccount(); // SpendingAccount | 

apiInstance.Patch(buyerID, spendingAccountID, partialSpendingAccount).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
spendingAccountID String ID of the spending account.
partialSpendingAccount SpendingAccount

Return type

SpendingAccount

Authorization

oauth2

HTTP request headers

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

Save

SpendingAccount Save(buyerID, spendingAccountID, spendingAccount)

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.SpendingAccounts();

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

var spendingAccountID = "spendingAccountID_example"; // String | ID of the spending account.

var spendingAccount = new OrderCloud.SpendingAccount(); // SpendingAccount | 

apiInstance.Save(buyerID, spendingAccountID, spendingAccount).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
spendingAccountID String ID of the spending account.
spendingAccount SpendingAccount

Return type

SpendingAccount

Authorization

oauth2

HTTP request headers

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

SaveAssignment

SaveAssignment(buyerID, spendingAccountAssignment)

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.SpendingAccounts();

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

var spendingAccountAssignment = new OrderCloud.SpendingAccountAssignment(); // SpendingAccountAssignment | 

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
spendingAccountAssignment SpendingAccountAssignment

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

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