List Wallet Balance History

Returns a wallet's Balance at the end of each day.

Returns the wallet's Balance at the end of each day, oldest first, as Reporting records it. Use it for closed days. It can differ from Get Wallet Balances, and the latest day can still be filling in.

API syntax

GET https://api.kevel.co/v1/wallet/{WalletID}/balance-history

Notes

  • Days after today repeat the latest Balance.
  • Read every page for a long period.
  • Shortly after you create a wallet, the call returns {"items": [], "totalCount": 0} instead of the usual page fields, then a 502 until the wallet reaches reporting. Retry after a short wait. Each day then returns 0 until spend or an adjustment arrives.

Reconcile spend

Work out a period's delivery spend after its last day has closed.

  1. Pull end-of-day balances with this call, starting the day before the period, so you have an opening Balance. If the wallet did not exist on that day, the opening Balance is 0.
  2. Pull the adjustments for the period's own dates with List Wallet Adjustments.
  3. Subtract. Delivery spend is the change in Balance minus the adjustments. With an opening Balance of 4,000, a closing Balance of 22,000 and one adjustment of -10,000, delivery spend is 22,000 - 4,000 - (-10,000) = 28,000.

If an adjustment you posted is missing from the list, it is also missing from the history. Contact Kevel with the wallet ID and the idempotency key.

Errors

StatusMessageWhat to do
400startDate is required when endDate is provided.Add startDate.
400startDate must be a valid YYYY-MM-DD date. / endDate must be a valid YYYY-MM-DD date.Use YYYY-MM-DD.
400endDate must be on or after startDate.Fix the range.
404Wallet {id} not found.Use one of your wallet IDs.
502Upstream reporting service returned an unexpected response.Retry. If it continues, contact Kevel.
Path Params
integer
required

The wallet's ID.

Query Params
integer
≥ 1
Defaults to 1

The page number to return.

integer
≥ 1
Defaults to 50

How many results to return per page.

date

The first day to include, as YYYY-MM-DD. Without dates, the call returns from 45 days ago through today. With only this date, it runs through today.

date

The last day to include, as YYYY-MM-DD. It requires startDate and must be on or after it.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Choose an example:
application/json