Endpoint
GET /v1/sessions/:sessionId/payment-result
| Environment | Full URL |
|---|
| Sandbox | https://sandbox.api.prava.space/v1/sessions/:sessionId/payment-result |
| Production | https://api.prava.space/v1/sessions/:sessionId/payment-result |
Authentication
Bearer token using your secret key:
Authorization: Bearer sk_test_xxx
Path Parameters
Response
The internal order identifier
Overall session status: pending, awaiting_result, completed, or failed
Array of transactions within this session
Unique transaction identifier
Transaction status: pending, awaiting_result, completed, or failed
Transaction line items with payment credentials
Total amount for this line item
Virtual card number (network token) for checkout. Only present when status is awaiting_result.
Single-use CVV for checkout. Only present when status is awaiting_result.
Products in this line item
Internal product reference ID
Your external product identifier
Present only when the transaction has failed
Human-readable error message
Example
Swap the host for production: use https://api.prava.space instead of https://sandbox.api.prava.space.
curl https://sandbox.api.prava.space/v1/sessions/ses_a1b2c3d4/payment-result \
-H "Authorization: Bearer sk_test_xxx"
curl https://api.prava.space/v1/sessions/ses_a1b2c3d4/payment-result \
-H "Authorization: Bearer sk_live_xxx"
const BASE_URL = 'https://sandbox.api.prava.space'; // or https://api.prava.space
const result = await fetch(
`${BASE_URL}/v1/sessions/ses_a1b2c3d4/payment-result`,
{
headers: {
'Authorization': `Bearer ${SECRET_KEY}`,
},
}
).then(res => res.json());
Response
{
"session_id": "ses_a1b2c3d4",
"order_id": "ord_m7kx9",
"status": "awaiting_result",
"transactions": [
{
"txn_id": "txn_xyz789",
"status": "awaiting_result",
"line_items": [
{
"txn_ref_id": "tli_abc123",
"merchant_name": "Amazon",
"merchant_url": "https://amazon.com",
"total_amount": "49.99",
"status": "awaiting_result",
"token": "4811729300123456",
"dynamic_cvv": "491",
"expiry_month": "02",
"expiry_year": "2028",
"products": [
{
"product_ref_id": "prd_def456",
"external_product_id": "B0EXAMPLE",
"name": "Wireless Headphones",
"unit_price": "49.99",
"quantity": 1
}
]
}
]
}
]
}
Error Responses
| Status | Code | Cause |
|---|
| 401 | AUTH_1001 | Invalid API key |
| 401 | AUTH_1002 | Missing or invalid Authorization header |
| 404 | NOT_FOUND | Session not found or doesn’t belong to your merchant account |
{
"error": {
"code": "NOT_FOUND",
"message": "Session not found"
}
}
Notes
- This is a polling endpoint — call it after the user completes authentication and intent registration to retrieve payment credentials.
- The
token and dynamic_cvv fields contain the virtual card credentials your agent uses at checkout.
- Prava performs a lazy mandate expiry check on every request — expired mandates will be reflected in the status.
- After using the credentials at checkout, report the outcome via Report Status.