update_sales_invoice
Update an existing TallyPrime Sales invoice voucher by replacing its item lines, party, and narration; match it by date and voucher number, and verify uniqueness before altering.
Instructions
Update an existing item-invoice Sales voucher in TallyPrime, replacing its item lines, party, and narration. Same fields as create_sales_invoice, plus voucherNumber. Matched by date + voucher number — use get_ledger_vouchers or get_vouchers first to confirm it exists and is unique. 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.
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": {
"voucherNumber": "<voucherNumber>",
"date": "<date>",
"partyLedger": "<partyLedger>",
"items": "<items>"
},
"name": "update_sales_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Existing invoice's date in DD-MM-YYYY format | |
| items | Yes | One entry per invoice line — replaces all existing lines. | |
| billName | No | ||
| billType | No | ||
| buyerTrn | No | The buyer's TRN as it should appear on this invoice — same voucher-level snapshot field as create_sales_invoice's buyerTrn. | |
| buyerName | No | Name to print in this voucher's Buyer (Bill to) box, when it should differ from the customer ledger's own name — Tally's per-voucher Party Details mailing name. The ledger itself is not changed. Useful when many sales are posted against one shared ledger (e.g. cash or card sales) but each invoice needs its own readable buyer name. | |
| narration | No | New narration / description for the invoice | |
| reference | No | Free-text reference for this invoice (Tally's voucher-level REFERENCE field). | |
| vatLedger | No | Default VAT ledger for items without their own override. | |
| buyerState | No | The buyer's Emirate/state as it should appear on this invoice's Party Details. | |
| partyLedger | Yes | Customer ledger name (the party being invoiced) | |
| voucherType | No | Voucher type of the existing voucher, if it isn't the default 'Sales' (e.g. 'Tax Invoice'). Used to find it and to check no other voucher shares its number. | |
| buyerCountry | No | The buyer's country as it should appear on this invoice's Party Details. | |
| referenceDate | No | Date for the reference above, in DD-MM-YYYY format. | |
| voucherNumber | Yes | Exact voucher number of the invoice to update | |
| vatRatePercent | No | Default VAT rate. Required if vatLedger is set. | |
| placeOfSupplyCountry | No | UAE VAT Place of Supply Country for this invoice. | |
| placeOfSupplyEmirate | No | UAE VAT Place of Supply Emirate for this invoice. |