---
schema_version: "1"
id: 7e9248a0650cd0bc3a72044358c855387a718793e76c01cd7818a6cf4eb5d155
title: "SDK Example: Checkout Cart (Fall '20)"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-sdk-examplecheckout-cartfall20-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-examplecheckout-cartfall20-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e54174783a2db3fe1676943149e45202fc1f6978d3b2157d47ebef5097e7cb5d
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Checkout Cart (Fall '20)

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."
