> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prava.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Payment Result

> Retrieve payment credentials and transaction status for a session

<Note>
  This is a **polling endpoint**: after the cardholder completes card entry and passkey approval on
  Prava's secure surface, poll it to retrieve the payment credentials.
</Note>

## Notes

* 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 are reflected in the status.
* After using the credentials at checkout, report the outcome via [Report Status](/api-reference/report-status).

## 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 |


## OpenAPI

````yaml api-reference/openapi.json GET /v1/sessions/{sessionId}/payment-result
openapi: 3.1.0
info:
  title: Prava Payments API
  description: >-
    Server-side REST API for Prava Payments. All requests are authenticated with
    your secret key (sk_test_* in sandbox, sk_live_* in production).
  version: 1.0.0
servers:
  - url: https://sandbox.api.prava.space
    description: Sandbox
  - url: https://api.prava.space
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/sessions/{sessionId}/payment-result:
    get:
      summary: Get Payment Result
      description: >-
        Retrieve payment credentials and transaction status for a session. This
        is a polling endpoint — call it after the user completes authentication
        to retrieve payment credentials.
      operationId: getPaymentResult
      parameters:
        - name: sessionId
          in: path
          required: true
          description: The session ID returned from Create Session
          schema:
            type: string
      responses:
        '200':
          description: Payment result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResult'
        '401':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
components:
  schemas:
    PaymentResult:
      type: object
      properties:
        session_id:
          type: string
        order_id:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - pending
            - awaiting_result
            - completed
            - failed
          description: Overall session status
        transactions:
          type: array
          items:
            type: object
            properties:
              txn_id:
                type: string
              status:
                type: string
                enum:
                  - pending
                  - awaiting_result
                  - completed
                  - failed
              line_items:
                type: array
                items:
                  type: object
                  properties:
                    txn_ref_id:
                      type: string
                      description: >-
                        Transaction line item reference ID (used in Report
                        Status)
                    merchant_name:
                      type:
                        - string
                        - 'null'
                    merchant_url:
                      type:
                        - string
                        - 'null'
                    total_amount:
                      type: string
                    status:
                      type: string
                    token:
                      type:
                        - string
                        - 'null'
                      description: >-
                        Virtual card number (network token). Only present when
                        status is awaiting_result.
                    dynamic_cvv:
                      type:
                        - string
                        - 'null'
                      description: >-
                        Single-use CVV. Only present when status is
                        awaiting_result.
                    expiry_month:
                      type:
                        - string
                        - 'null'
                    expiry_year:
                      type:
                        - string
                        - 'null'
                    products:
                      type: array
                      items:
                        type: object
                        properties:
                          product_ref_id:
                            type: string
                          external_product_id:
                            type:
                              - string
                              - 'null'
                          name:
                            type: string
                          unit_price:
                            type: string
                          quantity:
                            type: number
              error:
                type: object
                description: Present only when the transaction has failed
                properties:
                  code:
                    type: string
                  message:
                    type: string
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code (e.g. VAL_2001, AUTH_1001)
            message:
              type: string
              description: Human-readable error message
            details:
              type: object
              description: >-
                Optional — included for validation errors to specify which
                fields failed
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your secret key: sk_test_* (sandbox) or sk_live_* (production).'

````