Skip to main content

Endpoint

GET /v1/sessions/:sessionId/payment-result
EnvironmentFull URL
Sandboxhttps://sandbox.api.prava.space/v1/sessions/:sessionId/payment-result
Productionhttps://api.prava.space/v1/sessions/:sessionId/payment-result

Authentication

Bearer token using your secret key:
Authorization: Bearer sk_test_xxx

Path Parameters

sessionId
string
required
The session ID returned from Create Session

Response

session_id
string
The session identifier
order_id
string | null
The internal order identifier
status
string
Overall session status: pending, awaiting_result, completed, or failed
transactions
array
Array of transactions within this session

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

StatusCodeCause
401AUTH_1001Invalid API key
401AUTH_1002Missing or invalid Authorization header
404NOT_FOUNDSession not found or doesn’t belong to your merchant account

Error Response Format

{
  "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.