Developer guide
Tally Prime Sales Order XML
TallyPrime accepts vouchers over HTTP on the machine where it runs. This guide shows a complete Sales Order request, explains each part, and lists the errors you are most likely to see.
Before you start
- Tally must be running with the company open, and set to act as a server (port 9000 by default).
- Order processing must be enabled (F11), so the
Sales Ordervoucher type exists. - The party ledger, the sales ledger, the GST ledgers and every stock item must already exist with exactly the names you send.
- The XML server has no authentication. Call it from the same machine and never expose port 9000 to a network you do not control.
A complete request
This request was generated by the same code OrderDak uses in production, from a sample order of two lines. Send it with POST http://localhost:9000 and the body as shown.
<ENVELOPE>
<HEADER><TALLYREQUEST>Import Data</TALLYREQUEST></HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>Vouchers</REPORTNAME>
<STATICVARIABLES><SVCURRENTCOMPANY>Sample Electricals Distributors</SVCURRENTCOMPANY></STATICVARIABLES>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF="TallyUDF">
<VOUCHER VCHTYPE="Sales Order" ACTION="Create" OBJVIEW="Invoice Voucher View">
<DATE>20261017</DATE>
<VOUCHERTYPENAME>Sales Order</VOUCHERTYPENAME>
<REFERENCE>MES/PO/2026-27/0412</REFERENCE>
<PARTYLEDGERNAME>Mehta Electric Stores</PARTYLEDGERNAME>
<PARTYNAME>Mehta Electric Stores</PARTYNAME>
<PERSISTEDVIEW>Invoice Voucher View</PERSISTEDVIEW>
<ISINVOICE>Yes</ISINVOICE>
<LEDGERENTRIES.LIST>
<LEDGERNAME>Mehta Electric Stores</LEDGERNAME>
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
<ISPARTYLEDGER>Yes</ISPARTYLEDGER>
<AMOUNT>-65608.00</AMOUNT>
</LEDGERENTRIES.LIST>
<LEDGERENTRIES.LIST>
<LEDGERNAME>CGST</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>5004.00</AMOUNT>
</LEDGERENTRIES.LIST>
<LEDGERENTRIES.LIST>
<LEDGERNAME>SGST</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>5004.00</AMOUNT>
</LEDGERENTRIES.LIST>
<ALLINVENTORYENTRIES.LIST>
<STOCKITEMNAME>FR PVC Insulated Wire 1.5 sqmm Red 90m</STOCKITEMNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<RATE>1540.00/Coil</RATE>
<AMOUNT>30800.00</AMOUNT>
<ACTUALQTY> 20 Coil</ACTUALQTY>
<BILLEDQTY> 20 Coil</BILLEDQTY>
<BATCHALLOCATIONS.LIST>
<GODOWNNAME>Main Location</GODOWNNAME>
<BATCHNAME>Primary Batch</BATCHNAME>
<ORDERNO>MES/PO/2026-27/0412</ORDERNO>
<AMOUNT>30800.00</AMOUNT>
<ACTUALQTY> 20 Coil</ACTUALQTY>
<BILLEDQTY> 20 Coil</BILLEDQTY>
<ORDERDUEDATE P="22-Oct-2026">22-Oct-2026</ORDERDUEDATE>
</BATCHALLOCATIONS.LIST>
<ACCOUNTINGALLOCATIONS.LIST>
<LEDGERNAME>Sales GST 18%</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>30800.00</AMOUNT>
</ACCOUNTINGALLOCATIONS.LIST>
</ALLINVENTORYENTRIES.LIST>
<ALLINVENTORYENTRIES.LIST>
<STOCKITEMNAME>FR PVC Insulated Wire 2.5 sqmm Red 90m</STOCKITEMNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<RATE>2480.00/Coil</RATE>
<AMOUNT>24800.00</AMOUNT>
<ACTUALQTY> 10 Coil</ACTUALQTY>
<BILLEDQTY> 10 Coil</BILLEDQTY>
<BATCHALLOCATIONS.LIST>
<GODOWNNAME>Main Location</GODOWNNAME>
<BATCHNAME>Primary Batch</BATCHNAME>
<ORDERNO>MES/PO/2026-27/0412</ORDERNO>
<AMOUNT>24800.00</AMOUNT>
<ACTUALQTY> 10 Coil</ACTUALQTY>
<BILLEDQTY> 10 Coil</BILLEDQTY>
<ORDERDUEDATE P="22-Oct-2026">22-Oct-2026</ORDERDUEDATE>
</BATCHALLOCATIONS.LIST>
<ACCOUNTINGALLOCATIONS.LIST>
<LEDGERNAME>Sales GST 18%</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>24800.00</AMOUNT>
</ACCOUNTINGALLOCATIONS.LIST>
</ALLINVENTORYENTRIES.LIST>
</VOUCHER>
</TALLYMESSAGE>
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>What each part does
- Envelope:
TALLYREQUESTisImport Data,REPORTNAMEisVouchers, andSVCURRENTCOMPANYnames the company exactly as it appears in Tally. - Dates:
DATEusesYYYYMMDD. The order due date inside the batch allocation uses Tally's display form, for example22-Oct-2026. - Sign convention: debits are negative with
ISDEEMEDPOSITIVEYes; credits are positive with No. In a Sales Order the party is debited for the total including GST, and the sales and GST ledgers are credited. The voucher must balance to zero. - Inventory entries: rate carries the unit (
1540.00/Coil), quantities carry a leading space and the unit (20 Coil), and the accounting allocation names the sales ledger. - Batch allocation: holds the godown (
Main Locationwhen godowns are off), the order number and the due date. - GST: send CGST and SGST ledgers for a sale within your state, IGST for a sale to another state. Some setups let Tally compute tax from the stock item instead; export one hand-made Sales Order from your company to see which applies.
- Escaping: names like
Mehta & Comust be written asMehta & Co.
Reading the response
<RESPONSE>
<CREATED>1</CREATED>
<ALTERED>0</ALTERED>
<LASTVCHID>812</LASTVCHID>
<ERRORS>0</ERRORS>
</RESPONSE>Success is CREATED of 1 with ERRORS of 0. Keep LASTVCHID so you can alter or cancel the voucher later. When something fails, ERRORS is above zero and LINEERROR explains why.
Common errors
- Stock item or ledger does not exist: the name differs from Tally's by a space, a case or a dot. Read the masters from Tally first and match against them.
- Voucher totals do not match: rounding. Round each line to two decimals before adding up tax and the party amount.
- Voucher type does not exist: order processing is off, or the voucher type was renamed.
- Nothing happens: no company is open, or Tally is not running as a server.
Rather not build and maintain this yourself?
OrderDak reads your customers' purchase orders, matches them to your stock items and posts Sales Orders like the one above, with checks for price, credit and stock.