---
title: "How long payments actually take over a period: average and median days from the document date and from the due date, plus the share paid late"
method: GET
path: "/v1/statistics/paymentdelay"
tags: ["Statistics"]
---

# How long payments actually take over a period: average and median days from the document date and from the due date, plus the share paid late

`GET /v1/statistics/paymentdelay`

## Request

- Base URL: `https://api.altoviz.com`
- URL: `https://api.altoviz.com/v1/statistics/paymentdelay`
- Auth: none required
- TypeScript: <https://skmtc.dev/altoviz/apis/altoviz-api/docs/v1/statistics/paymentdelay/get.ts> (a function with typed inputs; its response is checked against the schema)

Answers "do my customers pay me on time, and how late are they?". Read the medians rather than
the averages — the mean is dragged by a small tail of very late payers, so it can report a
month's delay where the typical invoice is paid on time.

## Query parameters

- `from` string, date
- `to` string, date
- `year` integer
- `periodicity` 'Daily' | 'Weekly' | 'Monthly' | 'Quarterly' | 'Annually'
- `side` 'Customers' | 'Suppliers': Which side of the ledger a payment delay is measured on

## Response `200`

OK

- PaymentDelayResult: How long payments actually take over a period.
  - `daysLate` TurnoverEvolutionResult: Turnover bucketed over a period. Every series holds the same number of buckets and bucket N of each series covers the same period shifted by its `offset` in years, so series can be compared index by index.
    - `periodicity` 'Daily' | 'Weekly' | 'Monthly' | 'Quarterly' | 'Annually'
    - `range` DateRangeModel: An inclusive date range
      - `from` string, date: First day of the period
      - `to` string, date: Last day of the period, included
    - `series` PeriodSeriesModel[], nullable: The requested period first, then any comparison periods
      - `buckets` PeriodBucketModel[], nullable: Values, one per bucket
        - `partial` boolean: True when the calendar period was clipped by the requested range, so the bucket holds less than a full month/quarter/week of activity and must not be compared at face value.
        - `range` DateRangeModel: An inclusive date range
          - `from` string, date: First day of the period
          - `to` string, date: Last day of the period, included
        - `value` number, double: Amount (tax excluded)
      - `label` string, nullable: Display label: the year for a whole calendar year, otherwise the bounds
      - `offset` integer: 0 for the requested period, 1 for one calendar year earlier, and so on
      - `range` DateRangeModel: An inclusive date range
        - `from` string, date: First day of the period
        - `to` string, date: Last day of the period, included
  - `daysToPayment` TurnoverEvolutionResult: Turnover bucketed over a period. Every series holds the same number of buckets and bucket N of each series covers the same period shifted by its `offset` in years, so series can be compared index by index.
    - `periodicity` 'Daily' | 'Weekly' | 'Monthly' | 'Quarterly' | 'Annually'
    - `range` DateRangeModel: An inclusive date range
      - `from` string, date: First day of the period
      - `to` string, date: Last day of the period, included
    - `series` PeriodSeriesModel[], nullable: The requested period first, then any comparison periods
      - `buckets` PeriodBucketModel[], nullable: Values, one per bucket
        - `partial` boolean: True when the calendar period was clipped by the requested range, so the bucket holds less than a full month/quarter/week of activity and must not be compared at face value.
        - `range` DateRangeModel: An inclusive date range
          - `from` string, date: First day of the period
          - `to` string, date: Last day of the period, included
        - `value` number, double: Amount (tax excluded)
      - `label` string, nullable: Display label: the year for a whole calendar year, otherwise the bounds
      - `offset` integer: 0 for the requested period, 1 for one calendar year earlier, and so on
      - `range` DateRangeModel: An inclusive date range
        - `from` string, date: First day of the period
        - `to` string, date: Last day of the period, included
  - `lateShare` number, double: Share of the settled amount paid after its due date, 0..1
  - `medianDaysLate` number, double, nullable: Median days from due date to payment. Null when nothing settled
  - `medianDaysToPayment` number, double, nullable: Median days from document date to payment. Null when nothing settled
  - `settled` TurnoverEvolutionResult: Turnover bucketed over a period. Every series holds the same number of buckets and bucket N of each series covers the same period shifted by its `offset` in years, so series can be compared index by index.
    - `periodicity` 'Daily' | 'Weekly' | 'Monthly' | 'Quarterly' | 'Annually'
    - `range` DateRangeModel: An inclusive date range
      - `from` string, date: First day of the period
      - `to` string, date: Last day of the period, included
    - `series` PeriodSeriesModel[], nullable: The requested period first, then any comparison periods
      - `buckets` PeriodBucketModel[], nullable: Values, one per bucket
        - `partial` boolean: True when the calendar period was clipped by the requested range, so the bucket holds less than a full month/quarter/week of activity and must not be compared at face value.
        - `range` DateRangeModel: An inclusive date range
          - `from` string, date: First day of the period
          - `to` string, date: Last day of the period, included
        - `value` number, double: Amount (tax excluded)
      - `label` string, nullable: Display label: the year for a whole calendar year, otherwise the bounds
      - `offset` integer: 0 for the requested period, 1 for one calendar year earlier, and so on
      - `range` DateRangeModel: An inclusive date range
        - `from` string, date: First day of the period
        - `to` string, date: Last day of the period, included
  - `settledAmount` number, double: Total settled over the period

## Changes

- **2026-09-14** `4f7fa64cf9e3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/altoviz/apis/altoviz-api/changes/v1/statistics/paymentdelay/get.md)

---

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