Ledger balances
Balance from source
Compute balance directly from transactions with the Java SDK.
GET
/balances/{balance_id}Use blnk.ledgerBalances().get for this operation.
Call the method
String balanceId = "bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f";
ApiResponse<JsonNode> response = blnk.ledgerBalances().get(
balanceId,
GetBalanceRequest.create().fromSource(true));
| Field | Type | Description |
|---|---|---|
id | String | Balance ID to compute from source. |
from_source | boolean | Must be true to reconstruct from transactions. |
Compare with stored balance
Use the computed amounts to audit or reconcile against the stored balance. Differences may indicate pending transactions or snapshot lag.
Response
{
"balance": {
"balance": 9620000,
"balance_id": "bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f",
"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
}
}
| Field | Type | Description |
|---|---|---|
balance.balance | Number | Net amount computed from all transactions. |
balance.balance_id | String | Unique ID for the balance. |
balance.credit_balance | Number | Total computed from credit transactions. |
balance.debit_balance | Number | Total computed from debit transactions. |
balance.currency | String | Currency of the balance. |
balance.ledger_id | String | Ledger this balance belongs to. |
balance.identity_id | String | Linked identity, if any. |
balance.created_at | String | Date and time the balance was created. |
balance.meta_data | JsonNode | Optional metadata on the balance. |