Skip to content

Latest commit

 

History

History
510 lines (326 loc) · 13.8 KB

CreditCards.md

File metadata and controls

510 lines (326 loc) · 13.8 KB

OrderCloud.CreditCards

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

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

Create

CreditCard Create(buyerID, creditCard)

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

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

var creditCard = new OrderCloud.CreditCard(); // CreditCard | 

apiInstance.Create(buyerID, creditCard).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.
creditCard CreditCard

Return type

CreditCard

Authorization

oauth2

HTTP request headers

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

Delete

Delete(buyerID, creditCardID)

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

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

var creditCardID = "creditCardID_example"; // String | ID of the credit card.

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
creditCardID String ID of the credit card.

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, creditCardID, 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.CreditCards();

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

var creditCardID = "creditCardID_example"; // String | ID of the credit card.

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
creditCardID String ID of the credit card.
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

CreditCard Get(buyerID, creditCardID)

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

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

var creditCardID = "creditCardID_example"; // String | ID of the credit card.

apiInstance.Get(buyerID, creditCardID).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.
creditCardID String ID of the credit card.

Return type

CreditCard

Authorization

oauth2

HTTP request headers

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

List

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

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

ListCreditCard

Authorization

oauth2

HTTP request headers

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

ListAssignments

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

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

var opts = { 
  'creditCardID': "creditCardID_example", // String | ID of the credit card.
  'userID': "userID_example", // String | ID of the user.
  'userGroupID': "userGroupID_example", // String | ID of the user group.
  'level': "level_example", // String | Level of the credit card 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.
creditCardID String ID of the credit card. [optional]
userID String ID of the user. [optional]
userGroupID String ID of the user group. [optional]
level String Level of the credit card 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

ListCreditCardAssignment

Authorization

oauth2

HTTP request headers

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

Patch

CreditCard Patch(buyerID, creditCardID, partialCreditCard)

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

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

var creditCardID = "creditCardID_example"; // String | ID of the credit card.

var partialCreditCard = new OrderCloud.CreditCard(); // CreditCard | 

apiInstance.Patch(buyerID, creditCardID, partialCreditCard).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.
creditCardID String ID of the credit card.
partialCreditCard CreditCard

Return type

CreditCard

Authorization

oauth2

HTTP request headers

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

Save

CreditCard Save(buyerID, creditCardID, creditCard)

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

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

var creditCardID = "creditCardID_example"; // String | ID of the credit card.

var creditCard = new OrderCloud.CreditCard(); // CreditCard | 

apiInstance.Save(buyerID, creditCardID, creditCard).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.
creditCardID String ID of the credit card.
creditCard CreditCard

Return type

CreditCard

Authorization

oauth2

HTTP request headers

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

SaveAssignment

SaveAssignment(buyerID, creditCardAssignment)

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

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

var creditCardAssignment = new OrderCloud.CreditCardAssignment(); // CreditCardAssignment | 

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

Parameters

Name Type Description Notes
buyerID String ID of the buyer.
creditCardAssignment CreditCardAssignment

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

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