> ## 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 accounts receivable aging summary

> Returns the organization-wide receivables position as of now: total open balance, the past-due portion, invoice counts, and a breakdown by days past due. Unlike the other insights endpoints this is a point-in-time snapshot rather than a period aggregate, so it takes no date range. Amounts from every currency are converted into the organization's base currency.



## OpenAPI

````yaml /api-reference/specs/2026-04-01.json get /insights/ar-aging
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:
  /insights/ar-aging:
    get:
      tags:
        - Insights
      summary: Get accounts receivable aging summary
      description: >-
        Returns the organization-wide receivables position as of now: total open
        balance, the past-due portion, invoice counts, and a breakdown by days
        past due. Unlike the other insights endpoints this is a point-in-time
        snapshot rather than a period aggregate, so it takes no date range.
        Amounts from every currency are converted into the organization's base
        currency.
      operationId: get-ar-aging
      parameters:
        - in: header
          name: Alguna-Version
          required: true
          schema:
            enum:
              - '2026-04-01'
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ARAgingSummaryResponse'
          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:
    ARAgingSummaryResponse:
      properties:
        avg_balance_per_open_invoice:
          description: Mean unpaid balance per open invoice
          example: '2800.00'
          type: string
        avg_days_overdue:
          description: >-
            Invoice-weighted mean days past due, to one decimal place. Omitted
            when nothing is overdue.
          example: '22.4'
          nullable: true
          type: string
        avg_days_to_pay:
          description: >-
            Invoice-weighted mean days from issue to payment, to one decimal
            place. Omitted when there is no paid history.
          example: '29.1'
          nullable: true
          type: string
        buckets:
          allOf:
            - $ref: '#/components/schemas/ARAgingBuckets'
          description: >-
            Open balance split by days past due. The buckets sum to
            total_open_balance.
        currency:
          description: Organization base currency that all amounts are converted to
          example: USD
          type: string
        open_invoice_count:
          description: Number of issued or overdue invoices
          example: 150
          format: int64
          type: integer
        overdue_balance:
          description: >-
            Past-due portion of total_open_balance. Equals the sum of every
            bucket except current.
          example: '85000.00'
          type: string
        overdue_invoice_count:
          description: Number of invoices past their due date
          example: 31
          format: int64
          type: integer
        total_open_balance:
          description: Total unpaid balance across all open invoices
          example: '420000.00'
          type: string
      required:
        - avg_balance_per_open_invoice
        - buckets
        - currency
        - open_invoice_count
        - overdue_balance
        - overdue_invoice_count
        - total_open_balance
      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
    ARAgingBuckets:
      properties:
        current:
          description: Balance not yet due
          example: '14000.00'
          type: string
        days_1_to_30:
          description: Balance 1–30 days past due
          example: '9500.00'
          type: string
        days_31_to_60:
          description: Balance 31–60 days past due
          example: '6000.00'
          type: string
        days_61_to_90:
          description: Balance 61–90 days past due
          example: '2500.00'
          type: string
        days_90_plus:
          description: Balance more than 90 days past due
          example: '1000.00'
          type: string
      required:
        - current
        - days_1_to_30
        - days_31_to_60
        - days_61_to_90
        - days_90_plus
      type: object
  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.