---
schema_version: "1"
id: 00939f19d5356f0be7461ee3b8c32672b8efd2a8c7b2cce51cf67d181a5f4a26
title: "SDK Example: Get Cart Details (Fall '20 version)"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-sdk-exampleget-cart-detailsfall20-version-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-exampleget-cart-detailsfall20-version-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 10b07eedd7fe16c4032afd32de82a68d4864d8219826b32bf47ec04c4803f95f
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Get Cart Details (Fall '20 version)

Use the example SDK code in this topic to obtain details about a cart.

```nolang
// Instantiate the input object for getItemsInCart to specify parameters
const input = digitalCommerce.createGetItemsInCartInput();
input.catalogCode = "Phones"; // use your Catalog Code
input.cartContextKey = "01tf2000007Rb9JAAS"; // use your cart_context_key
input.cacheable = true; // Optional boolean flag to indicate if the sdk call should be cached. Default is false.
input.reload = true; // Optional boolean flag to discard cache and call the api again Default is false.
input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys

// Invoke get basket API via method getItemsInCart()
digitalCommerce
  .getItemsInCart(input)
  .then(response => {
    Logger.info("vlocity get cart items anonymous user rest call" + response);
  })
  .catch(error => {
    Logger.info("get cart items anonymous user rest call failed" + error);
  });



```

Possible error conditions:

"GetItemsInCartInput::getAPIPath() must have catalogCode."

"GetItemsInCartInput::getAPIPath() must have cartContextKey."
