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.
Request
- Base URL: https://api.agentpaid.io/api/v2
- URL: https://api.agentpaid.io/api/v2/credits/transactions/summary
- Auth: HTTP bearer
Query parameters
Filter by customer ID.
Filter by customer external ID.
Filter by credit currency ID.
Filter by the stable machine-readable key of the credit currency.
Ledger type to summarize. Each call summarizes exactly one type, so a spend chart never nets grants against spends. Defaults to spend.
Filter by the order this transaction is linked to.
Filter by the usage event that produced the transaction (exact match, untrimmed). Transactions with no event (grants, invoice-void clawbacks, manual adjustments) never match.
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.
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.
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.
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.
Response
200
Changes
No recorded changes to this operation across all 1 revision of this API.