---
schema_version: "1"
id: 90e692c93bfe9e08061629882bebe6de11155875a913dfc192698f787d0dac49
title: "SDK Example: Add to Cart with Configuration Changes (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-exampleadd-to-cart-with-configuration-changesfall19-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-exampleadd-to-cart-with-configuration-changesfall19-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 15fa5e6719e93b39c69fc3c18684bc5110b0fb5564dc0a3d2fe521dd2231c384
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: Add to Cart with Configuration Changes (Fall '19)

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);
  });

````
