Cart

Add product to cart

Add a product to the shopping cart with quantity and optional product options.

post/add-product-in-cart

Request

Headers

X-STOREFRONT-KEYstring required

Storefront API Key for authentication. Required for all shop/storefront API requests.

X-Localestring
Example:en

Locale code for localized data (e.g. "en", "fr", "ar"). Defaults to channel's default locale.

X-Channelstring
Example:default

Channel code (e.g. "default"). Defaults to the current channel.

X-Currencystring
Example:USD

Currency code (e.g. "USD", "EUR", "INR"). Defaults to channel's base currency.

Request body

productIdinteger

Product ID

quantityinteger

Quantity

selectedConfigurableOptioninteger

Child variant product ID (configurable products)

superAttributeobject

Super attribute values {attributeId: optionValue} (configurable products)

qtyobject

Quantities per associated product {productId: quantity} (grouped products)

bundleOptionsobject

Bundle options {optionId: [productIds]} (bundle products)

bundleOptionQtyobject

Bundle option quantities {optionId: quantity} (bundle products, optional)

linksinteger[]

Download link IDs (downloadable products)

bookingobject

Booking data - varies by booking type (appointment, default, table, rental, event)

specialNotestring

Special note for table bookings

isBuyNow0 | 1

Buy now flag (0 = add to cart, 1 = buy now)

Example request

{
  "productId": 1,
  "quantity": 1
}

Response

Product added to cart. Returns the full cart.

Changes

No recorded changes to this operation across all 13 revisions of this API.