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