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

# List invoices

> Your workspace's invoices, newest first, drafts left out. Filter by `number` or `external_id` to find one invoice, or by `customer` and `status` to show a customer what they owe. Each one carries its `payment_url` while it can be paid.



## OpenAPI

````yaml /api-reference/openapi-v1.json get /invoices
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:
    get:
      tags:
        - Invoices
      summary: List invoices
      description: >-
        Your workspace's invoices, newest first, drafts left out. Filter by
        `number` or `external_id` to find one invoice, or by `customer` and
        `status` to show a customer what they owe. Each one carries its
        `payment_url` while it can be paid.
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
            example: 20
            description: How many to return, 1 to 100.
          required: false
          description: How many to return, 1 to 100.
          name: limit
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 64
            example: 019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c31
            description: >-
              The `id` of the last invoice of the previous page; the page after
              it is returned.
          required: false
          description: >-
            The `id` of the last invoice of the previous page; the page after it
            is returned.
          name: starting_after
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            example: INV-1042
            description: >-
              Only invoices with this number. Usually one; a number can repeat
              across customers.
          required: false
          description: >-
            Only invoices with this number. Usually one; a number can repeat
            across customers.
          name: number
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            example: SO-55512
            description: 'Only the invoice your ERP knows by this id: at most one.'
          required: false
          description: 'Only the invoice your ERP knows by this id: at most one.'
          name: external_id
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 100
            example: 019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c30
            description: Only this customer's invoices.
          required: false
          description: Only this customer's invoices.
          name: customer
          in: query
        - schema:
            type: string
            enum:
              - open
              - paid
              - canceled
            example: open
          required: false
          name: status
          in: query
      responses:
        '200':
          description: A page of invoices
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceList'
        '400':
          description: >-
            `limit` out of range, or `starting_after` is not an invoice of this
            workspace
          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'
        '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:
    InvoiceList:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Invoice'
        has_more:
          type: boolean
      required:
        - object
        - data
        - has_more
    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
    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
  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.