Commerce API Reference
The Commerce app exposes public HTTP ingresses for cart management. All endpoints are prefixed with /ingress/commerce/.
TIP
All cart mutation endpoints return the rendered cart on success. Error responses return { error: { code, message } }.
Create Cart
Creates a new cart with the specified profile and locale. Returns the new cart ID.
Request Body
Responses
Cart created successfully.
Samples
Get Cart
Returns the fully rendered cart including computed items, totals, shipping, and tax.
Parameters
Path Parameters
The cart ID.
"uuid"Responses
Rendered cart.
Samples
Cart Events (SSE)
Server-Sent Events stream for real-time cart updates. The stream emits the full rendered cart whenever the cart state changes.
Parameters
Path Parameters
The cart ID.
"uuid"Responses
SSE event stream. Each event contains the rendered cart as JSON.
Samples
Add Item
Adds an item to the cart. Validates the item can be added by previewing the cart with the new item before applying.
Parameters
Header Parameters
Optional idempotency key mapped to the item ID. If omitted, a new UUID is generated.
"uuid"Path Parameters
The cart ID.
"uuid"Request Body
Responses
Item added. Returns the rendered cart.
Samples
Remove Item
Removes an item from the cart by its cart item ID.
Parameters
Path Parameters
"uuid"Request Body
Responses
Item removed. Returns the rendered cart.
Samples
Set Item Quantity
Updates the quantity of an existing cart item. Validates the change by previewing the cart before applying.
Parameters
Path Parameters
"uuid"Request Body
Responses
Quantity updated. Returns the rendered cart.
Samples
Set Address
Sets the shipping and/or invoice address on the cart. Validates country codes against the cart profile's allowed countries.
Parameters
Path Parameters
"uuid"Request Body
Responses
Address updated. Returns the rendered cart.
Samples
Set Email
Sets the email address on the cart. Validates the email format.
Parameters
Path Parameters
"uuid"Request Body
Responses
Email updated. Returns the rendered cart.
Samples
Set Phone
Sets the phone number on the cart.
Parameters
Path Parameters
"uuid"Request Body
Responses
Phone updated. Returns the rendered cart.
Samples
Set Custom Field
Sets a custom field on the cart. Custom fields are accessible via the fields property in the rendered cart.
Parameters
Path Parameters
"uuid"The field key.
"giftMessage"Request Body
Responses
Field set. Returns the rendered cart.
Samples
Remove Custom Field
Removes a custom field from the cart.
Parameters
Path Parameters
"uuid"The field key to remove.
Responses
Field removed. Returns the rendered cart.
Samples
Add Coupon
Adds a coupon code to the cart.
Parameters
Path Parameters
"uuid"Request Body
Responses
Coupon added. Returns the rendered cart.
Samples
Remove Coupon
Removes a coupon from the cart.
Parameters
Path Parameters
"uuid"Request Body
Responses
Coupon removed. Returns the rendered cart.
Samples
Get Cart Profiles
Returns the list of configured cart profiles with their settings (currency, allowed countries, etc.).
Responses
List of cart profiles.