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

# List invoices

> Lists every invoice on your account, newest first.




## OpenAPI

````yaml /api-reference/openapi.en.json get /billing/invoices
openapi: 3.1.0
info:
  title: Infi API
  version: 0.0.1
  description: >
    The Infi REST API: catalog, customers, usage metering, subscriptions,

    invoices, payments and checkout.


    **Authentication.** Send your secret key as `Authorization: Bearer
    sk_test_…`

    (sandbox) or `sk_live_…` (production). The key prefix selects the
    environment.

    Checkout routes (`/pay/*`) and `/public/*` take no key: they run in the

    payer's browser.


    **Idempotency.** Every request that changes data requires an

    `Idempotency-Key` header. A retry with the same key returns the original

    response instead of running again.


    **Amounts.** Money and quantities travel as decimal strings (`"150.00"`,

    `"0.0001"`), never as floating-point numbers.


    **Errors.** The body carries `error_code` (stable, branch on it), `message`

    (for humans) and `tracer_id` (send it to support). Rate-limit and
    idempotency

    errors are nested under `error`, with `code` and `request_id`.
servers:
  - url: https://api-sandbox.beinfi.com
    description: Sandbox
  - url: https://api.beinfi.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Catalog
  - name: Customers
  - name: Metering
  - name: Subscriptions
  - name: Invoices
  - name: Payments
  - name: Checkout
  - name: Coupons
  - name: Billing
  - name: Account
  - name: Webhooks
  - name: Test account
  - name: Rail
  - name: Storefronts
paths:
  /billing/invoices:
    get:
      tags:
        - Invoices
      summary: List invoices
      description: |
        Lists every invoice on your account, newest first.
      operationId: listTenantInvoices
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: How many invoices to return.
        - name: offset
          in: query
          required: false
          schema:
            type: integer
          description: How many invoices to skip before returning results.
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  invoices:
                    type: array
                    items:
                      $ref: '#/components/schemas/Invoice'
          description: Success.
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Invoice:
      type: object
      properties:
        id:
          type: string
          format: uuid
        customerId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The customer's product enrollment id. Set on product, usage and
            subscription invoices.
        payerId:
          type:
            - string
            - 'null'
          format: uuid
          description: The paying customer's id. Set on one-off invoices.
        subscriptionId:
          type:
            - string
            - 'null'
          format: uuid
          description: The subscription that generated the invoice
        invoiceNumber:
          type:
            - string
            - 'null'
          description: Sequential invoice number
        status:
          type: string
          enum:
            - draft
            - open
            - paid
            - void
            - uncollectible
          description: >-
            `draft` (being built), `open` (issued, awaiting payment), `paid`,
            `void` (canceled) or `uncollectible` (written off).
        currency:
          type: string
          description: Currency, as an ISO 4217 code (`BRL`).
        subtotal:
          type: string
          description: Sum of line items before tax and discounts.
        tax:
          type: string
          description: Tax on the invoice.
        total:
          type: string
          description: The invoice's final amount.
        amountDue:
          type: string
          description: How much is still owed.
        periodStart:
          type:
            - string
            - 'null'
          format: date-time
          description: Start of the billed period
        periodEnd:
          type:
            - string
            - 'null'
          format: date-time
          description: End of the billed period
        dueDate:
          type:
            - string
            - 'null'
          format: date-time
          description: Due date.
        finalizedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the invoice was issued.
        paidAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the invoice was paid.
        successUrl:
          type:
            - string
            - 'null'
          description: Where checkout sends the buyer after payment.
        cancelUrl:
          type:
            - string
            - 'null'
          description: Where checkout sends the buyer if they back out.
        createdAt:
          type: string
          format: date-time
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceLineItem'
      description: >-
        What a customer owes: line items, totals and status. Status: `draft` →
        `open` → `paid`, or `void` / `uncollectible`.
    InvoiceLineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - usage
            - recurring
            - proration
            - credit
            - adjustment
            - commitment
            - manual
          description: >-
            `usage` (metered usage), `recurring` (recurring fee), `proration`
            (pro-rata adjustment for a mid-period change), `credit`,
            `adjustment` (usage that arrived after its period was already
            invoiced), `commitment` (top-up to the minimum commitment) or
            `manual` (free-form line).
        meterId:
          type:
            - string
            - 'null'
          format: uuid
          description: The meter the usage came from
        priceId:
          type:
            - string
            - 'null'
          format: uuid
          description: The price applied to this line.
        description:
          type: string
        quantity:
          type: string
          description: Quantity billed
        unitPrice:
          type:
            - string
            - 'null'
          description: Price per unit
        amount:
          type: string
          description: Line total
        proration:
          type: boolean
          description: '`true` when the line is a pro-rated amount.'
      description: One line on an invoice.
    Error:
      type: object
      required:
        - message
        - error_code
        - tracer_id
      properties:
        message:
          type: string
          description: Human-readable sentence.
        error_code:
          $ref: '#/components/schemas/ErrorCode'
          description: Stable error code. Branch on it.
        tracer_id:
          type: string
          description: Request id. Include it when contacting support.
      description: >-
        The standard error body. It is flat (no `error` wrapper) and the trace
        id is `tracer_id`.
    ErrorCode:
      type: string
      examples:
        - internal_error
        - validation_failed
        - bad_request
        - unauthorized
        - forbidden
        - not_found
        - conflict
        - rate_limited
      description: >-
        Stable error code. The list is open: besides the generic codes, each
        area defines its own (`coupon_expired`, `insufficient_balance`,
        `version_not_draft`, `idempotency_key_reused`…). Handle a code you do
        not recognize by its HTTP status and show `message`; do not fail parsing
        the response.
  responses:
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Missing or invalid API key.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your account's secret key: `Authorization: Bearer sk_test_…` or
        `sk_live_…`. Server-side only.

````