GET
/accounts/{accountId}/balance Get account balance with layer details
Balances for each layer (settled, pending) plus the encumbrance split (overdue, future). There is no available figure: only settled funds are spendable.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
accountIdrequired | path | string uuid | Account UUID |
as_of_date | query | string date | Count the entries effective by the end of this date (Y-m-d, in the ledger's timezone), past, today or future. Omit it for the current balance: every posting committed by the moment of the request, whatever its effective date. overdue and future split the encumbrances recorded by this date by due date, so an encumbrance due later is in future but not yet in the encumbrance layer. |
layer | query | string enum: settled | pending | encumbrance | Filter by specific layer (informational only, all layers are always returned) |
Responses
200Balance retrieved successfully
{
"success": true,
"data": {
"account_id": "01234567-89ab-cdef-0123-456789abcdef",
"account_code": "1000",
"account_name": "Cash",
"account_type": "asset",
"normal_balance": "debit",
"balances": {
"settled": "1000.00",
"pending": "50.00",
"overdue": "20.00",
"future": "80.00"
},
"layer_details": {},
"currency": "GBP",
"as_of_date": "2025-01-15",
"calculated_at": "2026-01-15T10:30:00Z"
}
} 401Unauthenticated
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 403Forbidden
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 404Account not found
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 422A malformed as_of_date or an unknown layer
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} Examples
curl https://ledga.io/api/v1/accounts/{accountId}/balance \
-H "Authorization: Bearer sk_xxxxxxxx_your_secret" use Ledga\Api\LedgaClient;
$ledga = new LedgaClient('sk_xxxxxxxx_your_secret');
$balance = $ledga->accounts->getBalance('01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a');
echo $balance->settled;