Aller au contenu

GET /v1/invoices/revenue/by-client

GET
/v1/invoices/revenue/by-client
curl --request GET \
--url 'https://api.asap.cool/v1/invoices/revenue/by-client?from=example&to=example' \
--header 'Authorization: Bearer <token>'
from
required
string

Inclusive lower bound (YYYY-MM-DD, required).

to
required
string

Inclusive upper bound (YYYY-MM-DD, required).

basis
string

Revenue basis (cash_collected (default) / invoiced_revenue / signed_revenue / pipeline_revenue).

Clients ranked by revenue over the window.

Media type application/json

Response body of GET /v1/invoices/revenue/by-client.

object
clients
required

Clients ranked by descending revenue over the window (at most 20).

Array<object>

One client’s revenue over the window, for the concentration card.

object
contact_id
required

Contact the revenue is attributed to.

string format: uuid
contact_name

Displayable contact name, None when it cannot be resolved.

string | null
total_cents
required

Revenue summed for this contact over the window (centimes).

integer format: int64
Example generated
{
"clients": [
{
"contact_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"contact_name": "example",
"total_cents": 1
}
]
}

No active org.

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Missing invoice:read scope.

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}

Invalid window/basis.

Media type application/json

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
code
required

Stable machine token (e.g. invalid_credentials).

string
field

Offending request field for validation errors, when known.

string | null
message
required

Human-readable message.

string
Example generated
{
"code": "example",
"field": "example",
"message": "example"
}