txn_import
Import balanced JSON journals into one company as an atomic batch. Validate with dry-run and skip or reject duplicate references for safe retries.
Instructions
Import balanced JSON journals into one company in an atomic batch. Requires Direct posting authority. Supply 1 to 500 transactions, up to 5000 total entries and 1 MiB of JSON. Amounts are in major units. Use stable source references for retries; a reference must not start with the reserved txn: prefix (any case), which links use for transaction IDs. Use dry_run=true to validate and roll back. The default duplicate policy is skip. Set project on a revenue or expense entry to record its full amount as a project split in the same batch. Results list each new transaction's entry IDs. A skipped duplicate records no split; its project_attribution reports whether each requested line is already attributed and names the transaction and entry to pass to project_split. For bank-statement CSV, OFX or QFX, use ledger_setup_statement_import.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"company": "<company>",
"transactions": "<transactions>"
},
"name": "txn_import"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company | Yes | ||
| dry_run | No | Run the posting checks and roll back all mutations. | |
| currency | No | Default currency for journals without a currency. Defaults to `BEANKEEPER_CURRENCY` or USD. | |
| on_conflict | No | Skip duplicate references (default) or reject the whole batch. | |
| transactions | Yes | Balanced journals in the same format as the CLI JSON import. |