Save a bank rule
books_save_bank_ruleA bank rule, like Xero's: which new bank lines it matches and how to book them, so lines that come every month (bank fees, rent, the phone bill) book themselves. when: conditions on the counterparty, description or reference (contains, equals, starts_with, ends_with; any case), all of them or any (match). Narrow it with direction (in, out), amount_min and amount_max (the line's size, no sign) and bank_account. Book to account with an optional tax split off, or split by percent across accounts (70% phone, 30% private), each part with its own tax. Rules are tried by position, lowest first; the first that matches is the line's first suggestion in books_bank_lines, and books_apply_bank_rules books every line a rule matches. Matched by name; only what you pass changes. Costs $0.001 per call; nothing if it fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tax | No | A tax by name (books_get lists them), e.g. "VAT 19%". | |
| name | Yes | The rule's name, e.g. "Bank fees". | |
| when | No | ||
| match | No | all | |
| split | No | ||
| account | No | An account code from the chart, e.g. "6600". | |
| new_name | No | ||
| position | No | ||
| tracking | No | Tracking options by category, e.g. {"Department": "Service"} (books_list_tracking). | |
| direction | No | ||
| amount_max | No | ||
| amount_min | No | ||
| description | No | The memo of the entries it books. Default: the line's own text. | |
| bank_account | No | Only lines on this bank account (its code); "" for any. |