baskets

Update an item in a basket

When retrieving a basket, each item will show a unique key attribute, for example, "key": "911976fb354759ae0e56c1696b9325d2".

To update an item in a basket, you need to specify this key as ìtemKey.

The response will show the updated content of the basket.

patch/v1/baskets/{basketId}/items/{itemKey}

Path parameters

basketIdstring required
Example:your-basket-id

Basket ID

itemKeystring required

itemKey

Query parameters

campaignKeystring

Adjust variant price based on the specified campaignKey. If the variant does not have a matching campaign, the default price is returned.

  • It will adjust prices also for the price range resource.
  • Currently, campaignKey support legacy way campaignKey=px and custom campaigns eg.- campaignKey=4d265817-dd00-4c89-b8e4-c1776e06aa14 which you can find actual keys in campaign API endpoint - /v1/campaigns
includeItemsWithoutProductDataboolean

If includeItemsWithoutProductData is set to true, basket items will be included even if there is no product information available (items.product and items.variant might be empty).

skipAvailabilityCheckboolean

This parameter allows disabling the availability check when adding an item into the wishlist or basket. This is needed to make sure that sold out products can be reserved via Click & Reserve in retail stores (where they are still available). Important – Check if this resource is available for your shop.

withstring[]

The with parameter can be applied to include related resources, for example, the attributes of a product can be attached using with=items.product.attributes. It is also possible to filter attributes by key with=items.product.attributes:key(plusSize) or by type with=items.product.attributes:type(material_care). In the following table, there is more information about possible includes.

IncludeNested IncludesAvailable Filters
items.productSee available includes for productsCheck the filters available for products
items.variantSee available includes for variantsCheck the filters available for variants

Request body

customDataobject

For each item you can add an additonal custom data array. This will not change API behaviour, but the data will remain attached to the basket item and you may retrieve it at any time during or after the checkout and order process.

quantityinteger

The quantity for the variant. When quantity is not specified, the current quantity in the basket will not be changed.

promotionIdstring

Optional promotion id for this item. When promotionId is not specified, the current promotion in the basket will not be changed.

Example request

{
  "customData": {
    "promotionNumber": "036"
  },
  "promotionId": "648075340c7324fae5811cd2"
}

Response

successful operation

keystring

Changes