GET
/strings/{code}/accounts/{accountCode}/balanceUnified per-ledger balance for an account code across a string
One balance line per member ledger, never collapsed by currency. Ledgers that have not materialised the account get a zero line flagged materialized: false. Add ?include=total_in_base_currency for an indicative sum converted at the current FX rate; ?base_currency= overrides the reporting currency.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
coderequired | path | string | String code (unique within the tenant) |
accountCoderequired | path | string max length: 36 | Account code (logically present across the whole string) |
include | query | string | Comma-separated opt-in extras. Currently: total_in_base_currency. |
base_currency | query | string | Base currency for total_in_base_currency (defaults to the configured reporting currency). |
Responses
200Successful operation
{
"success": true,
"data": {
"string_code": "treasury-fx",
"account_code": "1000",
"ledgers": [
{
"ledger_id": "01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a",
"ledger_code": "gbp-main",
"currency": "GBP",
"storage_decimals": 2,
"display_decimals": 2,
"balances": {
"settled": "1000.00",
"pending": "50.00"
},
"materialized": false
}
],
"total_in_base_currency": {
"base_currency": "USD",
"settled": "1234.56",
"pending": "78.90"
}
}
} 401Unauthenticated
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 403Forbidden
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 404String/account not found or the key's ledger is not a member
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 422Invalid account code
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} Examples
curl https://ledga.io/api/v1/strings/{code}/accounts/{accountCode}/balance \
-H "Authorization: Bearer sk_xxxxxxxx_your_secret"