1
Create a session
POST /v1/checkout/sessions with your public or secret key.2
Redirect the buyer to the session url
3
The buyer comes back
Paid:
https://yoursite.com/thanks?session_id=cs_…Left without paying: your cancelUrl.4
Confirm the payment on your server
GET /v1/checkout/sessions/{id} with your secret key. Paid when status is complete.Status
open
open
Waiting for the buyer to pay.
complete
complete
The buyer paid.
order holds the order number, what they paid (delivery included) and how they’ll get it.expired
expired
Not paid within 30 minutes. Create a new session if the buyer wants to try again.
Rules
- One product per session.
quantity1–100. - Send
sizeandcolorexactly as Get product returns them. Leave them out if the product has none. - Stock is checked when you create the session.
customerpre-fills the checkout form.metadatacomes back untouched.