Save journal entry
save_journal_entryCreate or update a journal entry. Pass an id to update it; omit id to create a new one. Returns the new journal entry id on create. To create/update many at once, send an items array — one all-or-nothing transaction with a single ledger recompute; each item with an id updates, each without creates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Journal entry id. Present → update; omit → create a new one. | |
| date | No | Journal entry date (ISO 8601). | |
| name | No | Description of the journal entry. | |
| items | No | Vector of journal entry objects to create/update in one all-or-nothing batch. Preferred over repeated calls. Each item with an id updates; each without creates. | |
| lines | No | Journal lines. Each line debits or credits one account; total debits must equal total credits. | |
| notes | No | Free-text notes. | |
| amount | No | Total amount of the journal entry. | |
| opening | No | Whether this is an opening balance entry. |