Outcome
Pair this line with its opposite in another of our bank accounts: one journal between the two ledger accounts, both lines matched. Refused unless the amounts are equal and opposite in the same currency and both accounts are linked to the ledger.
Before you start
- Verify the intended environment, authenticated identity and specifically approved organization context.
- The published application permission is banking:write. Discover the exact granted canonical Books workspace and bind it separately from action input.
- Approve the actual mutation, accounting inputs and any provider/recipient effects before CLI --confirm or MCP confirm:true. Fixture identifiers and simulated provider responses authorize no live operation.
Discover the target
topolo whoami --json
topolo actions get app_topolo_books.bank.lines.transfer --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.
- lineId: Exact bank line.id from bank.lines.list; inspect its current matching state before mutation.
- counterpartLineId: Exact other bank line.id for the authorized transfer. Both lines must be inspected in the intended workspace.
Request
POST /api/bank/lines/{lineId}/transfer
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 |
|---|---|---|---|
lineId | Required | Exact bank line.id from bank.lines.list; inspect its current matching state before mutation. | {"type":"string","minLength":1} |
counterpartLineId | Required | Exact other bank line.id for the authorized transfer. Both lines must be inspected in the intended workspace. | {"type":"string","minLength":1} |
overrideSoftLock | Optional | Explicit override of a soft accounting lock; inspect the lock and obtain authority before posting. | {"type":"boolean"} |
Inspect nested fields and the complete input schema.
Effects
- Posts one journal between the two bank ledger accounts, keyed by the pair of lines, and marks both lines matched to it.
Interpret the response
Read $.lines[].id for the returned bank_line identifier. Empty collections and nullable fields do not discover a target.
Call app_topolo_books.bank.lines.list with matchStatus matched and confirm both lines share matched_event_id.
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.bank.lines.transfer --data @payload.json --json
topolo actions plan app_topolo_books.bank.lines.transfer --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_books.bank.lines.transfer --resource-type workspace --resource-id "$BOOKS_WORKSPACE_ID" --data @payload.json --confirm --detail --json
MCP tool and arguments for the first successful example:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_books.bank.lines.transfer",
"input": {
"lineId": "bl_np6mi3_4",
"counterpartLineId": "bl_np6mi3_5"
},
"resourceType": "workspace",
"resourceId": "<exact granted workspace id>",
"confirm": true,
"detail": true
}
}
Refused response · auth_error
Input · payload.json:
{
"lineId": "bl_9c1",
"counterpartLineId": "bl_9c2"
}
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 201
Input · payload.json:
{
"lineId": "bl_np6mi3_4",
"counterpartLineId": "bl_np6mi3_5"
}
Captured response · HTTP 201
{
"lines": [
{
"id": "bl_np6mi3_4",
"organization_id": "org_rec_muvnp6mi3",
"workspace_id": "ws_rec_muvnp6mi3",
"bank_account_id": "bk_main_np6mi3",
"source": "statement",
"provider_transaction_id": "tx-bl_np6mi3_4",
"posted_on": "2026-06-15",
"period_key": "2026-06",
"amount_minor": -5000,
"currency": "GBP",
"description": "TO CASH",
"counterparty": null,
"memo": null,
"kind": null,
"provider_status": null,
"fingerprint": "fp-bl_np6mi3_4",
"match_status": "matched",
"matched_event_id": "je_da7583cddba44b7b838ae9913ed1c1ae",
"raw": null,
"imported_at": "2026-06-30T00:00:00Z",
"updated_at": "2026-10-05T19:42:17.875Z",
"duplicate_of": null,
"coded_account_id": null,
"matched_document_id": null,
"matched_payment_id": null,
"reconciled_at": "2026-10-05T19:42:17.875Z",
"reconciled_by": "usr_test",
"coded_by_rule_id": null,
"xero_coding": null
},
{
"id": "bl_np6mi3_5",
"organization_id": "org_rec_muvnp6mi3",
"workspace_id": "ws_rec_muvnp6mi3",
"bank_account_id": "bk_cash_np6mi3",
"source": "statement",
"provider_transaction_id": "tx-bl_np6mi3_5",
"posted_on": "2026-06-15",
"period_key": "2026-06",
"amount_minor": 5000,
"currency": "GBP",
"description": "FROM MAIN",
"counterparty": null,
"memo": null,
"kind": null,
"provider_status": null,
"fingerprint": "fp-bl_np6mi3_5",
"match_status": "matched",
"matched_event_id": "je_da7583cddba44b7b838ae9913ed1c1ae",
"raw": null,
"imported_at": "2026-06-30T00:00:00Z",
"updated_at": "2026-10-05T19:42:17.875Z",
"duplicate_of": null,
"coded_account_id": null,
"matched_document_id": null,
"matched_payment_id": null,
"reconciled_at": "2026-10-05T19:42:17.875Z",
"reconciled_by": "usr_test",
"coded_by_rule_id": null,
"xero_coding": null
}
],
"journal": {
"id": "je_da7583cddba44b7b838ae9913ed1c1ae",
"organization_id": "org_rec_muvnp6mi3",
"workspace_id": "ws_rec_muvnp6mi3",
"sequence": 4,
"period_key": "2026-06",
"posted_on": "2026-06-15",
"event_type": "journal_posted",
"journal_type": "bank_transfer",
"description": "Transfer between Current account and Cash",
"reference": "tx-bl_np6mi3_4",
"source_app": "topolo-books",
"source_document_type": "bank_line",
"source_document_id": "bl_np6mi3_4",
"actor_type": "human",
"actor_id": "usr_test",
"autonomy_level": null,
"correlation_id": "fixture-documentation",
"idempotency_key": "bank_transfer:bl_np6mi3_4:bl_np6mi3_5",
"reverses_event_id": null,
"reversed_by_event_id": null,
"total_debit_minor": 5000,
"total_credit_minor": 5000,
"line_count": 2,
"previous_hash": "c52d1a4698df8e9d34cc8120bd48f072f8b84579d17ca97946fa9c34c945a31e",
"hash": "bd0bff09fb16d411522e098ae086293d67ae87bd1123d19cc34fa1092b22b9fd",
"created_at": "2026-10-05T19:42:17.872Z",
"notes": null
}
}
HTTP 201. Call app_topolo_books.bank.lines.list with matchStatus matched and confirm both lines share matched_event_id.
Refused response · bank_line_not_found
Input · payload.json:
{
"lineId": "bl_np6pa4_1",
"counterpartLineId": "x"
}
Captured response · HTTP 404
{
"error": "bank_line_not_found",
"message": "Bank line x does not exist in this workspace"
}
HTTP 404. SDK error code bank_line_not_found. Discover bank.lines.list for the exact bank account/workspace and retain line.id before retrying.
Verify the result
- Call app_topolo_books.bank.lines.list with matchStatus matched and confirm both lines share matched_event_id.
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.bank_line_not_found(HTTP 404): Discover bank.lines.list for the exact bank account/workspace and retain line.id before retrying.
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
Unmatch either line: the journal is reversed and both lines return to unmatched.
Related actions
- List bank lines: List statement lines, filtered by account, match status or date, searched across description, counterparty, memo and the bank's transaction id, and sorted by posted date, amount, description or match status. Newest first unless you say otherwise; linkedOnly restricts them to accounts linked to a ledger account.
- Suggest how to reconcile a bank line: For one unmatched statement line: open invoices (money in) or bills (money out) it could be settling, scored by amount, a number or contact named in the description and date; the opposite line in another of our accounts that makes it a transfer; and the accounts lines like it were coded to before, with how often. Best first.
- List bank accounts: List the bank accounts reported by connected banks, with cached balances and the ledger account each maps to. linkedOnly returns just the accounts pointed at a ledger account.
- Unmatch a bank line: Put a line back to unmatched: a coding or transfer journal is reversed (both lines of a transfer return), an exclusion is lifted. A line matched to a document payment is refused, since the payment is the record.
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.