Commerce API Reference
The Commerce app exposes public HTTP ingresses for cart management and customer order lookup. All endpoints are prefixed with /ingress/commerce/.
TIP
All cart mutation endpoints return the rendered cart on success. Error responses return { error: { code, message } }. The order lookup endpoint returns a customer-facing order representation on success and uses a uniform 404 ORDER_NOT_FOUND response for unknown references and e-mail mismatches.
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
Lookup Order
Looks up a customer-facing order by a live cart number, order number, or delivery number and a matching e-mail address. E-mail comparison is case-insensitive. A live cart uses its cart e-mail; an order uses its invoice-recipient and delivery-address e-mails. Unknown references, e-mail mismatches, and query failures intentionally return the same ORDER_NOT_FOUND response to prevent reference enumeration. A cart number stops resolving after its cart has been deleted; use an order or delivery number for historical lookup.
Request Body
Responses
Customer-facing order representation. When the originating cart still exists, this is rendered from that cart; otherwise it is rendered from the order and its deliveries.
Samples
Get Cart Profiles
Returns the list of configured cart profiles with their settings (currency, allowed countries, etc.).
Responses
List of cart profiles.