niiko/developers

Kiipu · invoicing v1 read-only

kiipu.collections_get

Reads what is owed: the outstanding total, what is overdue by age bucket, the 15 clients who owe the most with their overdue amount and since when, and the next installments due. Changes nothing and contacts no one.

Last updated

POST /api/v1/reads/kiipu.collections_get
Token scope
kiipu.collections_get@1
Workspace permission
api.kiipu.collections_get off by default
Who reads
The person behind the token, with their role. Someone who leaves the workspace stops reading.
Three permissions

A token with that scope, the workspace owner having switched the read on, and the person's role seeing it in the product. None of them is enough alone. OAuth only →

Request

No fields.

Response — output when status is done

fieldtyperules
currencystringrequired
outstandingTotalstringrequired^-?\d+\.\d{2}$
openInvoicesintegerrequired≥ 0
overdueTotalstringrequired^-?\d+\.\d{2}$
agingBucketsobject[]required
debtorsobject[]required
upcomingobject[]required
incompletebooleanrequired

agingBuckets[]

fieldtyperules
bucket"d1_30" | "d31_60" | "d61_90" | "d90_plus"required
amountstringrequired^-?\d+\.\d{2}$
installmentsintegerrequired≥ 0
clientsintegerrequired≥ 0

debtors[]

fieldtyperules
clientstring | nullrequired
overduestringrequired^-?\d+\.\d{2}$
oldestDueOnstringrequired^\d{4}-\d{2}-\d{2}$
daysOverdueintegerrequired≥ 0
bucket"d1_30" | "d31_60" | "d61_90" | "d90_plus"required
invoicesintegerrequired≥ 0

upcoming[]

fieldtyperules
clientstring | nullrequired
invoicestring | nullrequired
dueOnstringrequired^\d{4}-\d{2}-\d{2}$
amountstringrequired^-?\d+\.\d{2}$

Example

# Reads take an OAuth access token, not an API key, and no idempotency key: reading changes nothing.
curl -X POST https://niiko.org/api/v1/reads/kiipu.collections_get \
  -H "Authorization: Bearer $NIIKO_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
# 200 → done · 4xx → refused, with a named reason

Why it may refuse

Each reason names who can fix it and how; detail.message, when present, says what to do. Refusals & HTTP codes →

invalid_inputrole_forbiddengrant_offreads_need_a_person

In the clients

@vorluno/niiko-sdkniiko.getCollections()
niiko (Python)niiko.get_collections() from 0.3.0 · not on the registry yet
niiko-cliniiko read kiipu.collections_get
n8n-nodes-niikoNo reads: the node holds a key, and reading needs a person through OAuth.
niiko-mcp-serverkiipu_collections_get readOnlyHint

History