Update Transaction Splits
update_transaction_splitsReplace or remove all splits on a transaction by providing a complete set of new split legs. Leg amounts must sum to the transaction total.
Instructions
Create, replace, or remove the splits on a transaction.
This is a full replacement: the splits you pass become the transaction's complete set of split legs, replacing any that exist. Pass an empty list to remove all splits and restore the transaction to a single un-split entry.
Args: transaction_id: ID of the transaction to split (required) splits: The complete set of split legs. Each leg has: - amount (required): Leg amount, using the parent's sign convention (expenses negative, income positive). All leg amounts MUST sum to the parent transaction's amount or Monarch rejects the update. - category_id (optional): Category for this leg - merchant_name (optional): Merchant display name for this leg; defaults to the parent merchant when omitted - notes (optional): Per-leg memo Pass an empty list to delete all existing splits.
Example: Split a -100.00 transaction into groceries and household: transaction_id="txn_123" splits=[ {"amount": -70.00, "category_id": "cat_groceries", "notes": "Food"}, {"amount": -30.00, "category_id": "cat_household"}, ]
Returns: The transaction id, whether it now has splits, the resulting split legs, and a human-readable summary message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| splits | Yes | ||
| transaction_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| splits | Yes | ||
| message | Yes | ||
| transaction_id | Yes | ||
| has_split_transactions | Yes |