Skip to navigation

Get the current state of a cart

Reads back a cart’s lines, totals and checkoutUrl by id. Use it to re-render the basket on load, or to restore a returning shopper’s basket from a saved cart id. It only reads the cart — it never adds, removes or re-prices items. A cart a member token has bound (metadata.member_key) is read only with that member’s token, and its checkoutUrl comes back without the ct ticket, which the hosted checkout refuses: send the member to the checkoutUrl from the latest member-token call on a binding route (create, PATCH /api/cart, /identity, /lines), or make one — e.g. PATCH /api/cart with the current locale — to get a fresh one.

Headers

x-entriastringRequired

Identifies which store this request is for. Required on every store-scoped route. It is not authentication and not a secret — it grants no privileges and is safe to send from a browser. You receive the value once your Entria backend has been created and configured. Missing header returns 400; an unknown store returns 404.

Query parameters

cartIdstringRequired
The id returned when the cart was created.

Response

The cart as it currently stands, including its items, totals and checkoutUrl.
cartobject

Errors

401
Unauthorized Error
404
Not Found Error