ShopItUp Developers v1

Checkout

Create a checkout for the person to confirm and pay

Live

POST 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:write How to get a token
Returns
The checkout

Headers

  • Idempotency-Key string Required

    Any unique string per checkout you mean to create, e.g. a UUID. Repeating it returns the first response.

    up to 64 characters

Request body

JSON, sent with Content-Type: application/json.

  • quote_id string Required
  • email string email Required

    Where the order confirmation and tracking are sent

  • first_name string Can be null
  • last_name string Can be null
  • shipping_selections map Can be null

    Store slug → shipping option key. Leave out (or null) to use each store's cheapest option.

Response

201 The checkout

  • checkout_id string
  • status string

    awaiting_payment until the person pays; paid (with order_number); cancelled if the order was; expired once the link lapsed unpaid

    One of awaiting_payment paid cancelled expired
  • checkout_url string uri

    Give this to the person — it opens the store's checkout with the order filled in, where they accept the terms and pay

  • expires_at string date-time
  • order_number string Can be null

    Set once paid

  • totals Totals

    subtotal − discount + shipping + tax = grand_total

    5 child attributes
    • subtotal Money
      2 child attributes
      • amount string Required

        Decimal string, two places

      • currency string Required
        One of CAD
    • discount Money
      2 child attributes
      • amount string Required

        Decimal string, two places

      • currency string Required
        One of CAD
    • shipping Money
      2 child attributes
      • amount string Required

        Decimal string, two places

      • currency string Required
        One of CAD
    • tax Money
      2 child attributes
      • amount string Required

        Decimal string, two places

      • currency string Required
        One of CAD
    • grand_total Money
      2 child attributes
      • amount string Required

        Decimal string, two places

      • currency string Required
        One of CAD

Status codes

201

The checkout

401

Missing, invalid or expired access token

403

The token does not carry the scope this endpoint needs

409

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.

422

The request is invalid; fields says which field and why

429

Too many requests; retry after the number of seconds in Retry-After

503

A service the API depends on is briefly unavailable; retry after the number of seconds in Retry-After

Errors share one shape — see Errors and rate limits.