Skip to navigation

Add Cart Item

View as Markdown

Adds a variant to the cart. Adding a variant that is already in the cart increases its quantity. Returns 422 when the variant is not sold on this channel, is inactive, or is priced in a different currency from the cart, and when stock is enforced and there is not enough.

For a product whose request_form is in BUY_NOW mode, send answers and needed_by with the item. A product sold through order requests returns 422 here; use Create Request instead.

Keys: public key or secret key.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

identitystring
The identity for the active workspace.

Headers

channelstringRequired
cart-tokenstringRequired

The token returned when the cart was created. Treat it as a secret: never put it in a URL or a log.

Request

This endpoint expects an object.
variant_idstringRequiredformat: "uuid"
Variant to add.
quantitydoubleOptional

Defaults to 1. Decimals are accepted for products sold by measure.

answerslist of objectsOptional

Answers to the product’s request form when it is in BUY_NOW mode. Pictures cannot be sent here.

needed_bydateOptional

Required for products with a BUY_NOW request form: the date the shopper needs it by, no earlier than the variant’s lead time. Refused on a day the merchant is fully booked.

Response

Successfully added item to cart
statusboolean

Always true on success.

messagestring

Human-readable outcome.

dataobject

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
404
Not Found Error
422
Unprocessable Entity Error