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