txn_bulk_recategorize
Moves matching lines from one account to another in bulk, with dry-run preview, selection token, and atomic apply.
Instructions
Move every line on account that matches the txn_list filters to to_account, posting one correction per line exactly as txn_recategorize does. Call with dry_run first for the matched count, debit, credit and net totals per currency, a sample and a selection_token, then pass that selection_token to apply exactly those lines; if the lines changed, SELECTION_CHANGED is returned and nothing is written. Lines of earlier corrections are left out and counted in excluded. Needs a narrowing filter. Applies atomically up to 500 lines and returns one receipt that audit_undo reverses as a unit. Retry with the same posting_reference and on_conflict skip. Propose-only credentials return one pending proposal that freezes the matched lines.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"company": "<company>",
"account": "<account>",
"to_account": "<to_account>"
},
"name": "txn_bulk_recategorize"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last transaction date to match (inclusive). | |
| date | No | YYYY-MM-DD posting date. Defaults to each source transaction's date. | |
| from | No | First transaction date to match (inclusive). | |
| meta | No | Exact `KEY=VALUE` matches on top-level metadata keys, combined with AND. | |
| account | Yes | Source account. Selects the line to move in each matched transaction. | |
| company | Yes | ||
| dry_run | No | Validate the batch and return the matched count, totals, a sample and a `selection_token` without writing. | |
| currency | No | Currency code. Required with an amount filter if the company uses multiple currencies. | |
| metadata | No | Case-insensitive substring of the transaction metadata. | |
| amount_eq | No | Exact entry amount in major units. | |
| amount_gt | No | Exclusive minimum entry amount in major units. | |
| amount_lt | No | Exclusive maximum entry amount in major units. | |
| direction | No | ||
| reference | No | Exact reference of the original transactions to match. | |
| to_account | Yes | Active account to receive each matched line. | |
| description | No | Case-insensitive substring of the transaction description. | |
| on_conflict | No | ||
| tax_category | No | Exact entry tax category to match. | |
| selection_token | No | The `selection_token` from a dry run. If the filters now match other lines, nothing is written and `SELECTION_CHANGED` is returned. | |
| to_tax_category | No | Tax category for each destination line. Defaults to each source line's category. | |
| posting_reference | No | Idempotency reference for the batch. Use `on_conflict` "skip" for an exact retry. | |
| posting_description | No | Description for each correcting posting. |