Requires an API key (Account > Developers in the dashboard) and a plan with the Checkout API feature. Call it from your backend only; never expose your API key in a browser.
Create a session
One endpoint:POST /v1/shops/{shopId}/checkout. Full parameter list and playground: Create Checkout Session.
url. Without a preselected payment method it opens the hosted checkout; with email + a payment method it goes straight to the payment provider (see below).
Cart items
Each cart item is one of two kinds, and both kinds can be mixed in one cart:- Catalog item
- Custom item
References a product you sell. Stock, delivery, and pricing come from the catalog.
custom_fields (values for the product’s custom fields, keyed by field name) and subscribe (start a subscription on subscription-enabled variants).
Skipping checkout steps
Provide what you already know and the buyer will not be asked for it:email and a payment method (payment_method_id, or the deprecated gateway type), the invoice is created as pending and a payment session starts immediately: the returned url points directly to the payment provider (Stripe, PayPal, a crypto payment page, and so on).
Also accepted: billing and shipping address fields (billing_*, shipping_*), an affiliate code to credit, newsletter opt-in, and buyer context you should forward from your backend (ip, country_code, user_agent) so fraud checks see the real buyer instead of your server.
Metadata
Attach up to 10 string values; they are stored on the invoice and returned when you fetch it later:Attribution
If your backend knows how the buyer arrived, forward it so the invoice carries the same campaign data your storefront orders get. Keys areutm_source, utm_medium, utm_campaign, utm_term, utm_content and referrer_host (host only, no path), each at most 100 characters:
After the sale
Track payment and delivery with HTTP notifications, or poll Get Invoice with the returnedinvoice_id.