---
title: "Update an item in a basket"
method: PATCH
path: "/v1/baskets/{basketId}/items/{itemKey}"
tags: ["baskets"]
---

# Update an item in a basket

`PATCH /v1/baskets/{basketId}/items/{itemKey}`

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.

## Path parameters

- `basketId` string, required
- `itemKey` string, required

## Query parameters

- `campaignKey` string
- `includeItemsWithoutProductData` boolean
- `skipAvailabilityCheck` boolean
- `with` string[]

## Request body

- object
  - `customData` object — 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.
  - `quantity` integer — The quantity for the variant. When quantity is not specified, the current `quantity` in the basket will not be changed.
  - `promotionId` string — Optional promotion id for this item. When promotionId is not specified, the current `promotion` in the basket will not be changed.

## Response `200`

successful operation

- object
  - `cost` Cost
    - `appliedReductions` AppliedReduction[]
      - `amount` object
        - `absoluteWithTax` integer
        - `relative` number
      - `category` string
      - `type` string
    - `currencyCode` string — The currency of the price.
    - `withoutTax` integer
    - `withTax` integer
  - `items` BasketItem[]
    - `cost` Cost
      - `appliedReductions` AppliedReduction[]
        - `amount` object
          - `absoluteWithTax` integer
          - `relative` number
        - `category` string
        - `type` string
      - `currencyCode` string — The currency of the price.
      - `withoutTax` integer
      - `withTax` integer
    - `items` object[]
      - `availableQuantity` integer
      - `customData` object
      - `lowestPriorPrice` object
        - `withTax` integer
        - `relativeDifferenceToPrice` integer
      - `deliveryForecast` object
        - `deliverable` object
          - `key` string
          - `quantity` integer
        - `subsequentDelivery` object
          - `key` string
          - `quantity` integer
      - `displayData` DisplayData — Custom basket item properties for display during the SCAYLE Checkout and order process can be set with `displayData`. Available `displayData` properties are `meta`, `name`, `identifier`, `attribute-1`, `attribute-2`, `attribute-3`. Each of the `displayData` property objects can have a `key`, `label` and `value` property. The properties will remain attached to the basket item during the checkout and order process
      - `key` string
      - `packageId` integer
      - `price` object
        - `total` Price
          - `appliedReductions` AppliedReduction[]
            - `amount` object
              - …
            - `category` string
            - `type` string
          - `currencyCode` string — The currency of the price.
          - `reference` object
            - `size` integer — Size of the reference (100m, 100ml), but in this field fill in only the value without the unit of measurement.
            - `unit` string — The size of reference unit (KG, ml, L, etc.) without the value
            - `withoutTax` integer — Reference price excluding the taxes.
            - `withTax` integer — Item price including taxes. The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provided on the request).
          - `tax` object
            - `vat` object
              - …
          - `withoutTax` integer
          - `withTax` integer
          - `recommendedRetailPrice` integer
        - `unit` Price
          - `appliedReductions` AppliedReduction[]
            - `amount` object
              - …
            - `category` string
            - `type` string
          - `currencyCode` string — The currency of the price.
          - `reference` object
            - `size` integer — Size of the reference (100m, 100ml), but in this field fill in only the value without the unit of measurement.
            - `unit` string — The size of reference unit (KG, ml, L, etc.) without the value
            - `withoutTax` integer — Reference price excluding the taxes.
            - `withTax` integer — Item price including taxes. The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provided on the request).
          - `tax` object
            - `vat` object
              - …
          - `withoutTax` integer
          - `withTax` integer
          - `recommendedRetailPrice` integer
      - `product` Product
        - `id` integer
        - `advancedAttributes` object
        - `attributes` object
        - `baseCategories` BaseCategory[]
          - `categoryId` integer — Unique identifier of the category
          - `categoryName` string — Name of the category
          - `categoryParentId` integer — Parent ID of the category
          - `categoryPath` string — Category path as text
        - `categories` ProductCategory[]
          - `categoryId` integer
          - `categoryHidden` boolean
          - `categoryName` string
          - `categoryProperties` object
            - `is_inheritable` integer
            - `name` string
            - `value` string
          - `shopLevelCustomData` object
            - `appCatName` object
            - `appCatLocalizedConfig` object
          - `countryLevelCustomData` object
            - `appCatCountryName` string
            - `appCatCountryScore` number
            - `appCatCountryBubbleUp` boolean
            - `appCatCountrySampleName` string
            - `appCatCountrySampleConfig` object
            - `appCatCountryLocalizedConfig` object
          - `categoryUrl` string
          - `categorySlug` string
        - `definingAttributes` DefiningAttribute
          - `id` integer, nullable
          - `label` string, nullable
          - `value` string, nullable
        - `images` Image[]
          - `attributes` object
          - `hash` string
        - `customData` object
        - `isActive` boolean — Identifies whether a product is active or not
        - `isNew` boolean — Identifies whether a product is new or not
        - `isSoldOut` boolean — Identifies if a product is still available to sell
        - `masterKey` string — Identifies the master product which this product belongs
        - `firstLiveAt` string — Identifies the first time one of the products variants went live
        - `pricePromotionInfo` object
          - `is_any_price_promotion_key_in_sale` boolean
          - `are_all_price_promotion_keys_in_sale` boolean
          - `quantity_of_price_promotions_keys` integer
        - `priceRange` PriceRange
          - `max` Price
            - `appliedReductions` AppliedReduction[]
              - …
            - `currencyCode` string — The currency of the price.
            - `reference` object
              - …
            - `tax` object
              - …
            - `withoutTax` integer
            - `withTax` integer
            - `recommendedRetailPrice` integer
          - `min` Price
            - `appliedReductions` AppliedReduction[]
              - …
            - `currencyCode` string — The currency of the price.
            - `reference` object
              - …
            - `tax` object
              - …
            - `withoutTax` integer
            - `withTax` integer
            - `recommendedRetailPrice` integer
        - `reductionRange` ReductionRange
          - `max` Price
            - `appliedReductions` AppliedReduction[]
              - …
            - `currencyCode` string — The currency of the price.
            - `reference` object
              - …
            - `tax` object
              - …
            - `withoutTax` integer
            - `withTax` integer
            - `recommendedRetailPrice` integer
          - `min` Price
            - `appliedReductions` AppliedReduction[]
              - …
            - `currencyCode` string — The currency of the price.
            - `reference` object
              - …
            - `tax` object
              - …
            - `withoutTax` integer
            - `withTax` integer
            - `recommendedRetailPrice` integer
        - `lowestPriorPrice` LowestPriorPrice — Information about the items' lowest price in the past 30 days.
          - `withTax` integer
          - `relativeDifferenceToPrice` number, float
        - `referenceKey` string, nullable
        - `searchCategoryIds` integer[]
        - `siblings` Product[] — list of Products
        - `variants` Variant[]
          - `id` integer
          - `advancedAttributes` object
          - `appliedPricePromotionKey` string
          - `attributes` object
          - `price` Price
            - `appliedReductions` AppliedReduction[]
              - …
            - `currencyCode` string — The currency of the price.
            - `reference` object
              - …
            - `tax` object
              - …
            - `withoutTax` integer
            - `withTax` integer
            - `recommendedRetailPrice` integer
          - `productId` integer
          - `referenceKey` string
          - `firstLiveAt` string — Identifies the first time the variant went live
          - `stock` Stock
            - `deliveryForecast` object
              - …
            - `isSellableWithoutStock` boolean
            - `quantity` integer
            - `warehouseId` integer, nullable
            - `supplierId` integer
          - `customData` object
          - `createdAt` string — Date string, formatted according to RFC 3339, e.g. 2018-06-01T14:56:08+02:00
          - `updatedAt` string — Date string, formatted according to RFC 3339, e.g. 2018-06-01T14:56:08+02:00
        - `createdAt` string — Date string, formatted according to RFC 3339, e.g. 2018-06-01T14:56:08+02:00
        - `updatedAt` string — Date string, formatted according to RFC 3339, e.g. 2018-06-01T14:56:08+02:00
        - `indexedAt` string — Date string, formatted according to RFC 3339, e.g. 2018-06-01T14:56:08+02:00
      - `quantity` integer
      - `promotionId` string
      - `status` string
      - `variant` Variant
        - `id` integer
        - `advancedAttributes` object
        - `appliedPricePromotionKey` string
        - `attributes` object
        - `price` Price
          - `appliedReductions` AppliedReduction[]
            - `amount` object
              - …
            - `category` string
            - `type` string
          - `currencyCode` string — The currency of the price.
          - `reference` object
            - `size` integer — Size of the reference (100m, 100ml), but in this field fill in only the value without the unit of measurement.
            - `unit` string — The size of reference unit (KG, ml, L, etc.) without the value
            - `withoutTax` integer — Reference price excluding the taxes.
            - `withTax` integer — Item price including taxes. The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provided on the request).
          - `tax` object
            - `vat` object
              - …
          - `withoutTax` integer
          - `withTax` integer
          - `recommendedRetailPrice` integer
        - `productId` integer
        - `referenceKey` string
        - `firstLiveAt` string — Identifies the first time the variant went live
        - `stock` Stock
          - `deliveryForecast` object
            - `deliverable` string
            - `subsequentDelivery` string
          - `isSellableWithoutStock` boolean
          - `quantity` integer
          - `warehouseId` integer, nullable
          - `supplierId` integer
        - `customData` object
        - `createdAt` string — Date string, formatted according to RFC 3339, e.g. 2018-06-01T14:56:08+02:00
        - `updatedAt` string — Date string, formatted according to RFC 3339, e.g. 2018-06-01T14:56:08+02:00
      - `itemGroup` ItemGroup
        - `id` string
        - `isMainItem` boolean
        - `isRequired` boolean
  - `key` string
  - `packages` object[]
    - `id` integer
    - `carrierKey` string
    - `deliveryDate` object
      - `max` string
      - `min` string

## Other responses

- `206` — request successful, but the quantity was reduced due to stock limitations
- `400` — request could not be processed (invalid JSON)
- `401` — authentication failed
- `404` — item not found
- `408` — basket is currently locked, please retry
- `412` — variant is out of stock
- `422` — formal validation failure (see schema)

## Changes

- **2023-08-06** `302b7c443b51` — 11 breaking, 23 warning, 9 info
  - the request property `promotionId` became not nullable
  - removed the media type `application/json` for the response with the status `206`
  - the response property `cost/appliedReductions` became optional for the status `200`
  - the response property `cost/appliedReductions/items/amount` became optional for the status `200`
  - …39 more

[Change history](https://skmtc.dev/scayle/apis/storefront-api-documentation/changes/v1/baskets/:basketId/items/:itemKey/patch.md)

---

[API](https://skmtc.dev/scayle/apis/storefront-api-documentation.md) · [All operations](https://skmtc.dev/scayle/apis/storefront-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scayle/storefront-api-documentation/revisions/beabe2149947/schema)
