Skip to navigation

Create a new cart

Starts a new, empty cart and returns its id. Keep that id for the rest of the shopper’s session: every other cart endpoint is scoped to it, and it cannot be recovered from anything else. The response also includes checkoutUrl, the hosted page you send the shopper to when they are ready to pay.

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

localestringOptional

BCP 47 locale for the cart contents (e.g. da-DK, en-US). Defaults to the store’s configured locale.

codesstringOptional

Comma-separated discount codes to attach at creation, for campaign deep links (?codes=SOMMER25,VIP). An empty cart qualifies for nothing, so they land in cart.pendingDiscountCodes and apply on their own once a qualifying line is added. Lenient by design and unlike POST /api/cart/discounts: no per-code verdict is returned, blank or over-long codes and anything past the tenth are dropped, unknown codes are dropped, and if the store cannot apply codes yet the cart is still created without them. Send the codes again via POST /api/cart/discounts to learn why one did not apply.

Response

The newly created cart, including its id and checkoutUrl.
cartobject

Errors

401
Unauthorized Error
404
Not Found Error