create_voucher
Create Payment, Receipt, Sales, Purchase, or Journal vouchers in TallyPrime, with simple two-leg or multi-line entries. Override auto-numbering by passing an explicit voucher number when needed.
Instructions
Create a new voucher (e.g. Payment, Receipt, Sales, Purchase, Journal) in TallyPrime. Either pass debitLedger/creditLedger/amount for a simple 2-leg voucher, or pass 'entries' for a voucher with 3+ lines (e.g. one payment split across several expense ledgers). Normally omit voucherNumber and let Tally auto-number — but if Tally's numbering series doesn't pick up correctly (confirmed live: a company on a 'PNPC/2026/...' series silently restarted from '1' instead of continuing it), pass voucherNumber explicitly to force the value you want; check get_vouchers for the correct next number first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Voucher date in DD-MM-YYYY format | |
| amount | No | Amount of the transaction (simple 2-leg mode; omit if using 'entries') | |
| entries | No | For a voucher with more than 2 lines (e.g. one payment covering three expense ledgers): an array of { ledgerName, amount, type: 'debit'|'credit', billName?, billType?, costCentre?, costCategory? }. Debit and credit amounts must sum to the same total (Tally's double-entry rule) or the call fails with a clear error before reaching Tally. When provided, this replaces debitLedger/creditLedger/amount entirely. | |
| buyerTrn | No | The buyer's TRN as it should appear on THIS voucher, when voucherType is a Sales-side accounting document (e.g. a custom 'Tax Invoice' voucher type entered in Accounting Invoice mode — plain ledger entries, no stock items) — Tally's TRADERCONSVATTINNO/BASICBUYERSSALESTAXNO fields, reverse-engineered from a real such voucher. Only correct when the party ledger IS the buyer (Sales-class); for a Purchase-class voucher the buyer is your own company instead, which this generic field does not distinguish — use create_purchase_invoice's separate buyerTrn/supplierTrn for that case. | |
| narration | No | Narration / description for the voucher | |
| reference | No | Free-text reference for this voucher, backed by Tally's voucher-level REFERENCE field (the same field the 'Order no.' UI field on Order-class vouchers uses) — e.g. a supplier's bill/invoice number like 'PI-061538' on a Payment or Journal settling that bill. Independent of voucherNumber and of any per-leg bill reference name (debitBillName/creditBillName/entries[].billName), which is Tally's separate bill-wise settlement mechanism, not this field. | |
| buyerState | No | The buyer's Emirate/state on this voucher's Party Details (voucher-level STATENAME) — same Sales-class caveat as buyerTrn. | |
| debitLedger | No | Ledger name to debit (simple 2-leg mode; omit if using 'entries') | |
| voucherType | Yes | Voucher type, e.g. 'Payment', 'Receipt', 'Sales', 'Purchase', 'Journal' | |
| buyerCountry | No | The buyer's country on this voucher's Party Details (voucher-level COUNTRYOFRESIDENCE) — same Sales-class caveat as buyerTrn. | |
| 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') | |
| debitBillName | No | Bill reference name to allocate the debit leg against, e.g. for a Payment settling a Purchase bill. Omit for vouchers with no bill-wise tracking. | |
| debitBillType | No | 'New Ref' to open a new bill (e.g. a Purchase/Sales invoice), or 'Agst Ref' to settle an existing one by its exact bill reference name (e.g. a Payment/Receipt against a prior invoice). Also accepts 'Advance' or 'On Account'. Defaults to 'New Ref' if debitBillName is set. | |
| referenceDate | No | Date for the reference above, in DD-MM-YYYY format (Tally's REFERENCEDATE field). Independent of the voucher's own date. Only meaningful if reference is also set. | |
| voucherNumber | No | Explicit voucher number, overriding Tally's automatic numbering. Optional — omit to let Tally assign the next number in its series. | |
| creditBillName | No | Same as debitBillName, for the credit leg. | |
| creditBillType | No | Same as debitBillType, for the credit leg. | |
| 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 (Tally's PLACEOFSUPPLYCOUNTRY field), e.g. 'UAE'. | |
| placeOfSupplyEmirate | No | UAE VAT Place of Supply Emirate for this voucher (Tally's EMIRATEPOS field) — for a standard domestic supply this is normally your own company's Emirate (check get_company_info). |