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

# Get an invoice

> Fetches a single invoice by ID, including all line items, totals, and status.



## OpenAPI

````yaml /api-reference/specs/2026-04-01.json get /invoices/{id}
openapi: 3.1.0
info:
  description: >-
    Alguna is the AI-native quote-to-revenue platform for B2B companies: CPQ,
    subscription and usage-based billing, invoicing, payment collection, and
    revenue recognition in one system of record. The API operates on one
    versioned agreement per customer: quotes, subscriptions and their versions,
    usage, invoices, payments, and revenue schedules read from it. Official
    SDKs: TypeScript (@alguna/sdk), Python (alguna), Go
    (github.com/alguna-io/alguna-go), Rust (alguna), and the alguna CLI
    (@alguna/cli).
  title: Alguna Public API
  version: '2026-04-01'
servers:
  - url: https://api.alguna.io
    x-fern-server-name: Production
security:
  - bearerAuth: []
tags:
  - name: Billing Events and Metrics
  - name: Checkout Sessions
  - name: Credit Notes
  - name: Credits
  - name: Customer Portal Sessions
  - name: Customers
  - name: Feedback
  - name: Insights
  - name: Integrations
  - name: Invoices
  - name: Merchants
  - name: Payments
  - name: Plans
  - name: Product Bundles
  - name: Products
  - name: Quotes
  - name: Refunds
  - name: Revenue Schedules
  - name: Subscription Changes
  - name: Subscription Versions
  - name: Subscriptions
  - name: Tags
  - name: Tax
  - name: Users
  - name: Wallet Grants
  - name: Wallets
paths:
  /invoices/{id}:
    get:
      tags:
        - Invoices
      summary: Get an invoice
      description: >-
        Fetches a single invoice by ID, including all line items, totals, and
        status.
      operationId: get-invoice
      parameters:
        - in: header
          name: Alguna-Version
          required: true
          schema:
            enum:
              - '2026-04-01'
            type: string
        - in: path
          name: id
          required: true
          schema:
            description: Unique identifier for the invoice
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/GatewayErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden — the organization does not have access to this feature
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
        '502':
          description: >-
            Bad Gateway — sent by the infrastructure in front of the API; the
            body is not JSON. Safe to retry.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Service Unavailable — a dependency is temporarily unavailable. Retry
            with backoff.
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Gateway Timeout — the request did not finish in time. Retry with
            backoff; use an idempotency key for writes.
components:
  schemas:
    InvoiceResponse:
      properties:
        amount_paid:
          description: Amount that has been paid
          example: '0.00'
          type: string
        amount_remaining:
          description: Remaining amount due
          example: '110.00'
          type: string
        autopay_timing:
          allOf:
            - $ref: '#/components/schemas/AutopayTiming'
          description: >-
            When auto-pay charges the invoice. Before issue, it is null when the
            invoice inherits the value of its subscription or customer. At
            issue, the resolved value is saved on the invoice. Invoices issued
            without a value are charged when they are issued.
          example: on_due_date
          nullable: true
        billing_period:
          description: Formatted billing period string
          type: string
        billing_period_end:
          description: End of the billing period
          format: date-time
          nullable: true
          type: string
        billing_period_start:
          description: Start of the billing period
          format: date-time
          nullable: true
          type: string
        created_at:
          description: Timestamp when the invoice was created
          format: date-time
          type: string
        currency:
          description: ISO 4217 currency code
          example: USD
          type: string
        customer_id:
          description: Customer this invoice belongs to
          type: string
        description:
          description: Invoice description or memo
          type: string
        due_date:
          description: Date the invoice payment is due
          format: date-time
          nullable: true
          type: string
        external_id:
          description: Identifier in the external payment provider
          type: string
        external_provider:
          description: External payment provider name
          type: string
        external_reference:
          description: Customer-facing invoice reference number
          type: string
        external_url:
          description: URL to the invoice in the external system
          type: string
        id:
          description: Unique identifier for the invoice
          type: string
        invoicing_date:
          description: Date the invoice is scheduled for processing
          format: date-time
          nullable: true
          type: string
        issue_date:
          description: Date the invoice was issued
          format: date-time
          nullable: true
          type: string
        line_items:
          description: Line items on this invoice
          items:
            $ref: '#/components/schemas/LineItemResponse'
          type: array
        merchant_id:
          description: >-
            Sub-merchant the invoice was issued for; you remain the seller of
            record
          example: mrch_01H8XGJWBWBAQ4PLwXYZ
          nullable: true
          type: string
        paid_date:
          description: Date the invoice was paid
          format: date-time
          nullable: true
          type: string
        purchase_order_number:
          description: Purchase order number
          nullable: true
          type: string
        status:
          allOf:
            - $ref: '#/components/schemas/InvoiceStatus'
          description: Current status of the invoice
        subtotal:
          description: Sum of all line item totals before tax
          example: '100.00'
          type: string
        tax:
          description: Total tax amount
          example: '10.00'
          type: string
        tax_calculation_id:
          description: Id of the tax calculation this invoice was created from, if any
          nullable: true
          type: string
        total:
          description: Total amount including tax
          example: '110.00'
          type: string
        updated_at:
          description: Timestamp when the invoice was last updated
          format: date-time
          type: string
      required:
        - amount_paid
        - amount_remaining
        - billing_period
        - created_at
        - currency
        - customer_id
        - description
        - id
        - line_items
        - status
        - subtotal
        - tax
        - total
        - updated_at
      type: object
    ErrorResponse:
      description: The body of every error the API returns.
      properties:
        code:
          description: >-
            Machine-readable error code, such as `not_found` or
            `invoice_already_issued`. New codes may be added at any time, so
            handle a code you do not know by its HTTP status.
          type: string
        detail:
          description: Explanation of what went wrong
          type: string
        request_id:
          description: >-
            Identifies the request, as the `X-Request-Id` response header does.
            Quote it when contacting support.
          type: string
        status:
          description: HTTP status code of the response
          format: int64
          type: integer
        title:
          description: >-
            HTTP status text. Sent only by version, idempotency and
            credit-refusal errors.
          type: string
        type:
          description: Always `about:blank`. Sent only by version and idempotency errors.
          type: string
      required:
        - status
        - detail
      type: object
    GatewayErrorResponse:
      description: >-
        Returned by the API gateway when a request carries no valid API key,
        before the API handles it.
      properties:
        code:
          description: Machine-readable error code, e.g. `unauthenticated`
          type: string
        details:
          nullable: true
          type: object
        message:
          description: Explanation of what went wrong
          type: string
      required:
        - code
        - message
      type: object
    AutopayTiming:
      enum:
        - on_issue
        - on_due_date
      type: string
    LineItemResponse:
      properties:
        amount_excluding_tax:
          description: Amount for this line before tax (quantity x unit price)
          example: '73.98'
          type: string
        amount_including_tax:
          description: >-
            Amount for this line including its tax. This is the figure a full
            credit of the line returns.
          example: '80.55'
          type: string
        billing_period_end:
          description: End of the service period this line covers, exclusive
          format: date-time
          nullable: true
          type: string
        billing_period_start:
          description: Start of the service period this line covers, inclusive
          format: date-time
          nullable: true
          type: string
        description:
          description: Description of the line item
          type: string
        id:
          description: Unique identifier for the line item
          type: string
        is_editable:
          description: Whether this line item can be manually edited
          type: boolean
        product_id:
          description: Associated product identifier
          nullable: true
          type: string
        quantity:
          description: Quantity of the line item
          example: '1'
          type: string
        tax_amount:
          description: Tax charged on this line
          example: '6.57'
          nullable: true
          type: string
        tax_rate:
          description: Percentage rate the tax was charged at
          example: '8.875'
          nullable: true
          type: string
        total_price:
          deprecated: true
          description: >-
            Deprecated: use amount_excluding_tax, which carries the same value.
            Despite the name this excludes tax.
          example: '100.00'
          type: string
        unit_price:
          description: Unit price of the line item, excluding tax
          example: '100.00'
          type: string
      required:
        - amount_excluding_tax
        - amount_including_tax
        - description
        - id
        - is_editable
        - quantity
        - total_price
        - unit_price
      type: object
    InvoiceStatus:
      enum:
        - draft
        - upcoming
        - pending_approval
        - scheduled
        - processing
        - issued
        - void
        - paid
        - canceled
        - overdue
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http
      x-fern-bearer:
        env: ALGUNA_API_KEY
        name: apiKey

````

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