---
schema_version: "1"
id: a5d66072e4f360e15b600d0e23a1ba6a76d4acd6a5225e4e3cac446f419898b7
title: "SDK Example: Add to Cart with Configuration Changes (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-exampleadd-to-cart-with-configuration-changesfall20-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-exampleadd-to-cart-with-configuration-changesfall20-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: d663ee5bff5d0946a62e8c45ac21a228ac56b1d78f765a2676cc4ccab647c199
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Add to Cart with Configuration Changes (Fall '20)

Use the example SDK code in this topic to add an already configured item to a cart.

````nolang
//
```javascript
    const addToCartInput = digitalCommerce.createAddToCartInput();
    addToCartInput.catalogCode = "Phones";
    addToCartInput.offerConfiguration = digitalCommerce.getSelectedOffer(offerCode);
    addToCartInput.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys
    input.basketAction = "AddAfterConfig";
    return digitalCommerce.addToCart(addToCartInput);
  })
  .then(addToCartResponse => {
    Logger.info(addToCartResponse.orderId);
  })
  .catch(error => {
    Logger.info("addToCart login user dual fail: " + error);
  });

````
