Skip to main content
POST
This endpoint adds one or more items to a cart. If the item already exists, it updates the quantity. Inventory availability is checked in real-time.

Authentication

This endpoint requires a valid API key with carts:write permissions.

Path Parameters

string
required
The unique identifier of the cart

Request Body

string
required
Product ID to add
string
Product variant ID (required if product has variants)
integer
required
Quantity to add (must be positive)
integer
Custom price in cents (requires special permissions)
string
Special instructions for this item
object
Custom fields for the item
boolean
default:"true"
Check inventory availability before adding
boolean
default:"false"
Replace existing quantity instead of adding to it

Response

Returns the updated cart object.