create_purchase_order
Create a purchase order in TallyPrime to record a future commitment to buy from a supplier, specifying items, quantities, rates, and required due dates before goods arrive or invoices are generated.
Instructions
Create a Purchase Order in TallyPrime — a future commitment to buy, before any goods move or invoicing happens. Same item-line shape as create_purchase_invoice/create_receipt_note but VCHTYPE is 'Purchase Order' and Tally classifies it as an Order-class voucher. Follow up with create_receipt_note (goods in) and/or create_purchase_invoice (billing) against the same party once goods actually arrive. Same voucher-type-active prerequisite as create_delivery_note (confirmed live). orderNumber and each item's dueDate are REQUIRED — same reasoning as create_sales_order: reverse-engineered from a real Sales Order export, confirmed the same live errors and Auto Retain numbering behavior apply here too.
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 business uses to reference this order. | |
| partyLedger | Yes | Supplier 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 Purchase 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. |