Skip to content

Latest commit

 

History

History
2078 lines (1361 loc) · 70.4 KB

File metadata and controls

2078 lines (1361 loc) · 70.4 KB

UltraCartRestApiV2.OrderApi

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

Method HTTP request Description
adjustOrderTotal POST /order/orders/{order_id}/adjust_order_total/{desired_total} Adjusts an order total
assignToAffiliate POST /order/orders/{order_id}/assignToAffiliate Assigns an order to an affiliate
blockRefundOnOrder GET /order/orders/{order_id}/refund_block Set a refund block on an order
cancelOrder POST /order/orders/{order_id}/cancel Cancel an order
deleteOrder DELETE /order/orders/{order_id} Delete an order
duplicateOrder POST /order/orders/{order_id}/duplicate Duplicate an order
format POST /order/orders/{order_id}/format Format order
generateInvoice GET /order/orders/{order_id}/invoice Generate an invoice for this order.
generateOrderToken GET /order/orders/token/{order_id} Generate an order token for a given order id
generatePackingSlipAllDC GET /order/orders/{order_id}/packing_slip Generate a packing slip for this order across all distribution centers.
generatePackingSlipSpecificDC GET /order/orders/{order_id}/packing_slip/{distribution_center_code} Generate a packing slip for this order for the given distribution center.
getAccountsReceivableRetryConfig GET /order/accountsReceivableRetryConfig Retrieve A/R Retry Configuration
getAccountsReceivableRetryStats GET /order/accountsReceivableRetryConfig/stats Retrieve A/R Retry Statistics
getOrder GET /order/orders/{order_id} Retrieve an order
getOrderByToken POST /order/orders/token Retrieve an order using a token
getOrderEdiDocuments GET /order/orders/{order_id}/edi Retrieve EDI documents associated with this order.
getOrderUpsellCart PUT /order/orders/{order_id}/upsell_with_cart Get Order Upsell Cart
getOrders GET /order/orders Retrieve orders
getOrdersBatch POST /order/orders/batch Retrieve order batch
getOrdersByQuery POST /order/orders/query Retrieve orders by query
heldOrderAddItemsAndRelease PUT /order/orders/{order_id}/hold/add_items_and_release Add items and release a held order
heldOrderRelease PUT /order/orders/{order_id}/hold/release Release a held order
insertOrder POST /order/orders Insert an order
isRefundableOrder GET /order/orders/{order_id}/refundable Determine if an order can be refunded
processPayment POST /order/orders/{order_id}/process_payment Process payment
refundOrder PUT /order/orders/{order_id}/refund Refund an order
replaceOrderItemMerchantItemId PUT /order/orders/{order_id}/replace_item_id Replaces an order item id
replacement POST /order/orders/{order_id}/replacement Replacement order
resendReceipt POST /order/orders/{order_id}/resend_receipt Resend receipt
resendShipmentConfirmation POST /order/orders/{order_id}/resend_shipment_confirmation Resend shipment confirmation
unblockRefundOnOrder GET /order/orders/{order_id}/refund_unblock Remove a refund block on an order
updateAccountsReceivableRetryConfig POST /order/accountsReceivableRetryConfig Update A/R Retry Configuration
updateOrder PUT /order/orders/{order_id} Update an order
validateOrder POST /order/validate Validate

adjustOrderTotal

BaseResponse adjustOrderTotal(order_id, desired_total)

Adjusts an order total

Adjusts an order total. Adjusts individual items appropriately and considers taxes. Desired total should be provided in the same currency as the order and must be less than the current total and greater than zero. This call will change the order total. It returns true if the desired total is achieved. If the goal seeking algorithm falls short (usually by pennies), this method returns back false. View the merchant notes for the order for further details.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to cancel.
let desired_total = "desired_total_example"; // String | The desired total with no formatting. example 123.45
apiInstance.adjustOrderTotal(order_id, desired_total, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to cancel.
desired_total String The desired total with no formatting. example 123.45

Return type

BaseResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

assignToAffiliate

OrderResponse assignToAffiliate(order_id, assign_to_affiliate_request, opts)

Assigns an order to an affiliate

Assigns an order to an affiliate.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to assign to the affiliate.
let assign_to_affiliate_request = new UltraCartRestApiV2.OrderAssignToAffiliateRequest(); // OrderAssignToAffiliateRequest | Assign to affiliate request
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.assignToAffiliate(order_id, assign_to_affiliate_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to assign to the affiliate.
assign_to_affiliate_request OrderAssignToAffiliateRequest Assign to affiliate request
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

blockRefundOnOrder

blockRefundOnOrder(order_id, opts)

Set a refund block on an order

Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to block a refund on.
let opts = {
  'block_reason': "block_reason_example" // String | Block reason code (optional)
};
apiInstance.blockRefundOnOrder(order_id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

Parameters

Name Type Description Notes
order_id String The order id to block a refund on.
block_reason String Block reason code (optional) [optional]

Return type

null (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

cancelOrder

BaseResponse cancelOrder(order_id, opts)

Cancel an order

Cancel an order on the UltraCart account. If the success flag is false, then consult the error message for why it failed.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to cancel.
let opts = {
  'lock_self_ship_orders': true, // Boolean | Flag to prevent a order shipping during a refund process
  'skip_refund_and_hold': true // Boolean | Skip refund and move order to Held Orders department
};
apiInstance.cancelOrder(order_id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to cancel.
lock_self_ship_orders Boolean Flag to prevent a order shipping during a refund process [optional]
skip_refund_and_hold Boolean Skip refund and move order to Held Orders department [optional]

Return type

BaseResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

deleteOrder

deleteOrder(order_id)

Delete an order

Delete an order on the UltraCart account.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to delete.
apiInstance.deleteOrder(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

Parameters

Name Type Description Notes
order_id String The order id to delete.

Return type

null (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

duplicateOrder

OrderResponse duplicateOrder(order_id, opts)

Duplicate an order

Perform a duplicate of the specified order_id and return a new order located in Accounts Receivable.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to duplicate.
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.duplicateOrder(order_id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to duplicate.
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

format

OrderFormatResponse format(order_id, format_options)

Format order

Format the order for display at text or html

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to format
let format_options = new UltraCartRestApiV2.OrderFormat(); // OrderFormat | Format options
apiInstance.format(order_id, format_options, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to format
format_options OrderFormat Format options

Return type

OrderFormatResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

generateInvoice

OrderInvoiceResponse generateInvoice(order_id)

Generate an invoice for this order.

The invoice PDF that is returned is base 64 encoded

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | Order ID
apiInstance.generateInvoice(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String Order ID

Return type

OrderInvoiceResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

generateOrderToken

OrderTokenResponse generateOrderToken(order_id)

Generate an order token for a given order id

Retrieves a single order token for a given order id. The token can be used with the getOrderByToken API.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to generate a token for.
apiInstance.generateOrderToken(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to generate a token for.

Return type

OrderTokenResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

generatePackingSlipAllDC

OrderPackingSlipResponse generatePackingSlipAllDC(order_id)

Generate a packing slip for this order across all distribution centers.

The packing slip PDF that is returned is base 64 encoded

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | Order ID
apiInstance.generatePackingSlipAllDC(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String Order ID

Return type

OrderPackingSlipResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

generatePackingSlipSpecificDC

OrderPackingSlipResponse generatePackingSlipSpecificDC(distribution_center_code, order_id)

Generate a packing slip for this order for the given distribution center.

The packing slip PDF that is returned is base 64 encoded

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let distribution_center_code = "distribution_center_code_example"; // String | Distribution center code
let order_id = "order_id_example"; // String | Order ID
apiInstance.generatePackingSlipSpecificDC(distribution_center_code, order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
distribution_center_code String Distribution center code
order_id String Order ID

Return type

OrderPackingSlipResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getAccountsReceivableRetryConfig

AccountsReceivableRetryConfigResponse getAccountsReceivableRetryConfig()

Retrieve A/R Retry Configuration

Retrieve A/R Retry Configuration. This is primarily an internal API call. It is doubtful you would ever need to use it.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

apiInstance.getAccountsReceivableRetryConfig((error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

This endpoint does not need any parameter.

Return type

AccountsReceivableRetryConfigResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getAccountsReceivableRetryStats

AccountsReceivableRetryStatsResponse getAccountsReceivableRetryStats(opts)

Retrieve A/R Retry Statistics

Retrieve A/R Retry Statistics. This is primarily an internal API call. It is doubtful you would ever need to use it.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let opts = {
  'from': "from_example", // String | 
  'to': "to_example" // String | 
};
apiInstance.getAccountsReceivableRetryStats(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
from String [optional]
to String [optional]

Return type

AccountsReceivableRetryStatsResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getOrder

OrderResponse getOrder(order_id, opts)

Retrieve an order

Retrieves a single order using the specified order id.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to retrieve.
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.getOrder(order_id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to retrieve.
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getOrderByToken

OrderResponse getOrderByToken(order_by_token_query, opts)

Retrieve an order using a token

Retrieves a single order using the specified order token.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_by_token_query = new UltraCartRestApiV2.OrderByTokenQuery(); // OrderByTokenQuery | Order by token query
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.getOrderByToken(order_by_token_query, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_by_token_query OrderByTokenQuery Order by token query
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getOrderEdiDocuments

OrderEdiDocumentsResponse getOrderEdiDocuments(order_id)

Retrieve EDI documents associated with this order.

Retrieve EDI documents associated with this order.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to retrieve EDI documents for.
apiInstance.getOrderEdiDocuments(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to retrieve EDI documents for.

Return type

OrderEdiDocumentsResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getOrderUpsellCart

OrderResponse getOrderUpsellCart(order_id, upsell_cart_request, opts)

Get Order Upsell Cart

Creates a new cart using cloned information from the order, but with a specific set of items, coupons and optionally a checkout URL to return the customer to

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to base things on.
let upsell_cart_request = new UltraCartRestApiV2.OrderUpsellCartRequest(); // OrderUpsellCartRequest | Request for the upsell cart
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.getOrderUpsellCart(order_id, upsell_cart_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to base things on.
upsell_cart_request OrderUpsellCartRequest Request for the upsell cart
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getOrders

OrdersResponse getOrders(opts)

Retrieve orders

Retrieves a group of orders from the account. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the orders returned to ones you are truly interested in. 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 ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let opts = {
  'order_id': "order_id_example", // String | Order Id
  'payment_method': "payment_method_example", // String | Payment Method
  'company': "company_example", // String | Company
  'first_name': "first_name_example", // String | First Name
  'last_name': "last_name_example", // String | Last Name
  'city': "city_example", // String | City
  'state_region': "state_region_example", // String | State/Region
  'postal_code': "postal_code_example", // String | Postal Code
  'country_code': "country_code_example", // String | Country Code (ISO-3166 two letter)
  'phone': "phone_example", // String | Phone
  'email': "email_example", // String | Email
  'cc_email': "cc_email_example", // String | CC Email
  'total': 3.4, // Number | Total
  'screen_branding_theme_code': "screen_branding_theme_code_example", // String | Screen Branding Theme Code
  'storefront_host_name': "storefront_host_name_example", // String | StoreFront Host Name
  'creation_date_begin': "creation_date_begin_example", // String | Creation Date Begin
  'creation_date_end': "creation_date_end_example", // String | Creation Date End
  'payment_date_begin': "payment_date_begin_example", // String | Payment Date Begin
  'payment_date_end': "payment_date_end_example", // String | Payment Date End
  'shipment_date_begin': "shipment_date_begin_example", // String | Shipment Date Begin
  'shipment_date_end': "shipment_date_end_example", // String | Shipment Date End
  'rma': "rma_example", // String | RMA
  'purchase_order_number': "purchase_order_number_example", // String | Purchase Order Number
  'item_id': "item_id_example", // String | Item Id
  'current_stage': "current_stage_example", // String | Current Stage
  'channel_partner_code': "channel_partner_code_example", // String | Channel Partner Code
  'channel_partner_order_id': "channel_partner_order_id_example", // String | Channel Partner Order ID
  '_limit': 100, // Number | The maximum number of records to return on this one API call. (Maximum 200)
  '_offset': 0, // Number | Pagination of the record set.  Offset is a zero based index.
  '_sort': "_sort_example", // String | The sort order of the orders.  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.
};
apiInstance.getOrders(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String Order Id [optional]
payment_method String Payment Method [optional]
company String Company [optional]
first_name String First Name [optional]
last_name String Last Name [optional]
city String City [optional]
state_region String State/Region [optional]
postal_code String Postal Code [optional]
country_code String Country Code (ISO-3166 two letter) [optional]
phone String Phone [optional]
email String Email [optional]
cc_email String CC Email [optional]
total Number Total [optional]
screen_branding_theme_code String Screen Branding Theme Code [optional]
storefront_host_name String StoreFront Host Name [optional]
creation_date_begin String Creation Date Begin [optional]
creation_date_end String Creation Date End [optional]
payment_date_begin String Payment Date Begin [optional]
payment_date_end String Payment Date End [optional]
shipment_date_begin String Shipment Date Begin [optional]
shipment_date_end String Shipment Date End [optional]
rma String RMA [optional]
purchase_order_number String Purchase Order Number [optional]
item_id String Item Id [optional]
current_stage String Current Stage [optional]
channel_partner_code String Channel Partner Code [optional]
channel_partner_order_id String Channel Partner Order ID [optional]
_limit Number The maximum number of records to return on this one API call. (Maximum 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 orders. 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. [optional]

Return type

OrdersResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getOrdersBatch

OrdersResponse getOrdersBatch(order_batch, opts)

Retrieve order batch

Retrieves a group of orders from the account based on an array of order ids. If more than 500 order ids are specified, the API call will fail with a bad request error.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_batch = new UltraCartRestApiV2.OrderQueryBatch(); // OrderQueryBatch | Order batch
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.
};
apiInstance.getOrdersBatch(order_batch, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_batch OrderQueryBatch Order batch
_expand String The object expansion to perform on the result. [optional]

Return type

OrdersResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getOrdersByQuery

OrdersResponse getOrdersByQuery(order_query, opts)

Retrieve orders by query

Retrieves a group of orders from the account based on a query object. If no parameters are specified, the API call will fail with a bad request error. Always specify some parameters to limit the scope of the orders returned to ones you are truly interested in. 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 ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_query = new UltraCartRestApiV2.OrderQuery(); // OrderQuery | Order query
let opts = {
  '_limit': 100, // Number | The maximum number of records to return on this one API call. (Maximum 200)
  '_offset': 0, // Number | Pagination of the record set.  Offset is a zero based index.
  '_sort': "_sort_example", // String | The sort order of the orders.  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.
};
apiInstance.getOrdersByQuery(order_query, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_query OrderQuery Order query
_limit Number The maximum number of records to return on this one API call. (Maximum 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 orders. 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. [optional]

Return type

OrdersResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

heldOrderAddItemsAndRelease

OrderResponse heldOrderAddItemsAndRelease(order_id, add_items_and_release_request, opts)

Add items and release a held order

This method adds items to an order in the hold stage and releases it

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to release.
let add_items_and_release_request = new UltraCartRestApiV2.OrderAddItemsAndReleaseRequest(); // OrderAddItemsAndReleaseRequest | Add items and release request
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.heldOrderAddItemsAndRelease(order_id, add_items_and_release_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to release.
add_items_and_release_request OrderAddItemsAndReleaseRequest Add items and release request
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

heldOrderRelease

OrderResponse heldOrderRelease(order_id, opts)

Release a held order

This method releases an order from the hold stage

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to release.
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.heldOrderRelease(order_id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to release.
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

insertOrder

OrderResponse insertOrder(order, opts)

Insert an order

Inserts a new order on the UltraCart account. This is probably NOT the method you want. This is for channel orders. For regular orders the customer is entering, use the CheckoutApi. It has many, many more features, checks, and validations.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order = new UltraCartRestApiV2.Order(); // Order | Order to insert
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.insertOrder(order, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

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

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

isRefundableOrder

OrderRefundableResponse isRefundableOrder(order_id)

Determine if an order can be refunded

Determine if an order can be refunded based upon payment method and age

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to check for refundable order.
apiInstance.isRefundableOrder(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to check for refundable order.

Return type

OrderRefundableResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

processPayment

OrderProcessPaymentResponse processPayment(order_id, process_payment_request)

Process payment

Process payment on order

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to process payment on
let process_payment_request = new UltraCartRestApiV2.OrderProcessPaymentRequest(); // OrderProcessPaymentRequest | Process payment parameters
apiInstance.processPayment(order_id, process_payment_request, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to process payment on
process_payment_request OrderProcessPaymentRequest Process payment parameters

Return type

OrderProcessPaymentResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

refundOrder

OrderResponse refundOrder(order_id, order, opts)

Refund an order

Perform a refund operation on an order and then update the order if successful. All of the object properties ending in _refunded should be the TOTAL amount that should end up being refunded. UltraCart will calculate the actual amount to refund based upon the prior refunds.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to refund.
let order = new UltraCartRestApiV2.Order(); // Order | Order to refund
let opts = {
  'reject_after_refund': false, // Boolean | Reject order after refund
  'skip_customer_notification': false, // Boolean | Skip customer email notification
  'auto_order_cancel': false, // Boolean | Cancel associated auto orders
  'manual_refund': false, // Boolean | Consider a manual refund done externally
  'reverse_affiliate_transactions': true, // Boolean | Reverse affiliate transactions
  'issue_store_credit': false, // Boolean | Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account
  'auto_order_cancel_reason': "auto_order_cancel_reason_example", // String | Reason for auto orders cancellation
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.refundOrder(order_id, order, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to refund.
order Order Order to refund
reject_after_refund Boolean Reject order after refund [optional] [default to false]
skip_customer_notification Boolean Skip customer email notification [optional] [default to false]
auto_order_cancel Boolean Cancel associated auto orders [optional] [default to false]
manual_refund Boolean Consider a manual refund done externally [optional] [default to false]
reverse_affiliate_transactions Boolean Reverse affiliate transactions [optional] [default to true]
issue_store_credit Boolean Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account [optional] [default to false]
auto_order_cancel_reason String Reason for auto orders cancellation [optional]
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

replaceOrderItemMerchantItemId

OrderResponse replaceOrderItemMerchantItemId(order_id, replace_order_item_id_request, opts)

Replaces an order item id

Replaces a single order item id with another merchant_item_id, leaving all other attributes and properties unchanged. A custom method requested by a merchant to allow for item id updates due to shipping errors. It is doubtful you will ever need this method. The expansion variable affects the returned order object.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to update.
let replace_order_item_id_request = new UltraCartRestApiV2.ReplaceOrderItemIdRequest(); // ReplaceOrderItemIdRequest | Replacement Request
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.replaceOrderItemMerchantItemId(order_id, replace_order_item_id_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to update.
replace_order_item_id_request ReplaceOrderItemIdRequest Replacement Request
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

replacement

OrderReplacementResponse replacement(order_id, replacement)

Replacement order

Create a replacement order based upon a previous order

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to generate a replacement for.
let replacement = new UltraCartRestApiV2.OrderReplacement(); // OrderReplacement | Replacement order details
apiInstance.replacement(order_id, replacement, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to generate a replacement for.
replacement OrderReplacement Replacement order details

Return type

OrderReplacementResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

resendReceipt

BaseResponse resendReceipt(order_id)

Resend receipt

Resend the receipt for an order on the UltraCart account.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to resend the receipt for.
apiInstance.resendReceipt(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to resend the receipt for.

Return type

BaseResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

resendShipmentConfirmation

BaseResponse resendShipmentConfirmation(order_id)

Resend shipment confirmation

Resend shipment confirmation for an order on the UltraCart account.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to resend the shipment notification for.
apiInstance.resendShipmentConfirmation(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to resend the shipment notification for.

Return type

BaseResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

unblockRefundOnOrder

unblockRefundOnOrder(order_id)

Remove a refund block on an order

Removes a refund block on an order to prevent a user from performing a refund.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to unblock a refund on.
apiInstance.unblockRefundOnOrder(order_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});

Parameters

Name Type Description Notes
order_id String The order id to unblock a refund on.

Return type

null (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

updateAccountsReceivableRetryConfig

BaseResponse updateAccountsReceivableRetryConfig(retry_config)

Update A/R Retry Configuration

Update A/R Retry Configuration. This is primarily an internal API call. It is doubtful you would ever need to use it.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let retry_config = new UltraCartRestApiV2.AccountsReceivableRetryConfig(); // AccountsReceivableRetryConfig | AccountsReceivableRetryConfig object
apiInstance.updateAccountsReceivableRetryConfig(retry_config, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
retry_config AccountsReceivableRetryConfig AccountsReceivableRetryConfig object

Return type

BaseResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

updateOrder

OrderResponse updateOrder(order_id, order, opts)

Update an order

Update a new order on the UltraCart account. This is probably NOT the method you want. It is rare to update a completed order. This will not trigger charges, emails, or any other automation.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let order_id = "order_id_example"; // String | The order id to update.
let order = new UltraCartRestApiV2.Order(); // Order | Order to update
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.updateOrder(order_id, order, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
order_id String The order id to update.
order Order Order to update
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

OrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

validateOrder

OrderValidationResponse validateOrder(validation_request)

Validate

Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.

Example

var ucApi = require('ultra_cart_rest_api_v2');
const { apiClient } = require('../api.js'); // https://github.com/UltraCart/sdk_samples/blob/master/javascript/api.js
let apiInstance = new ucApi.OrderApi(apiClient);

// This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
// As such, this might not be the best way to use this object.
// Please see https://github.com/UltraCart/sdk_samples for working examples.

let validation_request = new UltraCartRestApiV2.OrderValidationRequest(); // OrderValidationRequest | Validation request
apiInstance.validateOrder(validation_request, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
validation_request OrderValidationRequest Validation request

Return type

OrderValidationResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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