Create a cart (optionally with lines)
POST
/ store/ v1/ carts- Idempotency-Key supported
Create a cart (optionally with lines). Send X-Customer-Token to link a signed-in customer. The response carries the cart token: send it as X-Cart-Token on every cart request; and the cart's checkout_url, the hosted checkout to send the shopper to.
Headers
X-Customer-Tokenstring · or nullCustomer session token
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
linesarray of objectsemailstring · or nulllocalestring · or nullThe shopper's language for emails, e.g.
aroren. Defaults to the store's.countrystring · or nullThe country the storefront shows, e.g.
AE: the cart prices in its market (currency and prices) until it has a shipping address. Defaults to the primary market.
Returns
201 Cart created.
Errors
- 401
unauthenticatedInvalid customer session. - 422
validation_failedInvalid lines, email or locale.