GET /v1/invoices/revenue
const url = 'https://api.asap.cool/v1/invoices/revenue?from=example&to=example';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/revenue?from=example&to=example' \ --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, required).
Inclusive upper bound (YYYY-MM-DD, required).
Revenue basis (cash_collected (default) / invoiced_revenue /
signed_revenue / pipeline_revenue).
Narrow the report to a single contact, when set.
Bucket grouping. month returns YYYY-MM buckets; omitted returns none.
Responses
Section intitulée « Responses »Pre-computed revenue for the window.
Response body of GET /v1/invoices/revenue.
object
Monthly buckets, empty unless group_by=month.
One YYYY-MM bucket of a grouped revenue report.
object
Calendar month, YYYY-MM.
Bucket total (centimes).
Documents dated in the window but not counted, with a reason.
One document dated in the window but not counted, with the reason why.
object
Document number, None for an un-numbered draft.
Reason code: quote_not_paid/not_paid/draft/cancelled/
rejected/credit_note.
Documents counted toward the total.
One document counted toward the total.
object
Amount summed for this row (centimes).
Displayable contact name, None when the contact has vanished.
The dated dimension of the basis (YYYY-MM-DD).
Document number, None for an un-numbered draft.
Lifecycle status.
Document kind (devis/facture/avoir/acompte).
The window.
object
Inclusive lower bound (YYYY-MM-DD).
Inclusive upper bound (YYYY-MM-DD).
Basis the figures total on.
Total over the window (centimes); equals the sum of included_documents.
Example generated
{ "buckets": [ { "period": "example", "total_cents": 1 } ], "excluded_documents": [ { "number": "example", "reason": "example" } ], "included_documents": [ { "amount_cents": 1, "contact_name": "example", "date": "example", "number": "example", "status": "example", "type": "example" } ], "period": { "from": "example", "to": "example" }, "revenue_basis": "example", "total_cents": 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/basis/group_by.
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"}