create_transaction
Create a balanced double-entry transaction in GnuCash with split entries, and validate via duplicate detection or dry-run before writing.
Instructions
Create a new transaction with splits. Splits must balance to zero.
Each split: account (full path, required), amount
(required, in transaction currency), quantity (required
when account commodity differs from transaction currency),
memo (optional), action (optional). amount and
quantity are decimal strings (e.g. "94.87") — never raw
JSON numbers, which would lose precision on non-dyadic
decimals.
FIELD TARGETING — the annotation fields, one job each, in GnuCash-register visibility order:
description: the clean name ("Chevron 0090706 Portland"). Always visible.notes: what the purchase WAS, when the description alone doesn't say ("Fuel, road trip to Portland"). Visible in the register's double-line view — this is the annotation humans read. Interpret; don't transcribe.split
memo(bank/card leg): the RAW statement line as provenance ("Withdrawal ACH TRAVELERS TYPE: PER INSUR…"). Visible only in expanded split view — evidence, not narrative.split
action: the typed KIND of movement, one word. Matters most on investment legs, where desktop convention (and the Advanced Portfolio report) expects "Buy" / "Sell" / "Dividend"; bank legs may use "Wire" / "ATM" / "Interest". Skip it for ordinary spending.
When duplicate detection surfaces candidates (either rejecting
the write with status: "rejected" or returning alongside a
successful create), duplicates in the response is a
newline-separated TSV string, not a list of dicts. Columns::
confidence<TAB>guid<TAB>date<TAB>amount<TAB>cur<TAB>description<TAB>signalsConfidence is HIGH (all three signals match) or MEDIUM
(two of three). Signals is a three-char code: position 0
description, position 1 amount (±$1 tolerance), position 2
date (±2 days); D/A/D for match, - for miss.
Args: description: Transaction description. splits: List of split dicts (see above). Omit to auto-fill from the most recent matching-description transaction. transaction_date: ISO date (YYYY-MM-DD). Defaults to today. currency: ISO currency code. Defaults to book's default. notes: What the purchase was (see FIELD TARGETING above). check_duplicates: Run duplicate detection. Default True. force_create: Create even if HIGH-confidence duplicates found. dry_run: Validate + dupe check only; don't write.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | ||
| splits | No | ||
| dry_run | No | ||
| currency | No | ||
| description | Yes | ||
| force_create | No | ||
| check_duplicates | No | ||
| transaction_date | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |