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

# Aged Balance Report

> Per-account snapshot of accounts carrying a balance. Live Account columns; no point-in-time history.



## OpenAPI

````yaml /api-reference/external_api.openapi.json get /reports/abr
openapi: 3.1.0
info:
  title: Monterey External Reporting API
  description: >-
    Org-scoped, API-key-authenticated reporting endpoints for Monterey Financial
    clients.
  version: 0.1.0
servers:
  - url: https://api.montereyfinancial.app
    description: Production
security:
  - BearerApiKey: []
paths:
  /reports/abr:
    get:
      tags:
        - Reports
      summary: Aged Balance Report
      description: >-
        Per-account snapshot of accounts carrying a balance. Live Account
        columns; no point-in-time history.
      operationId: aged_balance_report_reports_abr_get
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Organization Id
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque pagination cursor from a previous response's
              `page.next_cursor`. Omit on the first page.
            title: Cursor
          description: >-
            Opaque pagination cursor from a previous response's
            `page.next_cursor`. Omit on the first page.
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 1000
                minimum: 1
              - type: 'null'
            description: >-
              Page size for cursor pagination. Default 100, minimum 1, maximum
              1000. Requests above the maximum return 422 — narrow your page
              size and use the returned `next_cursor` to walk additional pages.
            title: Limit
          description: >-
            Page size for cursor pagination. Default 100, minimum 1, maximum
            1000. Requests above the maximum return 422 — narrow your page size
            and use the returned `next_cursor` to walk additional pages.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_PortfolioRow_'
        '401':
          description: Missing, malformed, expired, or unknown API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: '`organization_id` filter targets an org outside the key''s allowlist.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerApiKey: []
components:
  schemas:
    Page_PortfolioRow_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PortfolioRow'
          type: array
          title: Items
        page:
          $ref: '#/components/schemas/PageMeta'
      type: object
      required:
        - items
        - page
      title: Page[PortfolioRow]
      description: 'A page of results: `items` plus a `page` pagination envelope.'
    ErrorResponse:
      properties:
        detail:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Standard error envelope. Branch on `detail.error_code`.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      description: >-
        Parameter-validation error (HTTP 422). `detail` lists each violated
        constraint with its location, message, and type.
    PortfolioRow:
      properties:
        account_id:
          type: string
          title: Account Id
        organization_id:
          type: string
          title: Organization Id
        contract_id:
          type: string
          title: Contract Id
        external_account_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: External Account Number
          description: Account number assigned by the source loan management system.
        status_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Code
          description: >-
            Short code for the account's current status (e.g. OPEN, CHARGED_OFF,
            PAID_IN_FULL).
        current_balance_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Current Balance Cents
          description: Current outstanding balance in integer cents.
        past_due_amount_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Past Due Amount Cents
          description: Amount past due in integer cents.
        payoff_amount_cents:
          anyOf:
            - type: integer
            - type: 'null'
          title: Payoff Amount Cents
          description: Amount required to pay off the account in full, in integer cents.
        last_payment_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Payment At
          description: Date of the most recent payment received (ISO 8601 date string).
      type: object
      required:
        - account_id
        - organization_id
        - contract_id
      title: PortfolioRow
      description: |-
        Live account snapshot — used by the ABR and DR reports.
        Reflects current account state; not a point-in-time record.
    PageMeta:
      properties:
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: Opaque token to pass as ?cursor= to fetch the next page.
        has_more:
          type: boolean
          title: Has More
          description: True if more rows exist past this page.
        limit:
          type: integer
          title: Limit
          description: Echo of the resolved page size.
      type: object
      required:
        - has_more
        - limit
      title: PageMeta
      description: >-
        Pagination envelope on list responses. `next_cursor` is non-null when
        more rows exist — pass it back as `cursor` to continue.
    ErrorBody:
      properties:
        error_code:
          type: string
          title: Error Code
      type: object
      required:
        - error_code
      title: ErrorBody
      description: Standard error body. Branch on `error_code`.
    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
      description: >-
        A single parameter-validation failure: `loc` is the path to the
        offending input, `msg` is human-readable, and `type` is the rule that
        failed.
  securitySchemes:
    BearerApiKey:
      type: http
      description: Static API key issued via the client portal. Treat it like a password.
      scheme: bearer
      bearerFormat: ApiKey

````