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

# Retrieve a payment

> The current state of one of your payments; a pending one moves as the processor settles it.



## OpenAPI

````yaml /api-reference/openapi-v1.json get /payments/{id}
openapi: 3.1.0
info:
  title: Payra API
  version: v1
  description: >-
    The Payra API. Authenticate with a secret key: `Authorization: Bearer
    sk_test_...`. The two payment method session endpoints Payra Elements calls
    also take a publishable key with the session's `client_secret`.
servers:
  - url: https://api-dashboard.payra.com/v1
    description: 'Sandbox and live: the key decides which'
security: []
paths:
  /payments/{id}:
    get:
      tags:
        - Payments
      summary: Retrieve a payment
      description: >-
        The current state of one of your payments; a pending one moves as the
        processor settles it.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
          required: true
          name: id
          in: path
      responses:
        '200':
          description: The payment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '401':
          description: Missing, invalid or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The API is not enabled for the workspace, or the key lacks the scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such payment in this workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded; see Retry-After
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Payment:
      type: object
      properties:
        object:
          type: string
          enum:
            - payment
        id:
          type: string
          example: pay_test_7Hs2kQ9mL1pXv4cR8tWzAbCdEf
        status:
          type: string
          enum:
            - processing
            - requires_action
            - authorized
            - succeeded
            - failed
            - canceled
            - returned
          example: succeeded
          description: >-
            `processing` until the processor answers, and, on a bank debit,
            until it settles, that is until the processor sends it to the bank
            in its next batch; `authorized` when it approved but has not
            captured; `succeeded` once a card is captured or a bank debit has
            settled, which does not make a bank debit final (see `returned`);
            `failed` when it refused (the create then answers 402 and this
            object stays readable); `canceled` after a void; `returned` when the
            money came back after success (a bank return or a chargeback, see
            `failure`); `requires_action` if the processor asked for a step this
            server-side charge cannot take.
        amount:
          type: integer
          example: 12550
          description: In the smallest unit of the currency (cents).
        amount_refunded:
          type: integer
          default: 0
          example: 0
          description: >-
            How much of `amount` has been refunded so far, counting refunds that
            succeeded, wherever they were made. `status` stays `succeeded`; `GET
            /v1/refunds?payment=` lists them.
        currency:
          type: string
          enum:
            - USD
            - CAD
          example: USD
        payment_method:
          type: string
          example: pm_test_9kQ2mL7Hs1pXv4cR8tWzAbCdEf
        payment_method_type:
          type: string
          enum:
            - card
            - us_bank_account
          default: card
          example: card
        customer:
          type:
            - string
            - 'null'
          format: uuid
          example: null
        description:
          type:
            - string
            - 'null'
          example: Invoice INV-1042
        reference:
          type:
            - string
            - 'null'
          example: INV-1042
          description: Your reference, as you sent it.
        card:
          $ref: '#/components/schemas/PaymentCard'
        us_bank_account:
          type:
            - object
            - 'null'
          properties:
            last4:
              type: string
              example: '6789'
            account_type:
              type: string
              enum:
                - checking
                - savings
              example: checking
            account_holder_type:
              type: string
              enum:
                - individual
                - company
              example: individual
          default: null
          required:
            - last4
            - account_type
            - account_holder_type
          description: Set when `payment_method_type` is `us_bank_account`.
          example: null
        failure:
          type:
            - object
            - 'null'
          properties:
            code:
              type: string
              enum:
                - card_declined
                - insufficient_funds
                - authentication_failed
                - invalid_payment_method
                - duplicate_transaction
                - ach_returned
                - chargeback
                - processing_error
              example: card_declined
            message:
              type: string
              example: The card was declined.
          required:
            - code
            - message
          description: >-
            Set when `status` is `failed` or `returned`: why, in a fixed
            vocabulary. `card_declined`, `insufficient_funds`,
            `authentication_failed`, `invalid_payment_method` and
            `duplicate_transaction` are the processor refusing the card;
            `ach_returned` and `chargeback` are money coming back after success;
            `processing_error` is a fault on the way to the processor or in the
            request, safe to retry later; a refusal in words Payra cannot
            classify reads `card_declined`. The processor's own text is never
            relayed.
        next_action:
          type:
            - object
            - 'null'
          properties:
            type:
              type: string
              enum:
                - redirect
            url:
              type: string
          required:
            - type
            - url
          example: null
          description: >-
            A server-side charge sends no 3-D Secure return address, so this is
            normally null; if a processor asks for a redirect anyway, it is
            here.
        livemode:
          type: boolean
          example: false
        created_at:
          type: string
          format: date-time
          example: '2026-09-18T20:00:00.000Z'
        succeeded_at:
          type:
            - string
            - 'null'
          format: date-time
          example: '2026-09-18T20:00:01.312Z'
          description: When the card was captured, or the bank debit settled.
      required:
        - object
        - id
        - status
        - amount
        - currency
        - payment_method
        - customer
        - description
        - reference
        - card
        - failure
        - next_action
        - livemode
        - created_at
        - succeeded_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - idempotency_error
                - card_error
                - api_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
            request_id:
              type: string
          required:
            - type
            - code
            - message
            - request_id
          additionalProperties:
            type: string
      required:
        - error
    PaymentCard:
      type:
        - object
        - 'null'
      properties:
        brand:
          type:
            - string
            - 'null'
          example: visa
        last4:
          type: string
          example: '4242'
        exp_month:
          type: integer
          example: 12
        exp_year:
          type: integer
          example: 2030
      required:
        - brand
        - last4
        - exp_month
        - exp_year
      description: Set when `payment_method_type` is `card`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A secret key, `sk_test_...` or `sk_live_...`; a publishable key
        (`pk_...`) on the browser routes only

````