Ledga
GET /strings/{code}/accounts/{accountCode}/balance

Unified per-ledger balance for an account code across a string

Returns one balance line PER MEMBER LEDGER (never collapsed by currency). Member ledgers that have not materialized the account get a synthesized zero line flagged materialized: false. Pass ?include=total_in_base_currency to also receive an indicative sum of every member line converted to the base currency at the current FX rate; the base defaults to the configured reporting currency and can be overridden with ?base_currency=.

Parameters

NameInTypeDescription
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,
        "display_precision": {
          "min": 2,
          "max": 2
        },
        "balances": {
          "settled": "1000.00",
          "pending": "50.00"
        },
        "materialized": false
      }
    ],
    "total_in_base_currency": null
  }
}
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"

← All endpoints