Endpoint
| Environment | Full URL |
|---|---|
| Sandbox | https://sandbox.api.prava.space/v1/sessions |
| Production | https://api.prava.space/v1/sessions |
Authentication
Bearer token using your secret key:Request Body
user_id and user_email are required for merchant (secret-key) requests. They identify the
customer this session belongs to.Required Fields
Unique identifier for the customer in your system (max 255 characters)
Customer’s email address (must be a valid email)
Total order amount in decimal format (e.g.,
"49.99")ISO 4217 currency code — exactly 3 uppercase letters (e.g.,
"USD")Array containing exactly 1 purchase context object describing the order. Multi-merchant sessions are not currently supported.
Optional Fields
Customer’s phone number
Customer’s country — exactly 2 uppercase letters ISO 3166-1 (e.g.,
"US")Your external order reference ID (max 255 characters)
Human-readable description of the order
How the card is collected. One of:
"full_checkout"(default) — hosted mode. Theiframe_urlis a full Prava-hosted page you redirect the cardholder to; Prava returns them to yourcallback_urlwhen done. No SDK required."embedding"— embedded mode. Mount theiframe_urlinside your own page with the SDK (collectPAN) and handle the result in-app.
For hosted checkout: the URL Prava redirects the cardholder to after they finish. Must use
https (max 2048 characters).Pre-select a card for the session
Response (201)
Unique session identifier
JWT token used to authenticate client-side SDK operations within this session
URL for the secure card collection surface. Embed it via the SDK’s
collectPAN(), or open it
directly (append session_token) for hosted checkout — see Integration Modes.Internal order identifier
ISO 8601 timestamp indicating when the session expires
Example
Response
Error Responses
| Status | Code | Cause |
|---|---|---|
| 400 | VAL_2001 | Validation error — missing or invalid fields (details included in response) |
| 401 | AUTH_1001 | Invalid API key |
| 401 | AUTH_1002 | Missing or invalid Authorization header |
| 429 | TRIES_EXHAUSTED | Sandbox test-transaction limit reached for this merchant |
| 500 | MERCHANT_LOOKUP_ERROR | Failed to load merchant account for the given key |
| 500 | CONFIG_ERROR | Server-side configuration issue (Visa or Skyflow not configured) |
Error Response Format
Notes
- Sessions are short-lived and expire after a configured duration.
- Sessions are single-use — tied to a specific merchant, customer, and order.
- Only one
purchase_contextentry is supported per session (multi-merchant not yet available). - The
effective_until_minutesfield inpurchase_contextcontrols how long the mandate is valid (default: 15 minutes). - Sessions can be revoked via
POST /v1/sessions/:id/revoke. - The
session_tokenandiframe_urlare used on the frontend — embedded via the SDK, or opened directly for hosted checkout. - Set
integration_type: "embedding"for the SDK flow; omit it (or use"full_checkout") for hosted, and provide acallback_url.