Ledger balances

Balance from Source

How to compute balance directly from transactions.

GET/balances/{balance_id}

Authorization

If set, the API uses an API key for authentication. Include the following header in your requests: 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: Core API key.

Path

balance_idstringrequiredpath

Specifies the unique ID of the balance whose balance should be computed from source transactions.

Query

from_sourcebooleanrequiredquery

When set to true, indicates that the balance should be reconstructed directly from its transactions, bypassing balance snapshots and the default running balance.

Response

This endpoint computes the balance by processing all transactions from genesis. For balances with extensive transaction history, this may take longer than the standard balance endpoint.

balanceobjectrequired

The computed balance object containing all balance details.

balance.balanceintegerrequired

The net amount computed from all transactions (credit_balance - debit_balance).

balance.balance_idstringrequired

The unique identifier of the balance.

balance.credit_balanceintegerrequired

Total amount computed from all credit transactions (money moving into the balance).

balance.debit_balanceintegerrequired

Total amount computed from all debit transactions (money moving out of the balance).

balance.currencystringrequired

The currency code of the balance.

balance.ledger_idstringrequired

The unique identifier of the ledger this balance belongs to.