---
schema_version: "1"
id: e1b0fa4f4156533c9937dd40a4626959285cbfd8522c01d989397fa67d122b1f
title: "SDK Example: Update Items in Basket (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-exampleupdate-items-in-basketfall19-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-exampleupdate-items-in-basketfall19-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 57972d3eb146f60fc492969c1d035a880e2dd6099658f450c45d7157091e9077
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Update Items in Basket (Fall '19)

Use the example SDK code in this topic to update items in a basket.

```nolang
// Instantiate the input object for AddToCartInput to specify parameters
let input = Object.assign(
  this.digitalCommerceSDK.createUpdateItemsInCartInput(),
  {
    catalogCode: "Phones",
    basketkey: "01tf2000007Rb9JAAS",
    basketAction: "updateBasket",
    bundleContextKey: "",
    lineItemKey: "",
    quantity: 2,
    customFields: ["customAttribute__c"]
  }
);
this.digitalCommerceSDK
  .updateItemsInCart(input)
  .then(response => {
    Logger.info(
      "Vlocity digital commerce updateItemsInCart for anonymous user: " +
        JSON.stringify(response)
    );
  })
  .catch(error => {
    Logger.info("updateItemsInCart action failed: ", error);
  });

```

Possible error conditions:

"UpdateItemsInCart::getAPIPath() must have catalogCode."

"UpdateItemsInCart::getAnonymousSiteRestUrl() must have catalogCode."

"UpdateItemsInCart::getRequestPayload() must have basketAction."

"UpdateItemsInCart::getRequestPayload() must have lineItemKey when basketAction is 'updateBasket'."

"UpdateItemsInCart::getRequestPayload() must have basketkey when basketAction is 'updateBasket'."

"UpdateItemsInCart::getRequestPayload() must have bundleContextKey when basketAction is 'updateBasket'."
