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

> One invoice of your workspace, whether it came from your ERP or was created in the Payra dashboard.



## OpenAPI

````yaml /api-reference/openapi-v1.json get /invoices/{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:
  /invoices/{id}:
    get:
      tags:
        - Invoices
      summary: Retrieve an invoice
      description: >-
        One invoice of your workspace, whether it came from your ERP or was
        created in the Payra dashboard.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
          required: true
          name: id
          in: path
      responses:
        '200':
          description: The invoice
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '400':
          description: '`id` is empty or longer than 64 characters'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '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 invoice 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:
    Invoice:
      type: object
      properties:
        object:
          type: string
          enum:
            - invoice
        id:
          type: string
          format: uuid
          example: 019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c31
        number:
          type:
            - string
            - 'null'
          example: INV-1042
          description: The invoice number your customer sees.
        external_id:
          type:
            - string
            - 'null'
          example: SO-55512
          description: >-
            Your ERP's id for the invoice; null for invoices created in the
            Payra dashboard.
        customer:
          type: string
          format: uuid
          example: 019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c30
          description: The customer the invoice bills, as `GET /customers/{id}` knows it.
        status:
          type: string
          enum:
            - open
            - paid
            - canceled
          example: open
          description: >-
            `open` still owes money, whether sent or scheduled to be sent;
            `paid` and `canceled` are settled. Drafts are not listed.
        past_due:
          type: boolean
          example: false
          description: True from the day after `due_date` while the invoice is `open`.
        currency:
          type: string
          example: USD
          description: 'ISO 4217: USD or CAD.'
        total:
          type: integer
          example: 125000
          description: The invoice total, in the smallest unit.
        amount_paid:
          type: integer
          example: 25000
          description: Collected so far, refunds netted out.
        amount_pending:
          type: integer
          example: 0
          description: >-
            Charges still processing, such as a bank debit not yet settled; owed
            until they fail.
        amount_due:
          type: integer
          example: 100000
          description: >-
            What a payer can still pay today: the total less what was paid,
            pending or written off. An early-payment discount is applied on the
            payment page, not here.
        invoice_date:
          type: string
          format: date
          example: '2026-09-30'
        due_date:
          type: string
          format: date
          example: '2026-10-30'
        payment_url:
          type:
            - string
            - 'null'
          format: uri
          example: https://dashboard.payra.com/pay/4f8c1d2e3b5a6c7d8e9f0a1b2c3d4e5f
          description: >-
            The hosted page where the customer pays this invoice. Null when
            there is none a payer could use: the invoice is settled, nothing is
            left to pay while a charge is pending, its link expired or was
            revoked, or no link was ever made (an invoice created in the
            dashboard and never sent). The URL stays the same while it works, so
            it can be printed; it changes when the invoice is sent again from
            the dashboard, and the earlier one keeps working.
        livemode:
          type: boolean
          example: true
        created_at:
          type: string
          format: date-time
          example: '2026-09-30T23:00:40.670Z'
      required:
        - object
        - id
        - number
        - external_id
        - customer
        - status
        - past_due
        - currency
        - total
        - amount_paid
        - amount_pending
        - amount_due
        - invoice_date
        - due_date
        - payment_url
        - livemode
        - created_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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A secret key, `sk_test_...` or `sk_live_...`; a publishable key
        (`pk_...`) on the browser routes only

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.