Skip to content

Latest commit

 

History

History
1047 lines (722 loc) · 34.6 KB

CouponApi.md

File metadata and controls

1047 lines (722 loc) · 34.6 KB

UltraCartRestApiV2.CouponApi

All URIs are relative to https://secure.ultracart.com/rest/v2

Method HTTP request Description
deleteCoupon DELETE /coupon/coupons/{coupon_oid} Delete a coupon
deleteCouponsByCode DELETE /coupon/coupons/by_code Deletes multiple coupons
deleteCouponsByOid DELETE /coupon/coupons/by_oid Deletes multiple coupons
doesCouponCodeExist GET /coupon/coupons/merchant_code/{merchant_code}/exists Determines if a coupon merchant code already exists
generateCouponCodes POST /coupon/coupons/{coupon_oid}/generate_codes Generates one time codes for a coupon
generateOneTimeCodesByMerchantCode POST /coupon/coupons/merchant_code/{merchant_code}/generate_codes Generates one time codes by merchant code
getAutoApply GET /coupon/auto_apply Retrieve auto apply rules and conditions
getCoupon GET /coupon/coupons/{coupon_oid} Retrieve a coupon
getCouponByMerchantCode GET /coupon/coupons/merchant_code/{merchant_code} Retrieve a coupon by merchant code
getCoupons GET /coupon/coupons Retrieve coupons
getCouponsByQuery POST /coupon/coupons/query Retrieve coupons by query
getEditorValues GET /coupon/editor_values Retrieve values needed for a coupon editor
insertCoupon POST /coupon/coupons Insert a coupon
insertCoupons POST /coupon/coupons/batch Insert multiple coupons
searchItems GET /coupon/searchItems Searches for items to display within a coupon editor and assign to coupons
updateAutoApply POST /coupon/auto_apply Update auto apply rules and conditions
updateCoupon PUT /coupon/coupons/{coupon_oid} Update a coupon
updateCoupons PUT /coupon/coupons/batch Update multiple coupons
uploadCouponCodes POST /coupon/coupons/{coupon_oid}/upload_codes Upload one-time codes for a coupon

deleteCoupon

deleteCoupon(coupon_oid)

Delete a coupon

Delete a coupon on the UltraCart account.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon_oid = 56; // Number | The coupon_oid to delete.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteCoupon(coupon_oid, callback);

Parameters

Name Type Description Notes
coupon_oid Number The coupon_oid to delete.

Return type

null (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteCouponsByCode

deleteCouponsByCode(coupon_delete_request)

Deletes multiple coupons

Delete coupons on the UltraCart account.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon_delete_request = new UltraCartRestApiV2.CouponDeletesRequest(); // CouponDeletesRequest | Coupon oids to delete


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteCouponsByCode(coupon_delete_request, callback);

Parameters

Name Type Description Notes
coupon_delete_request CouponDeletesRequest Coupon oids to delete

Return type

null (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteCouponsByOid

deleteCouponsByOid(coupon_delete_request)

Deletes multiple coupons

Delete coupons on the UltraCart account.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon_delete_request = new UltraCartRestApiV2.CouponDeletesRequest(); // CouponDeletesRequest | Coupon oids to delete


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteCouponsByOid(coupon_delete_request, callback);

Parameters

Name Type Description Notes
coupon_delete_request CouponDeletesRequest Coupon oids to delete

Return type

null (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

doesCouponCodeExist

CouponExistsResponse doesCouponCodeExist(merchant_code)

Determines if a coupon merchant code already exists

Determines if a coupon merchant code already exists.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var merchant_code = "merchant_code_example"; // String | The coupon merchant code to examine.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.doesCouponCodeExist(merchant_code, callback);

Parameters

Name Type Description Notes
merchant_code String The coupon merchant code to examine.

Return type

CouponExistsResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

generateCouponCodes

CouponCodesResponse generateCouponCodes(coupon_oid, coupon_codes_request)

Generates one time codes for a coupon

Generate one time codes for a coupon

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon_oid = 56; // Number | The coupon oid to generate codes.

var coupon_codes_request = new UltraCartRestApiV2.CouponCodesRequest(); // CouponCodesRequest | Coupon code generation parameters


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.generateCouponCodes(coupon_oid, coupon_codes_request, callback);

Parameters

Name Type Description Notes
coupon_oid Number The coupon oid to generate codes.
coupon_codes_request CouponCodesRequest Coupon code generation parameters

Return type

CouponCodesResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

generateOneTimeCodesByMerchantCode

CouponCodesResponse generateOneTimeCodesByMerchantCode(merchant_code, coupon_codes_request)

Generates one time codes by merchant code

Generate one time codes by merchant code

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var merchant_code = "merchant_code_example"; // String | The merchant code to generate one time codes.

var coupon_codes_request = new UltraCartRestApiV2.CouponCodesRequest(); // CouponCodesRequest | Coupon code generation parameters


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.generateOneTimeCodesByMerchantCode(merchant_code, coupon_codes_request, callback);

Parameters

Name Type Description Notes
merchant_code String The merchant code to generate one time codes.
coupon_codes_request CouponCodesRequest Coupon code generation parameters

Return type

CouponCodesResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

getAutoApply

CouponAutoApplyConditions getAutoApply()

Retrieve auto apply rules and conditions

Retrieve auto apply rules and conditions

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();



var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getAutoApply(callback);

Parameters

This endpoint does not need any parameter.

Return type

CouponAutoApplyConditions

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getCoupon

CouponResponse getCoupon(coupon_oid, opts)

Retrieve a coupon

Retrieves a single coupon using the specified coupon profile oid.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon_oid = 56; // Number | The coupon oid to retrieve.

var opts = { 
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getCoupon(coupon_oid, opts, callback);

Parameters

Name Type Description Notes
coupon_oid Number The coupon oid to retrieve.
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CouponResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getCouponByMerchantCode

CouponResponse getCouponByMerchantCode(merchant_code, opts)

Retrieve a coupon by merchant code

Retrieves a single coupon using the specified merchant code.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var merchant_code = "merchant_code_example"; // String | The coupon merchant code to retrieve.

var opts = { 
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getCouponByMerchantCode(merchant_code, opts, callback);

Parameters

Name Type Description Notes
merchant_code String The coupon merchant code to retrieve.
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CouponResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getCoupons

CouponsResponse getCoupons(opts)

Retrieve coupons

Retrieves coupons for this account. If no parameters are specified, all coupons will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var opts = { 
  'merchant_code': "merchant_code_example", // String | Merchant code
  'description': "description_example", // String | Description
  'coupon_type': "coupon_type_example", // String | Coupon type
  'start_date_begin': "start_date_begin_example", // String | Start date begin
  'start_date_end': "start_date_end_example", // String | Start date end
  'expiration_date_begin': "expiration_date_begin_example", // String | Expiration date begin
  'expiration_date_end': "expiration_date_end_example", // String | Expiration date end
  'affiliate_oid': 56, // Number | Affiliate oid
  'exclude_expired': true, // Boolean | Exclude expired
  '_limit': 100, // Number | The maximum number of records to return on this one API call. (Max 200)
  '_offset': 0, // Number | Pagination of the record set.  Offset is a zero based index.
  '_sort': "_sort_example", // String | The sort order of the coupons.  See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getCoupons(opts, callback);

Parameters

Name Type Description Notes
merchant_code String Merchant code [optional]
description String Description [optional]
coupon_type String Coupon type [optional]
start_date_begin String Start date begin [optional]
start_date_end String Start date end [optional]
expiration_date_begin String Expiration date begin [optional]
expiration_date_end String Expiration date end [optional]
affiliate_oid Number Affiliate oid [optional]
exclude_expired Boolean Exclude expired [optional]
_limit Number The maximum number of records to return on this one API call. (Max 200) [optional] [default to 100]
_offset Number Pagination of the record set. Offset is a zero based index. [optional] [default to 0]
_sort String The sort order of the coupons. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. [optional]
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CouponsResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getCouponsByQuery

CouponsResponse getCouponsByQuery(coupon_query, opts)

Retrieve coupons by query

Retrieves coupons from the account. If no parameters are specified, all coupons will be returned. You will need to make multiple API calls in order to retrieve the entire result set since this API performs result set pagination.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon_query = new UltraCartRestApiV2.CouponQuery(); // CouponQuery | Coupon query

var opts = { 
  '_limit': 100, // Number | The maximum number of records to return on this one API call. (Max 200)
  '_offset': 0, // Number | Pagination of the record set.  Offset is a zero based index.
  '_sort': "_sort_example", // String | The sort order of the coupons.  See Sorting documentation for examples of using multiple values and sorting by ascending and descending.
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getCouponsByQuery(coupon_query, opts, callback);

Parameters

Name Type Description Notes
coupon_query CouponQuery Coupon query
_limit Number The maximum number of records to return on this one API call. (Max 200) [optional] [default to 100]
_offset Number Pagination of the record set. Offset is a zero based index. [optional] [default to 0]
_sort String The sort order of the coupons. See Sorting documentation for examples of using multiple values and sorting by ascending and descending. [optional]
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CouponsResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getEditorValues

CouponEditorValues getEditorValues()

Retrieve values needed for a coupon editor

Retrieve values needed for a coupon editor

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();



var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getEditorValues(callback);

Parameters

This endpoint does not need any parameter.

Return type

CouponEditorValues

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

insertCoupon

CouponResponse insertCoupon(coupon, opts)

Insert a coupon

Insert a coupon on the UltraCart account.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon = new UltraCartRestApiV2.Coupon(); // Coupon | Coupon to insert

var opts = { 
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.insertCoupon(coupon, opts, callback);

Parameters

Name Type Description Notes
coupon Coupon Coupon to insert
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CouponResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

insertCoupons

CouponsResponse insertCoupons(coupons_request, opts)

Insert multiple coupons

Insert multiple coupon on the UltraCart account.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupons_request = new UltraCartRestApiV2.CouponsRequest(); // CouponsRequest | Coupons to insert (maximum 50)

var opts = { 
  '_expand': "_expand_example", // String | The object expansion to perform on the result.  See documentation for examples
  '_placeholders': true // Boolean | Whether or not placeholder values should be returned in the result.  Useful for UIs that consume this REST API.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.insertCoupons(coupons_request, opts, callback);

Parameters

Name Type Description Notes
coupons_request CouponsRequest Coupons to insert (maximum 50)
_expand String The object expansion to perform on the result. See documentation for examples [optional]
_placeholders Boolean Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. [optional]

Return type

CouponsResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

searchItems

CouponItemSearchResultsResponse searchItems(opts)

Searches for items to display within a coupon editor and assign to coupons

Searches for items to display within a coupon editor and assign to coupons

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var opts = { 
  's': "s_example", // String | 
  'm': 56 // Number | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.searchItems(opts, callback);

Parameters

Name Type Description Notes
s String [optional]
m Number [optional]

Return type

CouponItemSearchResultsResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateAutoApply

updateAutoApply(conditions)

Update auto apply rules and conditions

Update auto apply rules and conditions

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var conditions = new UltraCartRestApiV2.CouponAutoApplyConditions(); // CouponAutoApplyConditions | Conditions


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.updateAutoApply(conditions, callback);

Parameters

Name Type Description Notes
conditions CouponAutoApplyConditions Conditions

Return type

null (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateCoupon

CouponResponse updateCoupon(coupon, coupon_oid, opts)

Update a coupon

Update a coupon on the UltraCart account.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon = new UltraCartRestApiV2.Coupon(); // Coupon | Coupon to update

var coupon_oid = 56; // Number | The coupon_oid to update.

var opts = { 
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.updateCoupon(coupon, coupon_oid, opts, callback);

Parameters

Name Type Description Notes
coupon Coupon Coupon to update
coupon_oid Number The coupon_oid to update.
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CouponResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

updateCoupons

CouponsResponse updateCoupons(coupons_request, opts)

Update multiple coupons

Update multiple coupon on the UltraCart account.

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupons_request = new UltraCartRestApiV2.CouponsRequest(); // CouponsRequest | Coupons to update (synchronous maximum 50 / asynchronous maximum 100)

var opts = { 
  '_expand': "_expand_example", // String | The object expansion to perform on the result.  See documentation for examples
  '_placeholders': true, // Boolean | Whether or not placeholder values should be returned in the result.  Useful for UIs that consume this REST API.
  '_async': true // Boolean | True if the operation should be run async.  No result returned
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.updateCoupons(coupons_request, opts, callback);

Parameters

Name Type Description Notes
coupons_request CouponsRequest Coupons to update (synchronous maximum 50 / asynchronous maximum 100)
_expand String The object expansion to perform on the result. See documentation for examples [optional]
_placeholders Boolean Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. [optional]
_async Boolean True if the operation should be run async. No result returned [optional]

Return type

CouponsResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

uploadCouponCodes

UploadCouponCodesResponse uploadCouponCodes(coupon_oid, upload_coupon_codes_request)

Upload one-time codes for a coupon

Upload one-time codes for a coupon

Example

var UltraCartRestApiV2 = require('ultra_cart_rest_api_v2');

// Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
var simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
UltraCartRestApiV2.ApiClient.usingApiKey(simpleKey, false)
var apiInstance = new UltraCartRestApiV2.CouponApi();


var coupon_oid = 56; // Number | The coupon oid to associate with the provided one-time codes.

var upload_coupon_codes_request = new UltraCartRestApiV2.UploadCouponCodesRequest(); // UploadCouponCodesRequest | One-time coupon codes


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.uploadCouponCodes(coupon_oid, upload_coupon_codes_request, callback);

Parameters

Name Type Description Notes
coupon_oid Number The coupon oid to associate with the provided one-time codes.
upload_coupon_codes_request UploadCouponCodesRequest One-time coupon codes

Return type

UploadCouponCodesResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json