Aggregate Revenue Records
POST https://api.suger.cloud/org/{orgId}/revenueRecord/aggregate
Return per-currency totals (invoice/collectable/disburse/tax + count) and the daily chart series over the filtered set, in a single request. Lets a console view render its chart and summary without loading individual rows. Invoice, collectable, and disburse amounts are net of effective refunds, and canceled or voided records contribute zero; tax remains a gross sum.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
orgId | path | string | yes | Organization ID |
Request Body
Required. Content-Type: application/json · Schema: RevenueRecordAggregateRequest
RevenueRecordAggregateRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
buyerId | string | no | |
currency | string | no | ISO-4217 (e.g. USD) |
endDate | string | no | UTC YYYY-MM-DD |
entitlementId | string | no | |
partner | string | no | |
productId | string | no | |
startDate | string | no | UTC YYYY-MM-DD |
Responses
200 — OK
Content-Type: application/json · Schema: RevenueRecordAggregateResponse
RevenueRecordAggregateResponse fields:
| Field | Type | Required | Description |
|---|---|---|---|
series | array<RevenueRecordSeriesPoint> | no | |
totals | array<RevenueRecordCurrencyTotal> | no |
RevenueRecordSeriesPoint fields:
| Field | Type | Required | Description |
|---|---|---|---|
collectableAmount | number | no | |
currency | string | no | |
disburseAmount | number | no | |
invoiceAmount | number | no | |
invoiceDate | string | no |
RevenueRecordCurrencyTotal fields:
| Field | Type | Required | Description |
|---|---|---|---|
collectableAmount | number | no | |
count | integer | no | |
currency | string | no | |
disburseAmount | number | no | |
invoiceAmount | number | no | |
taxAmount | number | no |
400 — Bad request error
Content-Type: application/json
500 — Internal server error
Content-Type: application/json
Example
Generated from this operation's schema. Values are placeholders —
substitute your own ids, and set SUGER_TOKEN to a bearer token
from the OAuth client-credentials exchange.
Request
curl -X POST 'https://api.suger.cloud/org/{orgId}/revenueRecord/aggregate' \
-H "Authorization: Bearer $SUGER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"buyerId": "01H0000000000000000000",
"currency": "USD",
"endDate": "2026-01-31T12:00:00Z",
"entitlementId": "01H0000000000000000000",
"partner": "string",
"productId": "01H0000000000000000000",
"startDate": "2026-01-31T12:00:00Z"
}' Response — 200
{
"series": [
{
"collectableAmount": 100,
"currency": "USD",
"disburseAmount": 100,
"invoiceAmount": 100,
"invoiceDate": "2026-01-31T12:00:00Z"
}
],
"totals": [
{
"collectableAmount": 100,
"count": 1,
"currency": "USD",
"disburseAmount": 100,
"invoiceAmount": 100,
"taxAmount": 100
}
]
} Error — 400
"string" View as Markdown · Interactive API reference
Spotted something wrong or out of date on this page? Tell us and we'll correct it.