update_credit_note
Updates an existing TallyPrime credit note by date and voucher number, replacing item lines, party, and narration while preventing voucher-number collisions.
Instructions
Update an existing item-invoice Credit Note in TallyPrime, replacing its item lines, party, and narration. Same fields as create_credit_note, 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Existing credit note's date in DD-MM-YYYY format | |
| items | Yes | One entry per returned line — replaces all existing lines. | |
| billName | No | Bill reference to settle against, e.g. the original invoice's bill name. Defaults to 'Agst Ref' billType. | |
| billType | No | Defaults to 'Agst Ref' — settling against the original invoice's bill, unlike create_sales_invoice's 'New Ref' default. | |
| buyerTrn | No | The buyer's TRN on this credit note — same voucher-level field as create_credit_note'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 | Narration / description | |
| reference | No | Free-text reference for this credit note. | |
| vatLedger | No | Default VAT ledger for items without their own override. | |
| buyerState | No | The buyer's Emirate/state on this credit note's Party Details. | |
| partyLedger | Yes | Customer ledger name (the party being credited) | |
| voucherType | No | Voucher type of the existing voucher, if it isn't the default 'Credit Note' (e.g. 'Tax Invoice'). Used to find it and to check no other voucher shares its number. | |
| buyerCountry | No | The buyer's country on this credit note's Party Details. | |
| referenceDate | No | Date for the reference above, in DD-MM-YYYY format. | |
| voucherNumber | Yes | Exact voucher number of the credit note to update | |
| vatRatePercent | No | Default VAT rate. Required if vatLedger is set. | |
| placeOfSupplyCountry | No | UAE VAT Place of Supply Country for this credit note. | |
| placeOfSupplyEmirate | No | UAE VAT Place of Supply Emirate for this credit note. |