Create a payment session
Payment sessions
Create a payment session
POST /payment-sessions — the one server-side call per checkout
POST
Create a payment session
Creates a payment session for one checkout. Call this from your backend when
the customer reaches your payment step, then pass the returned
sessionId,
clientSecret, and vault block to the widget.
Request
Amount in minor units (e.g.
4900 = 49.00). Must be a positive integer.ISO 4217 alpha-3 currency code, e.g.
"USD".Your order reference. Echoed on the session, in webhooks, and in the
dashboard — use it to correlate SwitchFlow events with your orders.
The paying customer’s email.
Optional but strongly recommended. Retrying with the same key returns the
original session instead of creating a duplicate.
Response
Session identifier — pass to the widget; use it to query status later.
Single-session credential for the widget. Deliver it to your checkout page;
never log it.
CREATED on creation. Later transitions: SUCCEEDED, DECLINED,
DEGRADED, EXPIRED.When the session stops accepting submission. Create a fresh session if the
customer returns after expiry.
Tokenization configuration for the widget. Pass it to
SwitchFlow.mount()
verbatim — its fields vary by vault mode and you should treat it as opaque.
See widget reference.