---
schema_version: "1"
id: 47b52dd098aa48c5d716e9230f7a79d91803769630afd7e7d666fc51b802ee3c
title: "SDK Example: Update Items in Basket (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-exampleupdate-items-in-basketfall20-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-exampleupdate-items-in-basketfall20-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 73b31bb6b058457d3084fcbd85a413a269be730bcfe3551038a8f73a24fdb524
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Update Items in Basket (Fall '20)

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'."
