reconcile_account
Reconcile account splits against a statement balance, verifying the result matches before updating, with targeted or bulk modes.
Instructions
Reconcile splits against a statement balance.
SIGN CONVENTION: statement_balance is the ACCOUNT's balance in GnuCash's signs — for liability accounts (credit cards) a $5,000 owed balance is "-5000", not "5000".
Two modes:
Targeted (
split_guids=[...]): reconcile exactly the listed splits (SPLIT guids from get_unreconciled_splits, not transaction guids). Use when statement and book disagree and you need to pick a subset.Bulk (
reconcile_all=true): reconcile every unreconciled split dated on or before through_date (default: statement_date — a statement reconciliation is bounded by the statement). One call, no GUID round-trip.
Both modes verify the resulting reconciled balance ties to statement_balance before mutating; mismatch rejects with the discrepancy amount.
TYPICAL STATEMENT FLOW (credit card or bank): batch-enter the statement's transactions (create_transactions), then reconcile_all with the statement's closing date and balance. Multi-month catch-up: enter all months in one batch, then one reconcile_all per statement, oldest first — the through_date default keeps each sweep inside its own statement.
Args: account: Account ref: full path (e.g. 'Assets:Bank:Checking'), %short GUID, or full 32-char GUID statement_date: Statement ending date (YYYY-MM-DD) statement_balance: Expected balance from statement (as string, e.g., '1234.56') split_guids: List of split GUIDs to reconcile (targeted mode). Omit for bulk mode. reconcile_all: When true, reconcile all unreconciled splits up to through_date. through_date: Date filter for bulk mode (YYYY-MM-DD); defaults to statement_date.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | Yes | ||
| split_guids | No | List of SPLIT GUIDs to reconcile (8+ char prefixes accepted). These are NOT transaction GUIDs — get them from get_unreconciled_splits. Required for targeted mode; omit when using reconcile_all=true. | |
| except_guids | No | Optional list of split GUID prefixes to exclude from the bulk reconcile. Useful for "everything on the statement except this pending ACH" — 2 tokens vs the 100+ a full split_guids listing would cost. Only valid with reconcile_all=true; prefixes that don't resolve are silently ignored. | |
| through_date | No | Upper-date bound for reconcile_all (YYYY-MM-DD); only splits with post_date <= through_date are swept. DEFAULTS TO statement_date — pass a later date explicitly to widen the sweep past the statement. | |
| reconcile_all | No | When true, reconcile every unreconciled split on the account dated on or before through_date (default: statement_date). Avoids the ~300-token GUID round-trip for statement workflows — enter several months of transactions, then reconcile each statement with just its date and balance. Mutually exclusive with split_guids. | |
| statement_date | Yes | ||
| statement_balance | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |