---
schema_version: "1"
id: 72f5b5c68c4ec0e1772420b44447402a7562f080da9dc2d180a228e178d7245b
title: "SDK Example: Checkout Cart (Fall '19)"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-sdk-examplecheckout-cartfall19-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-examplecheckout-cartfall19-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5a33924f0061818b30b22cd427fd730e61240a6100a0bb37408cb22a76b94fd6
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Checkout Cart (Fall '19)

Use the example SDK code in this topic to check out a cart.

```nolang
// Instantiate the input object for checkoutCart to specify parameters
const input = digitalCommerce.checkoutCartInput();
input.catalogCode = "Mobiles"; // use your Catalog Code
input.accountId = "001f200001eSlhe"; // use your account Id
input.cartContextKey = "d5ff11cccd19472ca7c21fa80bc93d2a";

// Used in Checkout process to persist shopping cart content into SF Database
digitalCommerce
  .checkoutCart(input)
  .then(response => {
    Logger.info(
      "Vlocity digital commerce checkout cart for anonymous user: " +
        JSON.stringify(response)
    );
  })
  .catch(error => {
    Logger.info("checkout cart for anonymous user rest call failed" + error);
  });


```

Possible error conditions:

"checkoutCartInput::getAPIPath() must have catalogCode."

"checkoutCartInput::getAPIPath() must have accountId."

"checkoutCartInput::getAnonymousSiteRestUrl() must have catalogCode."

"checkoutCartInput::getAnonymousSiteRestUrl() must have accountId."

"checkoutCartInput::getRequestPayload() must have cartContextKey."
