replace_splits
Replace all splits in a transaction with a new set, preserving date, description, currency, and notes; unchanged reconciled legs stay intact, and force handles changed reconciled splits.
Instructions
Replace all splits in a transaction with a new set.
Replace all splits in a transaction with a completely new set. The transaction's currency, description, date, and notes are preserved. New splits must balance to zero.
A new split that reproduces an existing one (same account, amount, and quantity) is an UNCHANGED leg: it keeps the old split's memo (supply a memo to override) and its reconcile state. So recategorizing the expense leg of a reconciled bank transaction is safe — resubmit the bank leg as-is and only the changed leg resets.
Args: guid: Transaction GUID (32-character hex string, or 8+ char prefix) splits: Complete new set of splits. Each split needs: - 'account' (required): Account ref — full path, %short GUID, or full 32-char GUID - 'amount' (required): Value in transaction currency, as a decimal string - 'quantity' (optional): Amount in account's commodity, as a decimal string. Required if account commodity differs from transaction currency. - 'memo' (optional): Split memo force: Required only when the replacement would CHANGE a reconciled split (or remove splits from lots) — unchanged reconciled legs are preserved without it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guid | Yes | Transaction GUID (32-char hex or 8+ char prefix) | |
| force | No | ||
| splits | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |