How to compute balance directly from transactions.
curl --request GET \
--url 'http://localhost:5001/balances/{balance_id}?from_source=true' \
--header 'X-blnk-key: <api-key>'
{
"balance": {
"balance": 9620000,
"balance_id": "bin_be16c4a1-b5a6-4b64-a733-de2f6b24813d",
"credit_balance": 9620000,
"currency": "USD",
"debit_balance": 0,
"ledger_id": "ldg_049495c6-356e-4ebc-a45e-60d1e1e16afb",
"identity_id": "",
"created_at": "2024-11-26T08:36:36.238244338Z",
"meta_data": null
}
}
X-blnk-key: <api-key>.
Replace <api-key> with your secret API key. Ensure the key is kept secure and not exposed in public repositories or client-side code.
See also: Secure your Blnk server
true, indicates that the balance should be reconstructed directly from its transactions, bypassing balance snapshots and the default running balance.curl --request GET \
--url 'http://localhost:5001/balances/{balance_id}?from_source=true' \
--header 'X-blnk-key: <api-key>'
{
"balance": {
"balance": 9620000,
"balance_id": "bin_be16c4a1-b5a6-4b64-a733-de2f6b24813d",
"credit_balance": 9620000,
"currency": "USD",
"debit_balance": 0,
"ledger_id": "ldg_049495c6-356e-4ebc-a45e-60d1e1e16afb",
"identity_id": "",
"created_at": "2024-11-26T08:36:36.238244338Z",
"meta_data": null
}
}
Was this page helpful?
curl --request GET \
--url 'http://localhost:5001/balances/{balance_id}?from_source=true' \
--header 'X-blnk-key: <api-key>'
{
"balance": {
"balance": 9620000,
"balance_id": "bin_be16c4a1-b5a6-4b64-a733-de2f6b24813d",
"credit_balance": 9620000,
"currency": "USD",
"debit_balance": 0,
"ledger_id": "ldg_049495c6-356e-4ebc-a45e-60d1e1e16afb",
"identity_id": "",
"created_at": "2024-11-26T08:36:36.238244338Z",
"meta_data": null
}
}