---
title: "Get Partner Payment Behavior"
method: GET
path: "/v2/partners/{partner_id}/payment-behavior"
tags: ["partners"]
---

# Get Partner Payment Behavior

`GET /v2/partners/{partner_id}/payment-behavior`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/partners/{partner_id}/payment-behavior`
- Auth: HTTP bearer

How promptly this partner has paid: invoice count, average/median/stddev
days to pay from due date, average days to pay from issued date, and a
days-beyond-due-date bucket distribution. Covers paid invoices that have a
due date. `all_time` is always included; `windows` adds trailing-window
breakdowns. Scoped to this partner, not its hierarchy.

## Path parameters

- `partner_id` string, required

## Query parameters

- `windows` integer[], nullable: Trailing window sizes in days to compute payment-timing metrics over, e.g. `?windows=30&windows=60&windows=90` to chart a trend. Duplicates are dropped. `all_time` is always included regardless of this param.

## Response `200`

Successful Response

- PaymentBehavior: One customer's payment-timing behavior, all-time and over the requested windows. Scoped to exactly this partner_id, not its hierarchy.
  - `all_time` PaymentBehaviorWindow, required: Payment-timing metrics for one customer over one window. Averages are null when the window has no paid invoices.
    - `days` integer, nullable, required: Size of this window in days, or null for all-time.
    - `invoice_count` integer, required: Paid invoices in this window.
    - `avg_days_to_pay_from_due` number, nullable, required: Average days to payment from due date.
    - `median_days_to_pay_from_due` number, nullable, required: Median days to payment from due date.
    - `stddev_days_to_pay_from_due` number, nullable, required: Standard deviation of days to payment from due date.
    - `avg_days_to_pay_from_issued` number, nullable, required: Average days to payment from issued date.
    - `bucket_distribution` PaymentBehaviorBucket[], required: Paid invoices grouped into days-beyond-due-date buckets.
      - `min_days` integer, nullable, required: Inclusive lower bound in days beyond due date, or null for unbounded.
      - `max_days` integer, nullable, required: Inclusive upper bound in days beyond due date, or null for unbounded.
      - `invoice_count` integer, required: Paid invoices in this bucket.
      - `percentage` number, required: Share of the window's paid invoices in this bucket, 0-100.
  - `windows` PaymentBehaviorWindow[], required: Payment timing over each requested window, in the order requested.
    - `days` integer, nullable, required: Size of this window in days, or null for all-time.
    - `invoice_count` integer, required: Paid invoices in this window.
    - `avg_days_to_pay_from_due` number, nullable, required: Average days to payment from due date.
    - `median_days_to_pay_from_due` number, nullable, required: Median days to payment from due date.
    - `stddev_days_to_pay_from_due` number, nullable, required: Standard deviation of days to payment from due date.
    - `avg_days_to_pay_from_issued` number, nullable, required: Average days to payment from issued date.
    - `bucket_distribution` PaymentBehaviorBucket[], required: Paid invoices grouped into days-beyond-due-date buckets.
      - `min_days` integer, nullable, required: Inclusive lower bound in days beyond due date, or null for unbounded.
      - `max_days` integer, nullable, required: Inclusive upper bound in days beyond due date, or null for unbounded.
      - `invoice_count` integer, required: Paid invoices in this bucket.
      - `percentage` number, required: Share of the window's paid invoices in this bucket, 0-100.

## Other responses

- `404`: Not Found
- `422`: Unprocessable Content

---

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