Skip to main content
POST
Create cart

Authorizations

Authorization
string
header
required

Access token

Body

application/json
items
UpdateCartItem · object[]
required

Identify a line by SKU or by product and optional variant. A non-null variant requires product_id and cannot be combined with SKU. Use quantity 0 to remove it.

metadata
object

Custom scalar values: strings, numbers or null. Numbers are returned as strings; blank and whitespace strings are preserved. custom_metadata may wrap the same key/value map; flat keys take precedence. Boolean, array and other nested-object values return 400. POS attribution and reserved identity keys are ignored and set from the session.

Response

OK

message
string
required
success
boolean
required
content
object
required
events
(CartLifecycleEvent · object | CartLineChangeEvent · object | CartCouponEvent · object | OrderCreatedEvent · object | OrderCancelledEvent · object | WishlistChangeEvent · object)[]
required

Analytics events to emit for the change this request made, each with a server-issued event_id. Replay them to your analytics destinations so your client-side and server-side copies of the same action dedupe. Empty when the request produced no analytics event.

Emitted when a cart is created or deleted, or when checkout begins. Checkout Started is sent each time an address is set on the cart, even an unchanged one, matching Commerce Engine's own server-side copy.