GET /v1/invoices/stats
const url = 'https://api.asap.cool/v1/invoices/stats';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.asap.cool/v1/invoices/stats \ --header 'Authorization: Bearer <token>'Authorizations
Section intitulée « Authorizations »Parameters
Section intitulée « Parameters »Query Parameters
Section intitulée « Query Parameters »Inclusive lower bound (YYYY-MM-DD). Requires to.
Inclusive upper bound (YYYY-MM-DD). Requires from.
Responses
Section intitulée « Responses »Org-scoped aggregate counts and amounts.
Response body of GET /v1/invoices/stats.
object
Aggregated amounts (point-in-time; window-invariant).
object
Age breakdown of overdue_cents, for the dashboard aging bar.
object
Overdue 1 to 30 days.
Overdue 31 to 60 days.
Overdue 61 to 90 days.
Overdue more than 90 days.
Cash collected: sum of all recorded payment amounts.
Value of open quotes (sent/accepted, not yet converted).
Outstanding receivable on issued, unsettled invoices (remaining
balance: total_ttc minus recorded payments).
Overdue portion of the outstanding balance (due_date < today).
Per-type document counters (all-time; window-invariant).
object
Deposit-invoice counters.
object
Total documents, any status.
Credit-note counters.
object
Total documents, any status.
Quote counters.
object
Accepted quotes.
Editable drafts.
Quotes past their validity date with no decision recorded.
Rejected quotes.
Quotes awaiting a client decision (finalized/sent).
Total quotes, any status.
Invoice counters.
object
Editable drafts.
Issued, unsettled invoices past their due date.
Fully settled invoices.
Issued invoices awaiting settlement (finalized/sent).
Total invoices, any status.
Daily revenue/issuance series. Empty unless both from and to are
supplied; otherwise gap-filled and contiguous across the window.
One day of the rolling daily series (present only when the window params are supplied).
object
Cash collected that day (centimes).
Calendar day (UTC), YYYY-MM-DD.
Total total_ttc of issued invoices dated that day (centimes) — the
“émis” flow, alongside collected_cents.
Issued invoices (facture, non-draft) dated that day.
Current-vs-previous window trend. null for the all-time call.
object
Cash collected within the current window (centimes).
Cash collected within the previous window of equal length (centimes).
Issued invoices within the current window.
Issued invoices within the previous window of equal length.
Example generated
{ "amounts": { "aging": { "d0_30_cents": 1, "d30_60_cents": 1, "d60_90_cents": 1, "d90_plus_cents": 1 }, "collected_cents": 1, "open_quotes_cents": 1, "outstanding_cents": 1, "overdue_cents": 1 }, "counts": { "acompte": { "total": 1 }, "avoir": { "total": 1 }, "devis": { "accepted": 1, "draft": 1, "expired": 1, "rejected": 1, "sent": 1, "total": 1 }, "facture": { "draft": 1, "overdue": 1, "paid": 1, "sent": 1, "total": 1 } }, "series": [ { "collected_cents": 1, "date": "example", "issued_cents": 1, "issued_count": 1 } ], "trend": { "collected_cents": 1, "collected_prev_cents": 1, "issued_count": 1, "issued_prev_count": 1 }}No active org.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}Missing invoice:read scope.
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}Invalid window (bad date, from > to, span > 366d).
Generic error body returned by API handlers when they fail. code is a
stable machine-readable token; message is human-friendly and meant for
surfacing to end users.
object
Stable machine token (e.g. invalid_credentials).
Offending request field for validation errors, when known.
Human-readable message.
Example generated
{ "code": "example", "field": "example", "message": "example"}