GET /v1/invoices/revenue/by-client
const url = 'https://api.asap.cool/v1/invoices/revenue/by-client?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/by-client?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).
Responses
Section intitulée « Responses »Clients ranked by revenue over the window.
Response body of GET /v1/invoices/revenue/by-client.
object
Clients ranked by descending revenue over the window (at most 20).
One client’s revenue over the window, for the concentration card.
object
Contact the revenue is attributed to.
Displayable contact name, None when it cannot be resolved.
Revenue summed for this contact over the window (centimes).
Example generated
{ "clients": [ { "contact_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "contact_name": "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.
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"}