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