Overview
The Prava REST API is used for server-side operations — creating sessions, managing cards, retrieving payment results, and reporting status. All server-side requests are authenticated using your secret key.Base URLs
| Environment | Base URL | Key Prefix |
|---|---|---|
| Sandbox | https://sandbox.api.prava.space | sk_test_* |
| Production | https://api.prava.space | sk_live_* |
Authentication
All API requests require a Bearer token using your secret key:Response Format
All responses are JSON. Every response includes anX-Response-ID header for debugging:
Error Response Format
All errors follow a consistent structure:details field is optional and included for validation errors to specify which fields failed.
Common Error Codes
| Status | Code | Description |
|---|---|---|
| 401 | AUTH_1001 | Invalid API key |
| 401 | AUTH_1002 | Missing or invalid Authorization header |
| 401 | AUTH_1003 | Session has been revoked |
| 401 | AUTH_1004 | Invalid or expired session token |
| 400 | VAL_2001 | Validation error (check details for specifics) |
| 404 | NOT_FOUND | Requested resource not found |
| 400 | INVALID_STATE | Operation not allowed in current state |
Endpoints
Create Session
Create a new payment session with order details
Revoke Session
Revoke an active session
List Cards
Retrieve enrolled cards for a customer
Get Payment Result
Retrieve the result of a payment
Report Status
Report payment execution status back to Prava