create_credit_note
Record a sales return in TallyPrime by creating a credit note that reverses stock and revenue, increasing returned items' quantity.
Instructions
Create an item-invoice Credit Note in TallyPrime — a Sales return, reversing stock and revenue for returned items. Same shape as create_sales_invoice but with the debit/credit convention flipped, matching Purchase's sign pattern (a Credit Note is structurally a reverse Sales entry). Confirmed live on a real company: returning 5 units correctly increased the item's book quantity by exactly 5. Same godown and dual-role deletion caveats as create_sales_invoice apply.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Credit note date in DD-MM-YYYY format | |
| items | Yes | One entry per returned line. | |
| 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 (customer's) TRN as it should appear on this credit note (Tally's TRADERCONSVATTINNO/BASICBUYERSSALESTAXNO fields) — a per-voucher snapshot, not inherited from the party ledger master. | |
| narration | No | Narration / description | |
| reference | No | Free-text reference for this credit note (Tally's voucher-level REFERENCE field). | |
| 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 (voucher-level STATENAME). | |
| partyLedger | Yes | Customer ledger name (the party being credited) | |
| buyerCountry | No | The buyer's country on this credit note's Party Details (voucher-level COUNTRYOFRESIDENCE). | |
| referenceDate | No | Date for the reference above, in DD-MM-YYYY format. | |
| voucherNumber | No | Explicit voucher number. Normally omit and let Tally auto-number — but some Tally configurations stop auto-numbering item-invoice vouchers via the XML gateway (confirmed live). If creation fails with a blank EXCEPTIONS:1, check get_vouchers for the highest existing number of this voucher type and retry with voucherNumber set to the next one. | |
| vatRatePercent | No | Default VAT rate. Required if vatLedger is set. | |
| placeOfSupplyCountry | No | UAE VAT Place of Supply Country (Tally's PLACEOFSUPPLYCOUNTRY field). | |
| placeOfSupplyEmirate | No | UAE VAT Place of Supply Emirate for this credit note (Tally's EMIRATEPOS field). |