---
schema_version: "1"
id: fae922d7cf152befb0cbd6732720c1e37ab5e452989dd1f8242610c8e92d4384
title: "SDK Example: Get Cart Details (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-exampleget-cart-detailsfall19-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-exampleget-cart-detailsfall19-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: dc66be124331d5d09d6fed25c045e6067e9197444249837ec8c5057db9e36e83
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Get Cart Details (Fall '19)

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."
