Outcome
Where the cash went over a range (default the financial year to today), grouped into operating, investing and financing, with opening and closing cash. Double entry does the work: every posting nets to zero, so the change in the bank is exactly the opposite of everything that moved outside it, and each non-cash account contributes the negative of its own movement. The statement therefore ties to the bank by construction; reconciles going false means the balance projection is stale, not that the statement disagrees. Year-end closes are left out, as on the profit and loss. compare and comparePeriods add earlier columns exactly as they do there.
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.cash_flow.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/cash-flow
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 |
|---|---|---|---|
from | Optional | from | {"type":"string","pattern":"^\d{4}-\d{2}-\d{2}$"} |
to | Optional | to | {"type":"string","pattern":"^\d{4}-\d{2}-\d{2}$"} |
compare | Optional | compare | {"type":"string","enum":["none","previous_period","previous_year","budget"]} |
comparePeriods | Optional | compare Periods | {"anyOf":[{"type":"integer","minimum":1,"maximum":11},{"type":"string","pattern":"^(?:[1-9]|1[01])$"}]} |
basis | Optional | basis | {"type":"string","enum":["accrual","cash"]} |
dimensionKey | Optional | dimension Key | {"type":"string","minLength":1,"maxLength":40} |
dimensionValue | Optional | dimension Value | {"type":"string","minLength":1,"maxLength":60} |
dimensionColumns | Optional | dimension Columns | {"type":"boolean"} |
Inspect nested fields and the complete input schema.
Effects
- Reads the selected Books reports result in the credential-scoped organization and applicable canonical workspace. Where the cash went over a range (default the financial year to today), grouped into operating, investing and financing, with opening and closing cash. Double entry does the work: every posting nets to zero, so the change in the bank is exactly the opposite of everything that moved outside it, and each non-cash account contributes the negative of its own movement. The statement therefore ties to the bank by construction; reconciles going false means the balance projection is stale, not that the statement disagrees. Year-end closes are left out, as on the profit and loss. compare and comparePeriods add earlier columns exactly as they do there.
Interpret the response
This result returns a collection, report or verification summary without a stable resource identifier. Retain identifiers already resolved through published discovery; do not treat dates, counts or status flags as new ids.
Inspect the actual response fields and retained identifiers for the selected organization/workspace. Where the cash went over a range (default the financial year to today), grouped into operating, investing and financing, with opening and closing cash. Double entry does the work: every posting nets to zero, so the change in the bank is exactly the opposite of everything that moved outside it, and each non-cash account contributes the negative of its own movement. The statement therefore ties to the bank by construction; reconciles going false means the balance projection is stale, not that the statement disagrees. Year-end closes are left out, as on the profit and loss. compare and comparePeriods add earlier columns exactly as they do there. Use the related published read actions when a returned record or ledger outcome needs further inspection; an HTTP 200 does not establish provider delivery or financial agreement.
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.cash_flow.get --data @payload.json --json
topolo actions plan app_topolo_books.reports.cash_flow.get --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_books.reports.cash_flow.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.cash_flow.get",
"input": {
"from": "2026-09-01",
"to": "2026-09-30"
},
"resourceType": "workspace",
"resourceId": "<exact granted workspace id>",
"detail": true
}
}
Refused response · auth_error
Input · payload.json:
{}
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:
{
"from": "2026-09-01",
"to": "2026-09-30"
}
Captured response · HTTP 200
{
"from": "2026-09-01",
"to": "2026-09-30",
"currency": "GBP",
"compare": "none",
"comparePeriods": 0,
"columns": [
{
"key": "period",
"label": "2026-09-01 to 2026-09-30",
"from": "2026-09-01",
"to": "2026-09-30"
}
],
"sections": [
{
"key": "operating",
"rows": [
{
"accountId": "acc_0dfc994d47764901a4de1c2c441cefe9",
"computed": null,
"code": "5000",
"name": "Cost of sales",
"subtype": "cost_of_sales",
"amountsMinor": [
-2500
],
"amountMinor": -2500,
"comparativeMinor": null
}
],
"totalsMinor": [
-2500
],
"totalMinor": -2500,
"comparativeTotalMinor": null
},
{
"key": "investing",
"rows": [],
"totalsMinor": [
0
],
"totalMinor": 0,
"comparativeTotalMinor": null
},
{
"key": "financing",
"rows": [],
"totalsMinor": [
0
],
"totalMinor": 0,
"comparativeTotalMinor": null
}
],
"summary": {
"netProfit": {
"amountsMinor": [
-2500
],
"amountMinor": -2500,
"comparativeMinor": null
},
"workingCapital": {
"amountsMinor": [
0
],
"amountMinor": 0,
"comparativeMinor": null
},
"operating": {
"amountsMinor": [
-2500
],
"amountMinor": -2500,
"comparativeMinor": null
},
"investing": {
"amountsMinor": [
0
],
"amountMinor": 0,
"comparativeMinor": null
},
"financing": {
"amountsMinor": [
0
],
"amountMinor": 0,
"comparativeMinor": null
},
"netChange": {
"amountsMinor": [
-2500
],
"amountMinor": -2500,
"comparativeMinor": null
},
"openingCash": {
"amountsMinor": [
0
],
"amountMinor": 0,
"comparativeMinor": null
},
"closingCash": {
"amountsMinor": [
-2500
],
"amountMinor": -2500,
"comparativeMinor": null
}
},
"reconciles": true
}
HTTP 200. Inspect the actual response fields and retained identifiers for the selected organization/workspace. Where the cash went over a range (default the financial year to today), grouped into operating, investing and financing, with opening and closing cash. Double entry does the work: every posting nets to zero, so the change in the bank is exactly the opposite of everything that moved outside it, and each non-cash account contributes the negative of its own movement. The statement therefore ties to the bank by construction; reconciles going false means the balance projection is stale, not that the statement disagrees. Year-end closes are left out, as on the profit and loss. compare and comparePeriods add earlier columns exactly as they do there. Use the related published read actions when a returned record or ledger outcome needs further inspection; an HTTP 200 does not establish provider delivery or financial agreement.
Verify the result
- Inspect the actual response fields and retained identifiers for the selected organization/workspace. Where the cash went over a range (default the financial year to today), grouped into operating, investing and financing, with opening and closing cash. Double entry does the work: every posting nets to zero, so the change in the bank is exactly the opposite of everything that moved outside it, and each non-cash account contributes the negative of its own movement. The statement therefore ties to the bank by construction; reconciles going false means the balance projection is stale, not that the statement disagrees. Year-end closes are left out, as on the profit and loss. compare and comparePeriods add earlier columns exactly as they do there.
- Use the related published read actions when a returned record or ledger outcome needs further inspection; an HTTP 200 does not establish provider delivery or financial agreement.
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 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.