credits

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.

get/credits/transactions/summary

Request

  • Base URL: https://api.agentpaid.io/api/v2
  • URL: https://api.agentpaid.io/api/v2/credits/transactions/summary
  • Auth: HTTP bearer

Query parameters

customerIdstring

Filter by customer ID.

externalCustomerIdstring

Filter by customer external ID.

creditsCurrencyIdstring

Filter by credit currency ID.

creditCurrencyKeystring

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

type'grant' | 'spend' | 'pendingGrant'

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

orderIdstring

Filter by the order this transaction is linked to.

eventNamestring

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

createdAtFromstring required

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.

createdAtTostring

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.

groupBy'eventName' required

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.

interval'day' | 'week' | 'month' required

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

type'grant' | 'spend' | 'pendingGrant' required

Ledger type these buckets summarize.

groupBy'eventName' required

Dimension the buckets are grouped by.

interval'day' | 'week' | 'month' required

Period bucket size.

Changes

No recorded changes to this operation across all 1 revision of this API.