Server-Side API
Create Session
Create a payment session for a customer and order — standard checkout or mandate setup.
POST
Create a short-lived, single-use session tied to one merchant, customer, and order. The response gives you a
session_token + iframe_url for the frontend — embed the iframe via the SDK or open the hosted checkout directly.
POST /v1/sessions · Authenticated with your secret key.
Which flow?
- Standard checkout
- Mandate setup
Omit
mandate_setup (or send intent: "checkout"). The session collects a card and charges immediately.Mandate setup
Mandate creation is part of the Session APIs — this endpoint is how mandates are created. Send amandate_setup block (see Body) with intent: "mandate_setup" and the session becomes authorize-only: the response carries an iframe_url where the owner approves once with their passkey, authorizeOnly: true, and no credentials. Once the mandate is active, charge it any time with Charge a Mandate — no further passkey needed.
The mandate_setup field reference below covers recurring_frequency, merchant_scope, max_charges, and valid_until; see Mandates for the concept and guardrails.
Choosing a card source. Omit
card to let the cardholder select or enter a card in the collection surface. Send card.card_id to pre-select an already-enrolled card, or card.vault_ref_id (a Skyflow UUID) for the vault-ref flow. Send exactly one — if both are present, card_id wins.Body
string
required
Unique identifier for the customer in your system (1–255 chars). Required for merchant (secret-key) sessions — omitting it returns
400 VAL_2001.string
required
Customer email. Required for merchant sessions. Must be a valid email address.
string
required
Total order amount as a decimal string with up to 2 decimals, e.g.
"49.99". Need not equal the sum of line items (it may include tax, shipping, and fees). This value becomes the authorized amount cap.string
required
ISO 4217 code — 3 uppercase letters — and must be a supported currency. Supported: USD, EUR, GBP, INR, CAD, AUD, JPY, SGD, AED, HKD, MXN, BRL, CHF, CNY, NZD, SEK, NOK, DKK, ZAR, THB, KRW, PLN, TWD, PHP, IDR, MYR, CZK, ILS, CLP, ARS, COP, PEN, SAR, QAR, KWD, BHD, OMR, EGP, NGN, KES, GHS, TZS, UGX, PKR, BDT, LKR, VND, MMK, NPR. Other codes are rejected.This is your pricing currency and is independent of the card’s issuing country: there is no requirement that it match
country_code_iso2 (the merchant’s location) or the cardholder’s country. A US-issued card can pay an INR-denominated session; the card network settles the cross-currency conversion. Price in whatever currency your product uses — you don’t need to re-denominate.object
required
What is being bought. Two modes — pick one:
- From a quote — send
quote: trueand aquote_id. Merchant and product details come from the /quote endpoint, so nothing else is needed. - Custom — omit
quote(or sendfalse) and describe the merchant and products yourself incustom.
string
default:"full_checkout"
full_checkout (hosted redirect) or embedding (mount the iframe via the SDK). Read by the frontend to choose the surface.string
For hosted checkout: the URL Prava redirects the cardholder to after they finish. Must use
https, max 2048 chars. Optional for all integration types.object
Pre-select a card. Send one of the two fields below (see the note above).
object
Turns the session into mandate setup (authorize-only). See the Mandate setup tab above.
string
Customer phone number.
string
Customer country — 2 uppercase ISO 3166-1 letters.
string
Your external order reference id, max 255 chars.
string
Human-readable description of the order.
Response
string
Unique session identifier.
string
JWT authenticating client-side SDK calls within this session.
string
Secure card-collection (or, for mandate setup, passkey-approval) surface.
string
Internal order identifier.
string
ISO 8601 timestamp when the session expires.
boolean
Present and
true for mandate-setup sessions (no credentials issued).Notes
- Sessions are short-lived and single-use, tied to a specific merchant, customer, and order.
session_tokenandiframe_urlare used on the frontend: embedded via the SDK, or opened directly for hosted checkout.- Sessions can be revoked before use via
POST /v1/sessions/:id/revoke.