create_sales_order
Record a future sale commitment in TallyPrime as a Sales Order voucher, including the required order number and per-item due dates, before goods are dispatched or invoiced.
Instructions
Create a Sales Order in TallyPrime — a future commitment to sell, before any goods move or invoicing happens. Same item-line shape as create_sales_invoice/create_delivery_note but VCHTYPE is 'Sales Order' and Tally classifies it as an Order-class voucher, structurally different from Delivery Note's inventory-class. Follow up with create_delivery_note (dispatch) and/or create_sales_invoice (billing) against the same party once goods actually move. Same voucher-type-active prerequisite as create_delivery_note (confirmed live) — check it's on in the company before relying on this. orderNumber and each item's dueDate are REQUIRED (unlike other item-invoice tools, where the equivalent fields are optional): confirmed live that Tally rejects an Order-class voucher with 'Order No. is missing in Item Allocations' and separately 'Due Date of Order is missing in Item Allocations' without them. Reverse-engineered from a real manually-created Sales Order's own export: the UI's 'Order no.' field is backed by the voucher-level REFERENCE tag (independent of the voucher number — the real example had voucherNumber '1' and Order no. '12345' as genuinely different values), while the per-item Order No. and Due Date both live nested inside each item's BATCHALLOCATIONS.LIST, not as direct ALLINVENTORYENTRIES fields as their names might suggest. Also confirmed live: Tally silently reassigns its own voucher number for Order-class vouchers regardless of an explicit voucherNumber passed in (its 'Auto Retain' numbering style for this voucher type) — check the actual assigned number via get_vouchers after creating one, don't assume the value you passed was used.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Order date in DD-MM-YYYY format | |
| items | Yes | One entry per line. | |
| narration | No | Narration / description | |
| orderNumber | Yes | REQUIRED — the order reference shown as 'Order no.' in Tally's UI. Independent of voucherNumber; can be any value the customer/business uses to reference this order. | |
| partyLedger | Yes | Customer ledger name | |
| voucherNumber | No | Explicit voucher number. Normally omit and let Tally auto-number — but some Tally configurations stop auto-numbering certain voucher types via the XML gateway (confirmed live for item-invoice types; unconfirmed either way for Sales Order). 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. Distinct from orderNumber. |