Skip to content

Latest commit

 

History

History
423 lines (264 loc) · 10.9 KB

PriceSchedules.md

File metadata and controls

423 lines (264 loc) · 10.9 KB

OrderCloud.PriceSchedules

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

Method HTTP request Description
Create POST /priceschedules
Delete DELETE /priceschedules/{priceScheduleID}
DeletePriceBreak DELETE /priceschedules/{priceScheduleID}/PriceBreaks
Get GET /priceschedules/{priceScheduleID}
List GET /priceschedules
Patch PATCH /priceschedules/{priceScheduleID}
Save PUT /priceschedules/{priceScheduleID}
SavePriceBreak POST /priceschedules/{priceScheduleID}/PriceBreaks

Create

PriceSchedule Create(priceSchedule)

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

var priceSchedule = new OrderCloud.PriceSchedule(); // PriceSchedule | 

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

Parameters

Name Type Description Notes
priceSchedule PriceSchedule

Return type

PriceSchedule

Authorization

oauth2

HTTP request headers

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

Delete

Delete(priceScheduleID)

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

var priceScheduleID = "priceScheduleID_example"; // String | ID of the price schedule.

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

Parameters

Name Type Description Notes
priceScheduleID String ID of the price schedule.

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

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

DeletePriceBreak

DeletePriceBreak(priceScheduleID, quantity)

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

var priceScheduleID = "priceScheduleID_example"; // String | ID of the price schedule.

var quantity = 56; // Number | Quantity of the price schedule.

apiInstance.DeletePriceBreak(priceScheduleID, quantity).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
priceScheduleID String ID of the price schedule.
quantity Number Quantity of the price schedule.

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

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

Get

PriceSchedule Get(priceScheduleID)

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

var priceScheduleID = "priceScheduleID_example"; // String | ID of the price schedule.

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

Parameters

Name Type Description Notes
priceScheduleID String ID of the price schedule.

Return type

PriceSchedule

Authorization

oauth2

HTTP request headers

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

List

ListPriceSchedule List(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.PriceSchedules();

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(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
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

ListPriceSchedule

Authorization

oauth2

HTTP request headers

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

Patch

PriceSchedule Patch(priceScheduleID, partialPriceSchedule)

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

var priceScheduleID = "priceScheduleID_example"; // String | ID of the price schedule.

var partialPriceSchedule = new OrderCloud.PriceSchedule(); // PriceSchedule | 

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

Parameters

Name Type Description Notes
priceScheduleID String ID of the price schedule.
partialPriceSchedule PriceSchedule

Return type

PriceSchedule

Authorization

oauth2

HTTP request headers

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

Save

PriceSchedule Save(priceScheduleID, priceSchedule)

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

var priceScheduleID = "priceScheduleID_example"; // String | ID of the price schedule.

var priceSchedule = new OrderCloud.PriceSchedule(); // PriceSchedule | 

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

Parameters

Name Type Description Notes
priceScheduleID String ID of the price schedule.
priceSchedule PriceSchedule

Return type

PriceSchedule

Authorization

oauth2

HTTP request headers

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

SavePriceBreak

PriceSchedule SavePriceBreak(priceScheduleID, priceBreak)

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

var priceScheduleID = "priceScheduleID_example"; // String | ID of the price schedule.

var priceBreak = new OrderCloud.PriceBreak(); // PriceBreak | 

apiInstance.SavePriceBreak(priceScheduleID, priceBreak).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
priceScheduleID String ID of the price schedule.
priceBreak PriceBreak

Return type

PriceSchedule

Authorization

oauth2

HTTP request headers

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