Skip to navigation

Summarize credit transactions

Aggregate credit ledger transactions of one type into period buckets grouped by a dimension, for charting credit consumption over time. Accepts the same filters as the transaction list and reads the same ledger, so bucket totals always match summing that list over the same filters and the same type — pass this endpoint’s effective type (it defaults to spend) to the list, which has no default and otherwise returns every type.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Query parameters

customerIdstringOptional>=1 character
Filter by customer ID.
externalCustomerIdstringOptional>=1 character
Filter by customer external ID.
creditsCurrencyIdstringOptional>=1 character
Filter by credit currency ID.
creditCurrencyKeystringOptional>=1 character

Filter by the stable machine-readable key of the credit currency.

typeenumOptionalDefaults to spend

Ledger type to summarize. Each call summarizes exactly one type, so a spend chart never nets grants against spends. Defaults to spend.

Allowed values:
orderIdstringOptional>=1 character
Filter by the order this transaction is linked to.
eventNamestringOptional>=1 character

Filter by the usage event that produced the transaction (exact match, untrimmed). Transactions with no event (grants, invoice-void clawbacks, manual adjustments) never match.

createdAtFromstringRequired

Start of the window (inclusive). Required: the window may span at most 92 days. Accepts an ISO 8601 date or date-time. Date-only values (e.g. 2026-06-30) are treated as UTC; date-times without an explicit timezone offset are ambiguous, so include one (e.g. 2026-06-30T00:00:00-05:00) when precision matters.

createdAtTostringOptional

End of the window (inclusive). Defaults to now. Accepts an ISO 8601 date or date-time. Date-only values (e.g. 2026-06-30) are treated as UTC; date-times without an explicit timezone offset are ambiguous, so include one (e.g. 2026-06-30T00:00:00-05:00) when precision matters.

groupByenumRequired

Dimension to group buckets by. eventName groups signal-driven spends by the usage event that produced them; transactions without one (grants, invoice-void clawbacks, manual adjustments) share a bucket whose groupKey is null.

Allowed values:
intervalenumRequired

Period bucket size. Buckets align to UTC calendar days, ISO weeks (Monday start), or calendar months; the first and last bucket's published bounds are clipped to the requested window.

Allowed values:

Response

200
typeenum
Ledger type these buckets summarize.
Allowed values:
groupByenum
Dimension the buckets are grouped by.
Allowed values:
intervalenum
Period bucket size.
Allowed values:
datalist of objects

Buckets ordered by period, then credit currency key, then group key (null last). Periods with no transactions are omitted.

Errors

400
Bad Request Error
403
Forbidden Error
500
Internal Server Error