Skip to content

List statements

Every closed month of the organization, newest first, with what is owed and how to pay it.

Updated

get

https://cloud.cahaves.com/api/billing/statements

Authorization

cahaves.cloud.sessionstringcookierequired

The session cookie Cloud sets when a customer signs in to the console with GitHub or Google. It is HttpOnly, so scripts cannot read it, and there are no API keys or tokens yet.

Query parameters

pageinteger

The page to answer, from 1. Anything but a whole number reads as absent, and a page past the last answers an empty list.

Default: 1

perinteger

Rows per page, 1 to 100. A number outside that range is clamped to it, and anything but a whole number reads as absent.

Default: 25

Headers

X-Cloud-Organizationstring<uuid>

The id of the organization the request works in, one the signed-in customer owns. Left out or empty, the request works in their oldest organization. Any other value answers 404 with `reason: "organization"`. A customer with no organization yet gets 409 "Create an organization first." from every route that works in one.

Example: "2f6c8e0a-4b1d-4e7f-9a3c-5d7e9f1b3a5c"

Responses

application/json

A page of statements.

perintegerrequired

pageintegerrequired

totalintegerrequired

statementsobject[]required

One row for each month Cloud has closed for the organization the request works in, newest first. Each organization has its own statements, so another's are listed only when a request names it. Reading the list settles each invoiced row against the invoicing service first, so a payment made or an invoice voided there already shows here as paid or void. overdue is worked out when you ask: an invoiced statement whose due_date is before today in Asia/Jakarta, where the invoices are issued. An overdue invoice's link is renewed within the hour once the old one runs out, so its pay is back by then. void is final: Cahaves voided the invoice, nothing is owed, and the statement is never overdue. pay is null when nothing is owed. Otherwise kind: "invoice" carries the invoice's payment link as url, and kind: "paddle" carries the transaction_id of a failed card charge, which the console opens on its own payment page, /settings/billing/statements/{id}/pay.