Skip to main content
The Shopping Cart API controls all interactions around the shopping cart: items can be added, quantities changed, and positions removed. In addition, the API provides the cart contents including totals, discounts, and rules such as minimum order values or maximum order quantities. Voucher codes can be entered, updated, or removed in the cart. The effects on discounts and totals are returned accordingly. Shipping costs are not part of the cart response. total, totalNet, totalGross, and totalTax are pure goods-value subtotals without shipping, payment, or surcharge costs and without voucher deduction. Shipping costs (shippingCost), payment costs (paymentCost), surcharges (surchargeCost), the voucher deduction (totalVoucher), and the final total are delivered by the checkout endpoints in the sum object. The interface delivers consistent JSON responses and informs about incorrect actions via clear error codes (e.g. missing or invalid product/position IDs, quantity limits, blocked changes) including detail information that enables a quick root cause analysis. For the correct management of the shopping cart, a session must be transmitted via x-session. More about this here.

Supported methods

List of all supported methods.

Error format

All errors are returned with HTTP 400 and the following body:
  • error = invalidParameters for errors in parameters or field types (details in paramErrors, key = parameter name, value {"type": "missing" | "invalidFormat" | "invalidValue" | "unknownField" | …}).
  • error = actionFailed for business errors. The error codes listed in the following tables then appear in actionErrors[].code.
  • A call with an incorrect HTTP method is answered with HTTP 404 (not 405).
  • If the session (x-session) is missing, the response is HTTP 400.

Methods for the shopping cart

These methods control the shopping cart in the shop. You can read the current cart, add products in the desired quantity, change existing positions, or remove them again.

GET basket/item/get

The following call returns the current cart with all positions and totals (net/gross/tax). The data under “items[].product” represents the state of the product at the time it was added to the cart. If, for example, the price changes during the payment process, the order is still completed at the original price stored in the cart. This prevents errors or recalculations. Which product data is included in “items[].product” is defined in the configuration of the user-defined product fields. More information here: content - Catalog (categories & products).
This command can be used to display the cart.
Example call for displaying the current cart

Parameter overview

Header parameters

Example response

billingCountry and shippingCountry are each a single country code as a string. Which format is delivered (isoAlpha2 = DE, isoAlpha3 = DEU, or isoNum = 276) depends on the shop configuration. lastBasketAction marks the most recently performed change. Possible values: add, delete, unknown. A quantity change sets add or delete depending on the result. The value update does not exist. lastUpdatedItem describes the most recently changed position. Note: lastUpdatedItem.id contains the product ID, not the cart position ID from items[].id. Additional fields: productNumber, categories (string[]), parentCategories (string[]), freeFields, voucherIds.

POST basket/items/add

This call adds a product in the desired quantity to the cart. By executing the command multiple times, several products can be added. The command can be used to add a product to the cart. If multiple products are to be added, the command must be executed accordingly often. Example call for adding three units of the product with the ID 71-3953 and the gift message “Best wishes!” to the cart
If the same product (same variant and same freeFields) is added multiple times, no second cart position is created: the quantity of the existing position is increased by quantity and its items[].id remains unchanged. Set products are never merged.

Example request

Parameter overview

Header parameters

Body parameters

Only the fields listed above are allowed. Any additional field in the request body results in HTTP 400 with error: "invalidParameters" and an entry unknownField in paramErrors. Note on set products: The endpoint accepts only the four fields listed above. Any additional field is rejected with unknownField. The variant selection for set sub-items (setChildVar_<childId>) can therefore not currently be transmitted. Set products whose sub-items have variants cannot be ordered via the Storefront API.

Example response

Each position in items[] may additionally contain the following fields: Non-visible positions (isVisible = false) and hidden set sub-items do not appear in items.

Error codes

For quantityExceeded, details contains the fields productId (affected product ID), quantity (requested total quantity), and maxQuantity (globally configured maximum quantity per position). subCode contains the product ID, field the value quantity. In addition to the global maximum, a product may have a lower limit via the product field for the maximum quantity.

PUT basket/items/update

The following call lets you update or change an existing cart position, typically the quantity. It can be used for quantity changes in the cart. Example call for changing the cart position with the ID 0921e5b44dcd6034248f to quantity 2

Example request (reduce quantity of a position to 2)

Note: If quantity is set to 0, the position is removed from the cart. Alternatively, the position can also be deleted via DELETE basket/delete.

Parameter overview

Header parameters

Body parameters

Only the fields listed above are allowed. Any additional field in the request body results in HTTP 400 with error: "invalidParameters" and an entry unknownField in paramErrors.

Example response

lastBasketAction, lastUpdatedItem, totalCommission, and totalWeight are only delivered by the read endpoint GET basket/items/get. The fields of the positions in items[] correspond to those of POST basket/items/add, see there.

Error codes

For quantityExceeded, details contains the fields productId (affected product ID), quantity (requested total quantity), and maxQuantity (globally configured maximum quantity per position). subCode contains the product ID, field the value quantity.

DELETE basket/item/delete

The following call lets you permanently remove an existing cart position. With this command, items can be removed from the cart. Example call for deleting the product with the item ID 0d1b062c8225f817aa3e

Example request

Parameter overview

Header parameters

Body parameters

Example response

Error codes

Configuration methods

GET config/inserts

The following call returns the current configuration of the insert code feature. Use it in a storefront application to decide whether to display an input field for the insert code and how the combination of product number and code is composed. Example call

Parameter overview

Header parameters

This endpoint does not require a session. The x-session header is optional and is ignored.

Example response