Add a variant
Adds a new variant to a given basket, so the user can purchase it in the checkout process.
Baskets are created on demand when the first variant is added to the basket.
Only one variant can be added to the basket with each request. Use multiple requests to add more variants.
The variant and quantity to be added is specified in the POST request body (see below). The only strictly required parameters are variantId and quantity.
The response will return the updated content of the basket.
Path parameters
The ID of the Basket
Query parameters
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.
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).
Adjust variant price based on the specified pricePromotionKey. If the variant does not have a matching price promotion, the default price is returned.
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.
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.
| Include | Nested Includes | Available Filters |
|---|---|---|
| items.product | See available includes for products | Check the filters available for products |
| items.variant | See available includes for variants | Check the filters available for variants |
| applicablePromotions |
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
Base64-encoded data for custom order information. Should be in the format of map[string]any.
A JWT token containing the customer ID used to validate promotions in the promotion engine.
Request body
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 variant was added to the Basket with all of the request quantity.
Changes
Changed in 2 of the 3 revisions of this API.163454
- ▲
added the new required
queryrequest parametershopIdnew-required-request-parameter
- ▲
the request property
quantitybecame requiredrequest-property-became-required
- ▲
the request property
variantIdbecame requiredrequest-property-became-required
- ●
removed the request property
shopIdrequest-property-removed
- ●
removed the optional property
items/items/costfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/itemsfrom the response with the201statusresponse-optional-property-removed
- ●
added the new
campaignenum value to thecost/appliedReductions/items/categoryresponse property for the response status201response-property-enum-value-added
- ●
added the new
promotionenum value to thecost/appliedReductions/items/categoryresponse property for the response status201response-property-enum-value-added
- ●
added the new
saleenum value to thecost/appliedReductions/items/categoryresponse property for the response status201response-property-enum-value-added
- ○
added the new optional
headerrequest parameterX-Customer-Tokennew-optional-request-parameter
- ○
added the new optional
headerrequest parameterX-Order-Custom-Datanew-optional-request-parameter
- ○
added the new optional request property
customData/pricePromotionKeynew-optional-request-property
- ○
added the new optional request property
displayData/attribute-1new-optional-request-property
- ○
added the new optional request property
displayData/attribute-2new-optional-request-property
- ○
added the new optional request property
displayData/attribute-3new-optional-request-property
- ○
added the new optional request property
displayData/identifiernew-optional-request-property
- ○
added the new optional request property
displayData/metanew-optional-request-property
- ○
added the new optional request property
displayData/namenew-optional-request-property
- ○
added the new optional request property
itemGroupnew-optional-request-property
- ○
the
quantityrequest property default value1was removedrequest-property-default-value-removed
- ○
added the media type
application/jsonfor the response with the status409response-media-type-added
- ○
added the media type
application/jsonfor the response with the status412response-media-type-added
- ○
added the media type
application/jsonfor the response with the status413response-media-type-added
- ○
added the non-success response with the status
404response-non-success-status-added
- ○
removed the non-success response with the status
422response-non-success-status-removed
- ○
added the optional property
applicablePromotionsto the response with the201statusresponse-optional-property-added
- ○
added the optional property
cost/referenceto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/availableQuantityto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/customDatato the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/deliveryForecastto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/displayDatato the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/itemGroupto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/keyto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/lowestPriorPriceto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/packageIdto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/priceto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/productto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/promotionto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/promotionIdto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/quantityto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/statusto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/variantto the response with the201statusresponse-optional-property-added
- ○
the response property
cost/appliedReductionsbecame required for the status201response-property-became-required
- ○
the response property
cost/appliedReductions/items/amountbecame required for the status201response-property-became-required
- ○
the response property
cost/appliedReductions/items/categorybecame required for the status201response-property-became-required
- ○
the response property
cost/appliedReductions/items/typebecame required for the status201response-property-became-required
- ○
the response property
cost/currencyCodebecame required for the status201response-property-became-required
- ○
the response property
cost/withTaxbecame required for the status201response-property-became-required
- ○
the response property
cost/withoutTaxbecame required for the status201response-property-became-required
- ○
added the required property
cost/recommendedRetailPriceto the response with the201statusresponse-required-property-added
- ○
added the required property
cost/taxto the response with the201statusresponse-required-property-added
- ○
added the success response with the status
206response-success-status-added
This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
removed the media type
application/jsonfor the response with the status409response-media-type-removed
- ▲
removed the media type
application/jsonfor the response with the status412response-media-type-removed
- ▲
removed the media type
application/jsonfor the response with the status413response-media-type-removed
- ▲
the response property
cost/appliedReductionsbecame optional for the status201response-property-became-optional
- ▲
the response property
cost/appliedReductions/items/amountbecame optional for the status201response-property-became-optional
- ▲
the response property
cost/appliedReductions/items/categorybecame optional for the status201response-property-became-optional
- ▲
the response property
cost/appliedReductions/items/typebecame optional for the status201response-property-became-optional
- ▲
the response property
cost/currencyCodebecame optional for the status201response-property-became-optional
- ▲
the response property
cost/withTaxbecame optional for the status201response-property-became-optional
- ▲
the response property
cost/withoutTaxbecame optional for the status201response-property-became-optional
- ▲
removed the required property
cost/recommendedRetailPricefrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
cost/taxfrom the response with the201statusresponse-required-property-removed
- ▲
removed the success response with the status
206response-success-status-removed
- ●
deleted the
headerrequest parameterX-Customer-Tokenrequest-parameter-removed
- ●
deleted the
headerrequest parameterX-Order-Custom-Datarequest-parameter-removed
- ●
deleted the
queryrequest parametershopIdrequest-parameter-removed
- ●
removed the request property
customData/pricePromotionKeyrequest-property-removed
- ●
removed the request property
displayData/attribute-1request-property-removed
- ●
removed the request property
displayData/attribute-2request-property-removed
- ●
removed the request property
displayData/attribute-3request-property-removed
- ●
removed the request property
displayData/identifierrequest-property-removed
- ●
removed the request property
displayData/metarequest-property-removed
- ●
removed the request property
displayData/namerequest-property-removed
- ●
removed the request property
itemGrouprequest-property-removed
- ●
removed the optional property
applicablePromotionsfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
cost/referencefrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/availableQuantityfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/customDatafrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/deliveryForecastfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/displayDatafrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/itemGroupfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/keyfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/lowestPriorPricefrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/packageIdfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/pricefrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/productfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/promotionfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/promotionIdfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/quantityfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/statusfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
items/items/variantfrom the response with the201statusresponse-optional-property-removed
- ○
added the new optional request property
shopIdnew-optional-request-property
- ○
the request property
quantitybecame optionalrequest-property-became-optional
- ○
the request property
variantIdbecame optionalrequest-property-became-optional
- ○
the
quantityrequest property default value1was addedrequest-property-default-value-added
- ○
added the non-success response with the status
422response-non-success-status-added
- ○
removed the non-success response with the status
404response-non-success-status-removed
- ○
added the optional property
items/items/costto the response with the201statusresponse-optional-property-added
- ○
added the optional property
items/items/itemsto the response with the201statusresponse-optional-property-added
- ○
removed the
campaignenum value from thecost/appliedReductions/items/categoryresponse property for the response status201response-property-enum-value-removed
- ○
removed the
promotionenum value from thecost/appliedReductions/items/categoryresponse property for the response status201response-property-enum-value-removed
- ○
removed the
saleenum value from thecost/appliedReductions/items/categoryresponse property for the response status201response-property-enum-value-removed
This revision also has 34 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲