Skip to content

Latest commit

 

History

History
1120 lines (718 loc) · 36 KB

File metadata and controls

1120 lines (718 loc) · 36 KB

UltraCartRestApiV2.CheckoutApi

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

Method HTTP request Description
cityState POST /checkout/city_state City/State for Zip
finalizeOrder POST /checkout/cart/finalizeOrder Finalize Order
getAffirmCheckout GET /checkout/cart/{cart_id}/affirmCheckout Get affirm checkout (by cart id)
getAllowedCountries POST /checkout/allowedCountries Allowed countries
getCart GET /checkout/cart Get cart
getCartByCartId GET /checkout/cart/{cart_id} Get cart (by cart id)
getCartByReturnCode GET /checkout/return/{return_code} Get cart (by return code)
getCartByReturnToken GET /checkout/return_token Get cart (by return token)
getStateProvincesForCountry POST /checkout/stateProvincesForCountry/{country_code} Get state/province list for a country code
handoffCart POST /checkout/cart/handoff Handoff cart
login POST /checkout/cart/profile/login Profile login
logout POST /checkout/cart/profile/logout Profile logout
register POST /checkout/cart/profile/register Profile registration
registerAffiliateClick POST /checkout/affiliateClick/register Register affiliate click
relatedItemsForCart POST /checkout/related_items Related items
relatedItemsForItem POST /checkout/relatedItems/{item_id} Related items (specific item)
setupBrowserKey PUT /checkout/browser_key Setup Browser Application
updateCart PUT /checkout/cart Update cart
validateCart POST /checkout/cart/validate Validate

cityState

CityStateZip cityState(cart)

City/State for Zip

Look up the city and state for the shipping zip code. Useful for building an auto complete for parts of the shipping address

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.CheckoutApi(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 cart = new UltraCartRestApiV2.Cart(); // Cart | Cart
apiInstance.cityState(cart, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
cart Cart Cart

Return type

CityStateZip

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

finalizeOrder

CartFinalizeOrderResponse finalizeOrder(finalize_request)

Finalize Order

Finalize the cart into an order. This method can not be called with browser key authentication. It is ONLY meant for server side code to call.

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.CheckoutApi(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 finalize_request = new UltraCartRestApiV2.CartFinalizeOrderRequest(); // CartFinalizeOrderRequest | Finalize request
apiInstance.finalizeOrder(finalize_request, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
finalize_request CartFinalizeOrderRequest Finalize request

Return type

CartFinalizeOrderResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getAffirmCheckout

CartAffirmCheckoutResponse getAffirmCheckout(cart_id)

Get affirm checkout (by cart id)

Get a Affirm checkout object for the specified cart_id parameter.

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.CheckoutApi(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 cart_id = "cart_id_example"; // String | Cart ID to retrieve
apiInstance.getAffirmCheckout(cart_id, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
cart_id String Cart ID to retrieve

Return type

CartAffirmCheckoutResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getAllowedCountries

CheckoutAllowedCountriesResponse getAllowedCountries()

Allowed countries

Lookup the allowed countries for this merchant 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.CheckoutApi(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.getAllowedCountries((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

CheckoutAllowedCountriesResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getCart

CartResponse getCart(opts)

Get cart

If the cookie is set on the browser making the request then it will return their active cart. Otherwise it will create a new cart.

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.CheckoutApi(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 = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.getCart(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

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

Return type

CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getCartByCartId

CartResponse getCartByCartId(cart_id, opts)

Get cart (by cart id)

Get a cart specified by the cart_id parameter.

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.CheckoutApi(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 cart_id = "cart_id_example"; // String | Cart ID to retrieve
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.getCartByCartId(cart_id, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
cart_id String Cart ID to retrieve
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getCartByReturnCode

CartResponse getCartByReturnCode(return_code, opts)

Get cart (by return code)

Get a cart specified by the return code parameter.

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.CheckoutApi(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 return_code = "return_code_example"; // String | Return code to lookup cart ID by
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.getCartByReturnCode(return_code, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
return_code String Return code to lookup cart ID by
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getCartByReturnToken

CartResponse getCartByReturnToken(opts)

Get cart (by return token)

Get a cart specified by the encrypted return token parameter.

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.CheckoutApi(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 = {
  'return_token': "return_token_example", // String | Return token provided by StoreFront Communications
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.getCartByReturnToken(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
return_token String Return token provided by StoreFront Communications [optional]
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

getStateProvincesForCountry

CheckoutStateProvinceResponse getStateProvincesForCountry(country_code)

Get state/province list for a country code

Lookup a state/province list for a given country code

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.CheckoutApi(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 country_code = "country_code_example"; // String | Two letter ISO country code
apiInstance.getStateProvincesForCountry(country_code, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
country_code String Two letter ISO country code

Return type

CheckoutStateProvinceResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

handoffCart

CheckoutHandoffResponse handoffCart(handoff_request, opts)

Handoff cart

Handoff the browser to UltraCart for view cart on StoreFront, transfer to PayPal, transfer to Affirm, transfer to Sezzle or finalization of the order (including upsell processing).

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.CheckoutApi(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 handoff_request = new UltraCartRestApiV2.CheckoutHandoffRequest(); // CheckoutHandoffRequest | Handoff request
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.handoffCart(handoff_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
handoff_request CheckoutHandoffRequest Handoff request
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CheckoutHandoffResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

login

CartProfileLoginResponse login(login_request, opts)

Profile login

Login in to the customer profile specified by cart.billing.email and password

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.CheckoutApi(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 login_request = new UltraCartRestApiV2.CartProfileLoginRequest(); // CartProfileLoginRequest | Login request
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.login(login_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
login_request CartProfileLoginRequest Login request
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CartProfileLoginResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

logout

CartResponse logout(cart, opts)

Profile logout

Log the cart out of the current profile. No error will occur if they are not logged in.

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.CheckoutApi(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 cart = new UltraCartRestApiV2.Cart(); // Cart | Cart
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.logout(cart, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

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

Return type

CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

register

CartProfileRegisterResponse register(register_request, opts)

Profile registration

Register a new customer profile. Requires the cart.billing object to be populated along with the password.

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.CheckoutApi(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 register_request = new UltraCartRestApiV2.CartProfileRegisterRequest(); // CartProfileRegisterRequest | Register request
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.register(register_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
register_request CartProfileRegisterRequest Register request
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CartProfileRegisterResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

registerAffiliateClick

RegisterAffiliateClickResponse registerAffiliateClick(register_affiliate_click_request, opts)

Register affiliate click

Register an affiliate click. Used by custom checkouts that are completely API based and do not perform checkout handoff.

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.CheckoutApi(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 register_affiliate_click_request = new UltraCartRestApiV2.RegisterAffiliateClickRequest(); // RegisterAffiliateClickRequest | Register affiliate click request
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.registerAffiliateClick(register_affiliate_click_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
register_affiliate_click_request RegisterAffiliateClickRequest Register affiliate click request
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

RegisterAffiliateClickResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

relatedItemsForCart

ItemsResponse relatedItemsForCart(cart, opts)

Related items

Retrieve all the related items for the cart contents. Expansion is limited to content, content.assignments, content.attributes, content.multimedia, content.multimedia.thumbnails, options, pricing, and pricing.tiers.

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.CheckoutApi(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 cart = new UltraCartRestApiV2.Cart(); // Cart | Cart
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See item resource documentation for examples
};
apiInstance.relatedItemsForCart(cart, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
cart Cart Cart
_expand String The object expansion to perform on the result. See item resource documentation for examples [optional]

Return type

ItemsResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

relatedItemsForItem

ItemsResponse relatedItemsForItem(item_id, cart, opts)

Related items (specific item)

Retrieve all the related items for the cart contents. Expansion is limited to content, content.assignments, content.attributes, content.multimedia, content.multimedia.thumbnails, options, pricing, and pricing.tiers.

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.CheckoutApi(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 item_id = "item_id_example"; // String | Item ID to retrieve related items for
let cart = new UltraCartRestApiV2.Cart(); // Cart | Cart
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See item resource documentation for examples
};
apiInstance.relatedItemsForItem(item_id, cart, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
item_id String Item ID to retrieve related items for
cart Cart Cart
_expand String The object expansion to perform on the result. See item resource documentation for examples [optional]

Return type

ItemsResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

setupBrowserKey

CheckoutSetupBrowserKeyResponse setupBrowserKey(browser_key_request)

Setup Browser Application

Setup a browser key authenticated application with checkout permissions. This REST call must be made with an authentication scheme that is not browser key. The new application will be linked to the application that makes this call. If this application is disabled / deleted, then so will the application setup by this call. The purpose of this call is to allow an OAuth application, such as the Wordpress plugin, to setup the proper browser based authentication for the REST checkout API to use.

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.CheckoutApi(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 browser_key_request = new UltraCartRestApiV2.CheckoutSetupBrowserKeyRequest(); // CheckoutSetupBrowserKeyRequest | Setup browser key request
apiInstance.setupBrowserKey(browser_key_request, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
browser_key_request CheckoutSetupBrowserKeyRequest Setup browser key request

Return type

CheckoutSetupBrowserKeyResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

updateCart

CartResponse updateCart(cart, opts)

Update cart

Update the cart.

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.CheckoutApi(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 cart = new UltraCartRestApiV2.Cart(); // Cart | Cart
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.updateCart(cart, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

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

Return type

CartResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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

validateCart

CartValidationResponse validateCart(validation_request, opts)

Validate

Validate the cart for errors. Specific checks can be passed and multiple validations can occur throughout your checkout flow.

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.CheckoutApi(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.CartValidationRequest(); // CartValidationRequest | Validation request
let opts = {
  '_expand': "_expand_example" // String | The object expansion to perform on the result.  See documentation for examples
};
apiInstance.validateCart(validation_request, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
validation_request CartValidationRequest Validation request
_expand String The object expansion to perform on the result. See documentation for examples [optional]

Return type

CartValidationResponse

Authorization

ultraCartBrowserApiKey, ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

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