---
schema_version: "1"
id: ce7c2b84e6a19bcbe929b8eec1bb2351eb50fdb6ef9509ec4a6fcfb258df185a
title: Adding or Deleting Basket Items or Attributes
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-adding-or-deleting-basket-items-or-attributes.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-adding-or-deleting-basket-items-or-attributes.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3a424a2ef3d983b79b844913832a93a4dc27079fc56e37a56f59bdc107968946
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Adding or Deleting Basket Items or Attributes

Use this API to update the quantity or attributes of an offer that has already been added to a basket.

The following example shows a typical sequence of API calls to update an item in a basket for a known user.

1.  Use the GetOffersByCatalog API to retrieve a list of offers from the catalog (see [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md)).

    ```nolang
    Method: GET

    API:
    /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/offers
    ```

2.  Based on the list of offers returned by the GetOffersByCatalog API, run the GetOfferDetails API to retrieve details about a particular offer (see [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md)).

    ```nolang
    Method: GET

    API:
    /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/offers/{offer_code}
    ```

3.  Create a basket and add an item to it by running the Basket API. If the user is known, use the following API call and body:

    ```nolang
    Method: POST

    API:
    /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/offers/basket&isloggedin=true

    Request Body:
    {"offer": "{offer_code}","basketAction": "AddWithNoConfig"}
    ```

4.  Note the cartContextKey from the API call in Step 3.

    Be sure to note the CartContextKey, the lineItemKey, and the bundleContextKey if you intend to change or configure the offer.

5.  Update the basket with an API call formatted similar to the following:

    ```nolang
    Method: PUT

    API:
    /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/basket/{cart_context_key}&isloggedin=true

    Request Body:
    {"lineItemKey":"xxxxxxxxxxxx","Quantity":"2" "bundleContextKey":"xxxxxxxxxxxxx"}
    ```
