API / Reference / Card Balance Accounts
Get total spend for a card balance account
GET
https://api.light.inc/v1/card-balance-accounts/{accountId}/total-spend
Returns the total spend for a card balance account within a date range
to is exclusive, contrary to the description: it is taken as the start of that UTC day, so to=2026-01-31 excludes 31 January. Omit to to count up to now. from is inclusive from 00:00 UTC. The total counts transactions in AUTHORIZED, CAPTURED, POSTED and REFUNDED, adding DEBIT amounts and subtracting CREDIT ones, so refunds reduce it and it can be negative. DECLINED and VOIDED are ignored. The response echoes from and to as the resolved instants.
Authorization
Send one of these on every request. See Authentication for how to get credentials.
- API key
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
- Bearer token
Path parameters
-
accountIdstring · uuidrequired
Query parameters
-
fromstring · dateStart of the spend window, inclusive. A UTC calendar date in
YYYY-MM-DDformat. -
tostring · dateEnd of the spend window, inclusive. A UTC calendar date in
YYYY-MM-DDformat. Defaults to now if omitted.
Response
-
currencystring -
totalinteger · int64 -
fromstring · date-time -
tostring · date-time