Outcome
Balance sheet at a date (default today): current and non-current assets and liabilities, equity with current-year and prior-years earnings computed from the ledger, and a balanced flag. compare adds the previous month or the previous year beside every figure. Amounts are natural-sign base-currency minor units. compare adds earlier columns, each stepping back again: previous_month by a month, previous_year by twelve. comparePeriods says how many, 1 to 11, and needs compare set. Read columns for the date each column is drawn at and amountsMinor for the figures in that order
Before you start
- Verify the intended environment, authenticated identity and specifically approved organization context.
- The published application permission is ledger:read. Discover the exact granted canonical Books workspace and bind it separately from action input.
Discover the target
topolo whoami --json
topolo actions get app_topolo_books.reports.balance_sheet.get --detail --json
topolo resources topolo-books --json
topolo workspaces list topolo-books --json
- Set BOOKS_WORKSPACE_ID to the exact granted workspace returned by discovery.
Request
GET /api/reports/balance-sheet
Inspect and test this action. Save the reviewed input as payload.json; supply credential/resource context separately.
Input fields
| Field | Required | Meaning | Schema and constraints |
|---|---|---|---|
asOf | Optional | as Of | {"type":"string","pattern":"^\d{4}-\d{2}-\d{2}$"} |
compare | Optional | compare | {"type":"string","enum":["none","previous_month","previous_year"]} |
comparePeriods | Optional | compare Periods | {"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"string","pattern":"^(?:[1-9]|1[01])$"}]} |
Inspect nested fields and the complete input schema.
Effects
- Reads the balance sheet from the ledger without changing anything. Current-year and prior-years earnings are computed from income and expense accounts, so the sheet balances before any year-end rollover is posted.
Interpret the response
This is a grouped financial report; subtotal or summary rows can lack account identifiers. Inspect populated row accountId values when present and discover actual accounts separately.
No verification needed for a read. A balanced flag of false means the projection needs app_topolo_books.ledger.balances.rebuild.
Inspect the success schema. CLI/MCP add their own transport envelope; CLI --detail requests the full result.
Worked examples
Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.
Run a reviewed request
Save the input from the selected worked example as payload.json. Validate and inspect the plan before calling the action; refused examples demonstrate errors and are not instructions to execute.
CLI:
topolo actions validate app_topolo_books.reports.balance_sheet.get --data @payload.json --json
topolo actions plan app_topolo_books.reports.balance_sheet.get --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_books.reports.balance_sheet.get --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --detail --json
MCP tool and arguments for the first successful example:
{
"tool": "topolo_read_action",
"arguments": {
"actionId": "app_topolo_books.reports.balance_sheet.get",
"input": {
"asOf": "2026-03-31"
},
"resourceType": "workspace",
"resourceId": "<exact granted workspace id>",
"detail": true
}
}
Refused response · auth_error
Input · payload.json:
{
"asOf": "2026-06-30",
"compare": "previous_year"
}
Captured response · HTTP 401
{
"error": "API key validation failed"
}
HTTP 401. SDK error code auth_error. Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.
Successful response · HTTP 200
Input · payload.json:
{
"asOf": "2026-03-31"
}
Captured response · HTTP 200
{
"asOf": "2026-03-31",
"currency": "USD",
"fiscalYearStart": "2026-01-01",
"compare": "none",
"comparePeriods": 0,
"comparativeAsOf": null,
"columns": [
{
"key": "asOf",
"label": "2026-03-31",
"from": "2026-03-31",
"to": "2026-03-31"
}
],
"sections": [
{
"key": "current_assets",
"rows": [
{
"accountId": "acc_c3cb8ade23aa408089d47fab2d2c06d8",
"computed": null,
"code": "1000",
"name": "Bank account",
"subtype": "bank",
"amountsMinor": [
9000
],
"amountMinor": 9000,
"comparativeMinor": null
}
],
"totalsMinor": [
9000
],
"totalMinor": 9000,
"comparativeTotalMinor": null
},
{
"key": "non_current_assets",
"rows": [],
"totalsMinor": [
0
],
"totalMinor": 0,
"comparativeTotalMinor": null
},
{
"key": "current_liabilities",
"rows": [],
"totalsMinor": [
0
],
"totalMinor": 0,
"comparativeTotalMinor": null
},
{
"key": "non_current_liabilities",
"rows": [],
"totalsMinor": [
0
],
"totalMinor": 0,
"comparativeTotalMinor": null
},
{
"key": "equity",
"rows": [
{
"accountId": null,
"computed": "current_year_earnings",
"code": null,
"name": null,
"subtype": null,
"amountsMinor": [
9000
],
"amountMinor": 9000,
"comparativeMinor": null
}
],
"totalsMinor": [
9000
],
"totalMinor": 9000,
"comparativeTotalMinor": null
}
],
"summary": {
"totalAssets": {
"amountsMinor": [
9000
],
"amountMinor": 9000,
"comparativeMinor": null
},
"totalLiabilities": {
"amountsMinor": [
0
],
"amountMinor": 0,
"comparativeMinor": null
},
"netAssets": {
"amountsMinor": [
9000
],
"amountMinor": 9000,
"comparativeMinor": null
},
"totalEquity": {
"amountsMinor": [
9000
],
"amountMinor": 9000,
"comparativeMinor": null
},
"currentYearEarnings": {
"amountsMinor": [
9000
],
"amountMinor": 9000,
"comparativeMinor": null
},
"priorYearsEarnings": {
"amountsMinor": [
0
],
"amountMinor": 0,
"comparativeMinor": null
}
},
"balanced": true
}
HTTP 200. No verification needed for a read. A balanced flag of false means the projection needs app_topolo_books.ledger.balances.rebuild.
Verify the result
- No verification needed for a read. A balanced flag of false means the projection needs app_topolo_books.ledger.balances.rebuild.
Errors and recovery
auth_error(HTTP 401): Authenticate in the intended organization again. Verify whoami and the exact Books application/workspace binding before retrying; do not switch identity to work around a refusal.
These are observed local refusals. Shared authentication, schema validation and resource authorization can also refuse before the route. Preserve the actual error, details and request id.
Recovery boundary
Repeat a read in the same authorized context; no state is changed.
Related actions
- Get account ledger lines: General ledger detail for one account: lines in posting order, paged with limit and offset. openingBalanceMinor is the balance immediately before the returned page, including both activity before the requested range and earlier lines in that range.
- Get profit and loss: Profit and loss statement for a date range (default: the current financial year to today), with accrual or cash recognition. compare can add earlier periods or the account budget; a reporting dimension can filter the statement or split its columns by value. Read
columnsfor the exact period, budget or dimension represented andamountsMinorfor each figure in that order.amountMinorandcomparativeMinorremain the first two figures for simpler callers. Amounts are natural-sign base-currency minor units. - Get trial balance: Every account holding a balance at the date, each on one side only: debitMinor carries a debit balance, creditMinor a credit balance, and the other is zero. Accounts that net to nothing are left out. totalDebitMinor and totalCreditMinor are the sums of those balances and must agree, which is what balanced reports. These are balances, not turnover: they do not add up everything ever posted to an account, which would count both sides of every entry and count an expense again when a year-end close reverses it.
Evidence
Actual Books route handlers and the exported Worker were exercised against five local SQLite D1 concern databases with all committed migrations, the real posting Durable Object and local R2. Route captures use synthetic verified Auth; Worker captures use synthetic Auth transports. Nexus, Brand, Notify, Pay, Mercury and Xero responses are explicitly simulated at the provider transport boundary. Captures prove local request/response behavior and canonical SDK projection, not live bank access, payment movement, email delivery, provider eligibility, tax compliance, encrypted custody, scheduled execution, deployment or production completion. Fixture identities, credentials, addresses and records authorize no live operation.