Add a variant
/ store/ v1/ carts/ {cart_id}/ lines- Idempotency-Key supported
Add a variant, or more of it when it's already in the cart.
Path parameters
cart_idstringrequiredThe cart's ID, like
cart_01k8qs5s….
Headers
X-Cart-TokenstringrequiredThe cart's token
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
product_idstringrequiredTypeID with the
prodprefix.variant_idstringrequiredTypeID with the
varprefix.quantityintegerrequiredselling_plan_idstring · or nullSubscribe with one of the product's selling plans; absent: bought once. Adding a variant the cart has sets its line's plan.
inputsobjectAnswers to the product's questions, by input ID. The same variant with other answers is a line of its own.
propertiesobjectFree names and values the line keeps and shows in the cart, checkout and order, such as an engraving or a gift message: at most 10, names up to 60 characters, values up to 500. The same variant with other properties is a line of its own.
bookingobject · or nullFor a bookable service: the slot (one of its availability's), and who provides it (
null: anyone free).quantityis the seats.
Returns
200 The updated cart.
Errors
- 404
not_foundNo such cart. - 409A payment is in progress, or the cart is completed.
- 422
validation_failedUnavailable product or invalid quantity.