The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Modify Basket

You can modify the contents of the basket in several ways as shown in the sections here.

  • Add Additional Product to Basket: This API is described by Create Basket (AddWithNoConfig) and Create Basket (AddAfterConfig). The difference is the cartContextKey of the previous basket.

    Copy the cartContextKey from the response; it should resemble the following:

    Insert the value into the cartContextKey Path variable:

    Value for cartContextKey Path variable

    The cartContextKey is generated every time a change is made to the basket. Make sure to take the latest from the response to make additional changes to the basket.

  • Delete or Update Basket Item: The Basket response contains all of the required parameters to perform these actions. Look for the actions node.

    Delete Basket Item

    Update Basket Item

    Use the values from the actions node to form the request body:

  • Update Item Quantity or Attributes: To update items, add Quantity or attributeCategories to the request body, as shown here.

  • Add Child Item: This API call is similar to the previous call. To run, inspect the data that is in the basket and copy the values to the related keys in the request.

    Add Child Item

  • Get Basket Details: This API requires cartContextKey and catalogcode.

    Get Basket Details