Create Transaction Rule
create_transaction_ruleBuild an automation rule to categorize, rename, tag, hide, or mark transactions for review based on merchant, statement, or amount criteria. Optionally apply it to past transactions.
Instructions
Create an automation rule.
A rule needs at least one action and a merchant, statement, or amount criterion. Without one of those three, Monarch ignores later edits to the rule.
Criteria (a transaction must match all of them; values in one list are "or"): merchant_criteria: Merchant name text, e.g. [{"operator": "contains", "value": "Corner Deli"}]. original_statement_criteria: Bank statement text, same shape. amount_criteria: {"operator": "gt"|"lt"|"eq", "value": 20} or {"operator": "between", "lower": 10, "upper": 50}. Amounts have no sign. is_expense=True (the default) matches money going out; False matches money coming in. account_ids / category_ids: Only match these accounts or current categories.
Actions: set_category_id: Category ID from get_transaction_categories. set_merchant_name: New merchant name (a name, not an ID). add_tag_ids: Tag IDs to add. hide_from_reports: Hide matching transactions from reports. review_status: "needs_review" or "reviewed".
apply_to_existing_transactions=True also changes matching past transactions right away. That is hard to undo, so check the criteria with search_transactions first. This tool does not change rule priority.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_ids | No | ||
| add_tag_ids | No | ||
| category_ids | No | ||
| review_status | No | ||
| amount_criteria | No | ||
| set_category_id | No | ||
| hide_from_reports | No | ||
| merchant_criteria | No | ||
| set_merchant_name | No | ||
| original_statement_criteria | No | ||
| apply_to_existing_transactions | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule | Yes | ||
| applied_to_existing_transactions | Yes |