Retrieving Historical Balances
Retrieve accurate historical balance information.
Overview
The Historical Balances endpoint allows users to retrieve balances (identified by balance_id
) at a particular historical point in time, specified by the timestamp parameter.
It leverages Blnk’s balance snapshot feature to provide accurate historical data for financial reporting, auditing, or analysis.
Always format the date input as ‘YYYY-MM-DDTHH:MM:SS+00:00’ (e.g., 2024-04-22T15:28:03+00:00), where +00:00
specifies the timezone. It is UTC by default.
How it works
When querying for a balance at a specific timestamp, Blnk follows these steps to ensure accuracy and reliability:
-
Identify the most recent snapshot: The system retrieves the most recent snapshot taken before the requested timestamp. Snapshots are daily records of balances, captured manually by users as described in the Balance Snapshots feature.
If no snapshot is found, Blnk builds the historical balance from genesis (using transactions only). -
Apply intervening transactions: It then applies all transactions that occurred between the time of the snapshot and the requested timestamp. This reconstructs the balance state by accounting for any credits, debits, or other financial activities that took place during that period.
-
Return the computed balance: The final computed balance, reflecting the exact state at the requested timestamp, is returned in the response.
Balance snapshots
Learn how balance snapshots work
Bypassing balance snapshots
You can choose to bypass balance snapshots and directly reconstruct your balances from their transactions alone.
To do this, include the query parameter from_source=true
in your request URL:
Key considerations
-
Daily snapshots and reconstruction: Since snapshots are taken once per day per balance, balances between snapshots are reconstructed using transaction data.
-
Optimal snapshot timing: Choosing the right time to trigger snapshots is crucial for maintaining consistency and accuracy. Users should initiate snapshots at their preferred end-of-day period, such as midnight or another consistent business closing time.
Need help?
We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.
To ask questions or discuss issues, please contact us or join our Discord community.
Love building with Blnk? We’d love to hear your feedback. Tell us here.