Skip to main content
Primary path for Vite storefronts (platform-checkout.ts). Creates a draft order and returns an id you open at /checkout/{orderId}.

Rate limit

15 requests / 60 seconds per client → 429.

Body

string
required
Store subdomain.
array
required
At least one line. Each line needs id or productId, plus name. Quantity/price/image optional.
string
Optional pre-allocated checkout order id (must pass isValidCheckoutOrderId).
string
Affiliate / referral code.

Response 200

Navigate the buyer to /checkout/{orderId} on the app origin. The response also sets an httpOnly checkout access cookie for that order (7 days). checkoutToken is the same value, for clients that open checkout on another host via GET /api/checkout/enter?orderId=…&token=…. An invalid body returns 400 { "error": "Invalid request", "details": … }. A malformed orderId returns 400 Invalid order id.

Notes

  • Same-origin from the storefront is the expected caller. This is not CORS-opened like embed checkout.
  • Prefer this over inventing orders in the client — stock, holds, and pricing are resolved server-side in startCheckout.
  • Embed merchants should use POST /api/embed/checkout instead; it builds the cart from product ids and returns an embed URL with ?embed=1.