Skip to main content
POST
Typescript (SDK)
Counts the entries of each type that List Balance Ledger lists for one customer’s balance of a feature, over the same custom_range or recorded_range. Pass a type to types on List Balance Ledger to list only the entries of that type. counts.usage counts usage events, not entries: each track once, and a lock once, when it was reserved. The other counts are how many entries List Balance Ledger lists for that type when types leaves out usage: adjustments counts recorded edits only (updates that don’t add to the balance, deletes and recalculations), not an adjustment Autumn works out from a balance that moved with no record. The counts don’t depend on types, so fetch them once per range.
Balance history is rolling out and isn’t available for every customer yet; coverage says whether it is for this one. Tracks are kept for 90 days, so counts.usage counts only the tracks in that time.
complete is false when the count couldn’t cover the whole range; each count is then at least its value.

Body Parameters

Response

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string
default:2.6.0
required

Body

application/json
customer_id
string
required

The customer whose balance history to count.

Minimum string length: 1
feature_id
string
required

The feature whose balance to count, as in balances.list_ledger.

Minimum string length: 1
entity_id
string

Count this entity's balance of the feature, as in balances.list_ledger.

Minimum string length: 1
custom_range
object

Only count entries that happened in this range.

recorded_range
object

Only count entries Autumn recorded in this range.

Response

200 - application/json

OK

entity_id
string | null
required

The entity whose own balance is counted, or null for the customer's.

coverage
object
required

How much of this customer's balance history Autumn holds. Balance history is rolling out and isn't available for every customer yet; coverage says whether it is for this one.

counts
object
required

How many entries of each type the range holds, as balances.list_ledger's types filter lists them.

complete
boolean
required

False when the count couldn't cover the whole range; each count is then at least its value.