# 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 amounts are net of refund_invoice_amount (a fully refunded record contributes 0); collectable, disburse, and tax amounts are gross sums of their respective columns.

## 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`

---

Interactive API reference: https://doc.suger.io/api/
