v1

latestOpenAPI 3.0.32026-07-173196215.4 KB
baskets

Update an item

Updates the quantity of a basket item or other properties such as the custom data or the promotion id. To update the item you will need to use the item key which can be found when fetching the Basket.

You can't update the variant id of a given basket item, for this operation you would need to do a delete and then an add operation.

The response will show the updated content of the basket.

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

Path parameters

basketIdstring required
Example:fySXbTJxa9q_xu_t8edGOHYeJSpaxe7A

The ID of the Basket

itemKeystring required
Example:ga2iyonk4vgpifcdm1xeuj6ezsev8ke

The Key of the Item to be sent to the request

Query parameters

campaignKeystring

Adjust prices based on the specified campaignKey. If results are not having a matching campaign, the default price is returned.

Please note, that campaign prices are stored in advance and available earlier than the campaign starts.

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). The with=applicablePromotions parameter can also be applied to include all promotions applicable for the current basket. 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
applicablePromotions
shopIdstring required

In case you are operating multiple shops (for example, for different domain names or different languages), each shop is identified by its specific shopId

Headers

X-Order-Custom-Datastring

Base64-encoded data for custom order information. Should be in the format of map[string]any.

X-Customer-Tokenstring

A JWT token containing the customer ID used to validate promotions in the promotion engine.

Request body

quantityinteger required

The updated quantity for the basket item.

promotionIdstring nullable

Updates the promotion id of the item.

If the 'promotionId' property is not sent in the request no update is performed on the field. if the value is null then any previous applied promotion will be removed from the item.

Example request

{
  "displayData": {
    "meta": {
      "key": "size",
      "label": "Size",
      "value": "M"
    },
    "name": {
      "key": "size",
      "label": "Size",
      "value": "M"
    },
    "identifier": {
      "key": "size",
      "label": "Size",
      "value": "M"
    },
    "attribute-1": {
      "key": "size",
      "label": "Size",
      "value": "M"
    },
    "attribute-2": {
      "key": "size",
      "label": "Size",
      "value": "M"
    },
    "attribute-3": {
      "key": "size",
      "label": "Size",
      "value": "M"
    }
  }
}

Response

The Basket Item was successfully updated.

keystring

A unique key identifying the basket.