Attributes
string
Checkout session id (
cs_…).string
Checkout mode.
string
Presentation mode.
string
open: active, buyer can continue. complete: the hosted payment or subscription activation finished; inspect payment_status and process webhooks. expired: timed out, buyer must start a new session.string
Payment outcome.
string
Hosted checkout URL (
ui_mode: hosted only). Redirect the buyer here to begin payment.integer
Subtotal plus the amounts of selected optional items in minor units.
string
Uppercase three-letter ISO currency code, derived from the first line item.
string | null
The payment intent created to collect this session (
pi_…). Null until the session is confirmed.string | null
Merchant-supplied reference id.
integer
Unix epoch seconds when this session expires.
object
Custom key-value pairs attached to this session.
Endpoints
Notes
line_itemsis required when creating a session.mode: paymentaccepts either catalog-backed items withprice_idor inline items withname,amount, andcurrency.mode: subscriptionrequires recurring catalog prices. Recurring items must share one currency and billing cadence.- Hosted checkout confirms payment or activates the subscription for you. Do not call the merchant confirm endpoint from a hosted integration.
POST /v1/checkout/sessions/{id}/confirmtakes no JSON body and does not support subscription-mode sessions.- Quantity and optional-item mutations only apply while a session is open and before the payment intent is attached.
- Hosted checkout URLs are buyer-facing capability URLs. Merchant API keys should stay on your server.
- Treat redirects as user-experience signals. Verify server-side state before fulfillment.

