Checkout

Prepare a cart and get a link to it

Secret or publishable key. Permission checkout:write. Send the shopper to url: the cart opens with those lines; prices, stock, payment methods and every checkout guard are SitesPlaced's own. Up to 50 lines. Unknown or archived products give 422. With a publishable key, return_url must be on the key's allowed websites. The link works for 24 hours.

post/checkout/sessions

Request

  • Base URL: https://sitesplaced.com/api/v1
  • URL: https://sitesplaced.com/api/v1/checkout/sessions
  • Auth: one of:
    • HTTP bearer
    • API key in header X-Api-Key

Request body

return_urlstring uri

With a publishable key, this must be on the key's allowed websites.

Example request

{
  "items": [
    {
      "variant": {
        "Size": "M"
      }
    }
  ]
}

Response

The prepared cart.

urlstring uri required

Send the shopper here.

tokenstring required
expires_atstring date-time required

ISO 8601, in UTC.

Example response

{
  "url": "https://asha-jewels.sitesplaced.site/cart?restore=cl_…",
  "token": "cl_…"
}

Changes

No recorded changes to this operation across all 1 revision of this API.