Ledger balances
View balance details
Get a balance by ID with the Go SDK.
GET
/balances/{balance_id}Use client.LedgerBalance.Get to retrieve a balance by its balance ID.
Call the method
balance, _, _ := client.LedgerBalance.Get(
"bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f",
)balance, _, _ := client.LedgerBalance.Get(
"bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f",
&blnkgo.GetBalanceRequest{WithQueued: true},
)
| Field | Type | Description |
|---|---|---|
balanceID | string | Balance ID to retrieve. |
WithQueued | bool | Optional. When true, includes queued_credit_balance and queued_debit_balance in the response. |
Pass a *blnkgo.GetBalanceRequest as the second argument to include queued balances:
Response
{
"balance": 0,
"inflight_balance": 0,
"credit_balance": 0,
"inflight_credit_balance": 0,
"debit_balance": 0,
"inflight_debit_balance": 0,
"ledger_id": "ldg_049495c6-356e-4ebc-a45e-60d1e1e16afb",
"identity_id": "",
"balance_id": "bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f",
"currency": "USD",
"created_at": "2024-11-26T08:36:36.238244338Z",
"meta_data": null
}Go response (*blnkgo.LedgerBalance)
| Field | Type | Description |
|---|---|---|
BalanceID | string | Unique ID for the balance. |
Balance | *big.Int | Current net amount. |
CreditBalance | *big.Int | Total amount moved into the balance. |
DebitBalance | *big.Int | Total amount moved out of the balance. |
Currency | string | Currency or asset class. |
LedgerID | string | Ledger this balance belongs to. |
CreatedAt | time.Time | Date and time the balance was created. |
MetaData | MetaData | Optional metadata object. |