Skip to content

Latest commit

 

History

History
471 lines (296 loc) · 14 KB

LineItems.md

File metadata and controls

471 lines (296 loc) · 14 KB

OrderCloud.LineItems

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

Method HTTP request Description
Create POST /orders/{direction}/{orderID}/lineitems
Delete DELETE /orders/{direction}/{orderID}/lineitems/{lineItemID}
Get GET /orders/{direction}/{orderID}/lineitems/{lineItemID}
List GET /orders/{direction}/{orderID}/lineitems
Patch PATCH /orders/{direction}/{orderID}/lineitems/{lineItemID}
PatchShippingAddress PATCH /orders/{direction}/{orderID}/lineitems/{lineItemID}/shipto
Save PUT /orders/{direction}/{orderID}/lineitems/{lineItemID}
SetShippingAddress PUT /orders/{direction}/{orderID}/lineitems/{lineItemID}/shipto

Create

LineItem Create(direction, orderID, lineItem)

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

var direction = "direction_example"; // String | Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.

var orderID = "orderID_example"; // String | ID of the order.

var lineItem = new OrderCloud.LineItem(); // LineItem | 

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

Parameters

Name Type Description Notes
direction String Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.
orderID String ID of the order.
lineItem LineItem

Return type

LineItem

Authorization

oauth2

HTTP request headers

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

Delete

Delete(direction, orderID, lineItemID)

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

var direction = "direction_example"; // String | Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.

var orderID = "orderID_example"; // String | ID of the order.

var lineItemID = "lineItemID_example"; // String | ID of the line item.

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

Parameters

Name Type Description Notes
direction String Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.
orderID String ID of the order.
lineItemID String ID of the line item.

Return type

null (empty response body)

Authorization

oauth2

HTTP request headers

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

Get

LineItem Get(direction, orderID, lineItemID)

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

var direction = "direction_example"; // String | Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.

var orderID = "orderID_example"; // String | ID of the order.

var lineItemID = "lineItemID_example"; // String | ID of the line item.

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

Parameters

Name Type Description Notes
direction String Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.
orderID String ID of the order.
lineItemID String ID of the line item.

Return type

LineItem

Authorization

oauth2

HTTP request headers

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

List

ListLineItem List(direction, orderID, 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.LineItems();

var direction = "direction_example"; // String | Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.

var orderID = "orderID_example"; // String | ID of the order.

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

Parameters

Name Type Description Notes
direction String Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.
orderID String ID of the order.
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

ListLineItem

Authorization

oauth2

HTTP request headers

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

Patch

LineItem Patch(direction, orderID, lineItemID, partialLineItem)

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

var direction = "direction_example"; // String | Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.

var orderID = "orderID_example"; // String | ID of the order.

var lineItemID = "lineItemID_example"; // String | ID of the line item.

var partialLineItem = new OrderCloud.LineItem(); // LineItem | 

apiInstance.Patch(direction, orderID, lineItemID, partialLineItem).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
direction String Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.
orderID String ID of the order.
lineItemID String ID of the line item.
partialLineItem LineItem

Return type

LineItem

Authorization

oauth2

HTTP request headers

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

PatchShippingAddress

LineItem PatchShippingAddress(direction, orderID, lineItemID, partialAddress)

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

var direction = "direction_example"; // String | Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.

var orderID = "orderID_example"; // String | ID of the order.

var lineItemID = "lineItemID_example"; // String | ID of the line item.

var partialAddress = new OrderCloud.Address(); // Address | 

apiInstance.PatchShippingAddress(direction, orderID, lineItemID, partialAddress).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
direction String Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.
orderID String ID of the order.
lineItemID String ID of the line item.
partialAddress Address

Return type

LineItem

Authorization

oauth2

HTTP request headers

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

Save

LineItem Save(direction, orderID, lineItemID, lineItem)

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

var direction = "direction_example"; // String | Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.

var orderID = "orderID_example"; // String | ID of the order.

var lineItemID = "lineItemID_example"; // String | ID of the line item.

var lineItem = new OrderCloud.LineItem(); // LineItem | 

apiInstance.Save(direction, orderID, lineItemID, lineItem).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
direction String Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.
orderID String ID of the order.
lineItemID String ID of the line item.
lineItem LineItem

Return type

LineItem

Authorization

oauth2

HTTP request headers

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

SetShippingAddress

LineItem SetShippingAddress(direction, orderID, lineItemID, address)

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

var direction = "direction_example"; // String | Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.

var orderID = "orderID_example"; // String | ID of the order.

var lineItemID = "lineItemID_example"; // String | ID of the line item.

var address = new OrderCloud.Address(); // Address | 

apiInstance.SetShippingAddress(direction, orderID, lineItemID, address).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
direction String Direction of the order, from the current user's perspective. Possible values: incoming, outgoing.
orderID String ID of the order.
lineItemID String ID of the line item.
address Address

Return type

LineItem

Authorization

oauth2

HTTP request headers

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