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

# Get Ar Aging

> AR Aging report.

Buckets outstanding receivables (remaining_balance > 0) into:
  Current    - due_date is in the future or no due_date
  1-30 days  - 1-30 days past due
  31-60 days - 31-60 days past due
  61-90 days - 61-90 days past due
  91+ days   - more than 90 days past due

Each row is one client. Grand totals are included in `totals`.
Excludes invoices with status in ('paid', 'cancelled', 'voided').



## OpenAPI

````yaml /api/openapi-cutmake.json get /api/v1/invoices/aging
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/invoices/aging:
    get:
      tags:
        - Invoices
      summary: Get Ar Aging
      description: |-
        AR Aging report.

        Buckets outstanding receivables (remaining_balance > 0) into:
          Current    - due_date is in the future or no due_date
          1-30 days  - 1-30 days past due
          31-60 days - 31-60 days past due
          61-90 days - 61-90 days past due
          91+ days   - more than 90 days past due

        Each row is one client. Grand totals are included in `totals`.
        Excludes invoices with status in ('paid', 'cancelled', 'voided').
      operationId: get_ar_aging_api_v1_invoices_aging_get
      parameters:
        - name: as_of
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'ISO date to age against (default: today)'
            title: As Of
          description: 'ISO date to age against (default: today)'
        - name: client_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter to a single client
            title: Client Id
          description: Filter to a single client
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgingSummary'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    AgingSummary:
      properties:
        asOfDate:
          type: string
          title: Asofdate
        rows:
          items:
            $ref: '#/components/schemas/AgingClientRow'
          type: array
          title: Rows
        totals:
          $ref: '#/components/schemas/AgingBuckets'
        collected:
          type: number
          title: Collected
          default: 0
      type: object
      required:
        - asOfDate
        - rows
        - totals
      title: AgingSummary
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgingClientRow:
      properties:
        clientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Clientid
        clientName:
          type: string
          title: Clientname
        invoiceCount:
          type: integer
          title: Invoicecount
        buckets:
          $ref: '#/components/schemas/AgingBuckets'
      type: object
      required:
        - clientId
        - clientName
        - invoiceCount
        - buckets
      title: AgingClientRow
    AgingBuckets:
      properties:
        current:
          type: number
          title: Current
        days_1_30:
          type: number
          title: Days 1 30
        days_31_60:
          type: number
          title: Days 31 60
        days_61_90:
          type: number
          title: Days 61 90
        days_91_plus:
          type: number
          title: Days 91 Plus
        total:
          type: number
          title: Total
      type: object
      required:
        - current
        - days_1_30
        - days_31_60
        - days_61_90
        - days_91_plus
        - total
      title: AgingBuckets
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````