Ledger balances

Historical balances

Retrieve accurate historical balance information with the Go SDK.

GET/balances/{balance_id}/at

Use client.LedgerBalance.GetHistorical to retrieve a balance at a specific point in time.

Call the method

timestamp, _ := time.Parse(time.RFC3339, "2025-02-24T08:55:26Z")

historical, _, _ := client.LedgerBalance.GetHistorical(
	"bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f",
	timestamp,
	false,
)
FieldTypeDescription
balanceIDstringBalance ID to query.
timestamptime.TimePoint in time for the historical balance. Parse ISO 8601 strings with time.Parse(
time.RFC3339, "...").
fromSourceboolWhen true, reconstruct from transactions instead of snapshots.

Response

{
  "timestamp": "2025-02-24T08:55:26Z",
  "from_source": false,
  "balance": {
    "balance_id": "bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f",
    "balance": 5000,
    "credit_balance": 5000,
    "debit_balance": 0,
    "currency": "USD"
  }
}

Go response (*blnkgo.LedgerBalanceHistorical)

FieldTypeDescription
Timestamptime.TimePoint in time you queried (ISO 8601).
FromSourceboolWhether the balance was reconstructed from transactions.
Balance.BalanceIDstringBalance you queried.
Balance.Balance*big.IntNet amount at that timestamp.
Balance.CreditBalance*big.IntTotal credits at that timestamp.
Balance.DebitBalance*big.IntTotal debits at that timestamp.
Balance.CurrencystringCurrency of the balance.