Checkout
Create a checkout for the person to confirm and pay
Live
https://shopitup.ca/api/v1/checkout/sessions
Returns checkout_url for a quote. Give that link to the person: it opens the store's checkout with the order
already filled in — items, address and the shipping chosen here — where they review it, accept the terms and
pay (card or Link). The order is placed when they pay; follow it with GET /checkout/sessions/{checkout_id}.
The link expires after 30 minutes. Send an Idempotency-Key: the same key with the same request returns the
first checkout, so a retry never creates a second one.
- Access
-
checkout:writeHow to get a token - Returns
- The checkout
Headers
-
Idempotency-Keystring RequiredAny unique string per checkout you mean to create, e.g. a UUID. Repeating it returns the first response.
Request body
JSON, sent with Content-Type: application/json.
-
quote_idstring Required -
emailstring email RequiredWhere the order confirmation and tracking are sent
-
first_namestring Can be null -
last_namestring Can be null -
shipping_selectionsmap Can be nullStore slug → shipping option key. Leave out (or null) to use each store's cheapest option.
Response
201 The checkout
-
checkout_idstring -
statusstringawaiting_payment until the person pays; paid (with
order_number); cancelled if the order was; expired once the link lapsed unpaid -
checkout_urlstring uriGive this to the person — it opens the store's checkout with the order filled in, where they accept the terms and pay
-
expires_atstring date-time -
order_numberstring Can be nullSet once paid
-
totalsTotalssubtotal − discount + shipping + tax = grand_total
5 child attributes
-
subtotalMoney2 child attributes
-
amountstring RequiredDecimal string, two places
-
currencystring Required
-
-
discountMoney2 child attributes
-
amountstring RequiredDecimal string, two places
-
currencystring Required
-
-
shippingMoney2 child attributes
-
amountstring RequiredDecimal string, two places
-
currencystring Required
-
-
taxMoney2 child attributes
-
amountstring RequiredDecimal string, two places
-
currencystring Required
-
-
grand_totalMoney2 child attributes
-
amountstring RequiredDecimal string, two places
-
currencystring Required
-
-
Status codes
The checkout
Missing, invalid or expired access token
The token does not carry the scope this endpoint needs
The quote has expired (quote_expired), an item in it is no longer available (item_unavailable), or nothing in it can be bought (nothing_to_buy) — create a new quote.
The request is invalid; fields says which field and why
Too many requests; retry after the number of seconds in Retry-After
A service the API depends on is briefly unavailable; retry after the number of seconds in Retry-After