---
title: "Arrears cases, payment plans, deposits and the aging buckets"
method: GET
path: "/api/v1/arrears"
tags: ["Money"]
---

# Arrears cases, payment plans, deposits and the aging buckets

`GET /api/v1/arrears`

## Request

- Base URL: `http://localhost:5180`
- URL: `http://localhost:5180/api/v1/arrears`
- Auth: API key in cookie `better-auth.session_token`

One page of each of the three lists, in primary key order. `limit` and `offset` move the window on all three at once, and `totals` says how many of each exist. `aging` is measured over every case still being chased, never over the page. Balances are recomputed on read, so they never lag the payments that cleared them.

## Query parameters

- `limit` integer
- `offset` integer

## Response `200`

Aging, cases, plans and deposits.

- object
  - `ok` unknown, required
  - `data` object, required
    - `aging` object[], required: Every case still being chased, never just the page. Paging the cases does not move these figures.
      - `label` string, required: `1–30 days`, `31–60 days`, `61–90 days`, `90+ days`.
      - `min` number, required
      - `max` number, nullable, required: The last day in the bucket. `null` on the open-ended `90+ days` bucket, which the view holds as `Infinity` and JSON renders as null.
      - `total` integer, required: Money, always in integer cents. €1,250.00 is 125000.
      - `count` number, required
    - `cases` object[], required
      - `id` string, required: Stable record id, e.g. `lse_012`.
      - `leaseId` string, required: Stable record id, e.g. `lse_012`.
      - `contactId` string, required: Stable record id, e.g. `lse_012`.
      - `openedOn` string, required: A calendar date, `YYYY-MM-DD`.
      - `stage` string, required: How far dunning has gone. `none` and `resolved` are not counted as open.
      - `balance` integer, required: Total outstanding across all overdue invoices, recomputed on read.
      - `oldestDueDate` string, required: A calendar date, `YYYY-MM-DD`.
      - `daysOverdue` number, required
      - `invoiceIds` string[], required
      - `snoozedUntil` string: Pauses automation, e.g. after a payment promise.
      - `closedOn` string: A calendar date, `YYYY-MM-DD`.
    - `plans` object[], required: Payment plans agreed against a case. A plan in `active` status is a promise being kept, and dunning stays paused while it is.
      - `id` string, required: Stable record id, e.g. `lse_012`.
      - `arrearsCaseId` string, required: Stable record id, e.g. `lse_012`.
      - `agreedOn` string, required: A calendar date, `YYYY-MM-DD`.
      - `totalAmount` integer, required: Money, always in integer cents. €1,250.00 is 125000.
      - `instalments` object[], required
        - `id` string, required: Stable record id, e.g. `lse_012`.
        - `dueDate` string, required: A calendar date, `YYYY-MM-DD`.
        - `amount` integer, required: Money, always in integer cents. €1,250.00 is 125000.
        - `status` 'pending' | 'paid' | 'missed', required
        - `paidOn` string: A calendar date, `YYYY-MM-DD`.
      - `status` 'active' | 'completed' | 'defaulted' | 'cancelled', required
      - `notes` string
    - `deposits` object[], required: The deposits held, so a balance can be read beside the security standing behind it. Escrowed money is never treated as collected.
      - `id` string, required: Stable record id, e.g. `lse_012`.
      - `leaseId` string, required: Stable record id, e.g. `lse_012`.
      - `amount` integer, required: Money, always in integer cents. €1,250.00 is 125000.
      - `months` number: Expressed as months of rent, for the statutory cap check.
      - `form` string, required
      - `status` 'awaiting' | 'held' | 'partially_released' | 'released' | 'disputed', required
      - `receivedOn` string: A calendar date, `YYYY-MM-DD`.
      - `lodgedOn` string: When it reached the scheme, the public body or the blocked account the law names.
      - `releasedOn` string: A calendar date, `YYYY-MM-DD`.
    - `limit` number, required: The page size this response was actually read at, which is `limit` capped at 200.
    - `offset` number, required: The offset each of the three lists was read at.
    - `totals` object, required: How many rows exist of each, not how many came back. Every one of them is reachable through `offset`.
      - `cases` number, required
      - `plans` number, required
      - `deposits` number, required
  - `meta` object, required
    - `requestId` string, required: Echoed in the x-request-id header. Quote it in a bug report.

## Other responses

- `400`: `limit` or `offset` is out of range.

---

[API](https://skmtc.dev/dardaris/apis/dardaris-api.md) · [All operations](https://skmtc.dev/dardaris/apis/dardaris-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dardaris/apis/dardaris-api/revisions/4aff33835c73?raw)
