update_voucher
Modify an existing TallyPrime voucher by matching type, date, and voucher number, replacing its ledger entries and narration to correct financial records.
Instructions
Update an existing voucher in TallyPrime, replacing its ledger entries and narration. The voucher is matched by type + date + voucher number, so that combination must be unique and must exactly match an existing voucher (use get_ledger_vouchers or get_vouchers first to confirm it). Either pass debitLedger/creditLedger/amount for a simple 2-leg voucher, or pass 'entries' for 3+ lines, same as create_voucher. Refuses if another voucher type shares the same number on that date (confirmed live: Tally's Alter lookup ignores voucher type and can silently corrupt the wrong one) — resolve the collision in Tally first if that happens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Existing voucher's date in DD-MM-YYYY format | |
| amount | No | New amount of the transaction (simple 2-leg mode; omit if using 'entries') | |
| entries | No | For a voucher with more than 2 lines: an array of { ledgerName, amount, type: 'debit'|'credit', billName?, billType?, costCentre?, costCategory? }, same shape as create_voucher's entries. Debit and credit amounts must sum to the same total. When provided, this replaces debitLedger/creditLedger/amount. | |
| buyerTrn | No | The buyer's TRN on this voucher — same voucher-level field and Sales-class caveat as create_voucher's buyerTrn. | |
| narration | No | New narration / description for the voucher | |
| reference | No | Free-text reference for this voucher, backed by Tally's voucher-level REFERENCE field — same field and same independence from voucherNumber/bill references as on create_voucher. | |
| buyerState | No | The buyer's Emirate/state on this voucher's Party Details. | |
| debitLedger | No | Ledger name to debit (simple 2-leg mode; omit if using 'entries') | |
| voucherType | Yes | Voucher type, e.g. 'Payment', 'Receipt', 'Journal' | |
| buyerCountry | No | The buyer's country on this voucher's Party Details. | |
| costCategory | No | Cost category the cost centre belongs to. Defaults to 'Primary Cost Category'. | |
| creditLedger | No | Ledger name to credit (simple 2-leg mode; omit if using 'entries') | |
| referenceDate | No | Date for the reference above, in DD-MM-YYYY format (Tally's REFERENCEDATE field). Independent of the voucher's own date. | |
| voucherNumber | Yes | Exact voucher number of the voucher to update | |
| debitCostCentre | No | Cost centre to allocate the debit leg to (optional). | |
| creditCostCentre | No | Cost centre to allocate the credit leg to (optional). | |
| placeOfSupplyCountry | No | UAE VAT Place of Supply Country for this voucher. | |
| placeOfSupplyEmirate | No | UAE VAT Place of Supply Emirate for this voucher. |