Tally XML Import Format: Schema, Rules & Code Examples
Tally XML Import Format: Schema, Rules & Code Examples
To programmatically import ledgers, stock items, or transaction vouchers into Tally Prime, you must format files in Tally's proprietary XML schema.
Who is this for: Tally Setup Docs
Tally Prime utilizes a proprietary XML structure for all data import, export, and synchronization activities. Whether you are building an invoice-to-Tally utility, connecting an e-commerce platform, or integrating client statement extractors, you must generate well-formed XML sheets that conform to Tally's database constraints.
The Basic Tally XML Document Structure
Every Tally XML document begins with the root <ENVELOPE> tag. Inside this, the document is split into a <HEADER> (defining the action to perform) and a <BODY> (containing the actual database records).
Working Payment Voucher XML Example
Below is a complete, well-formed XML snippet for a standard bank payment transaction (such as a rent payment). You can copy and save this text as a .xml file to test imports:
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Import</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Vouchers</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVCURRENTCOMPANY>Your Company Name</SVCURRENTCOMPANY>
</STATICVARIABLES>
</DESC>
<DATA>
<TALLYMESSAGE xmlns:UDF="TallyUDF">
<VOUCHER VCHTYPE="Payment" ACTION="Create">
<DATE>20260401</DATE>
<VOUCHERTYPENAME>Payment</VOUCHERTYPENAME>
<PARTYLEDGERNAME>HDFC Bank Account</PARTYLEDGERNAME>
<NARRATION>Rent paid for office space</NARRATION>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>Rent Expenses</LEDGERNAME>
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
<AMOUNT>-15000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>HDFC Bank Account</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>15000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
</VOUCHER>
</TALLYMESSAGE>
</DATA>
</BODY>
</ENVELOPE>Key XML Tags & Rules
- DATE Format: Tally accepts date strings only in the YYYYMMDD format (e.g., `20260401` for 1st April 2026). Commas, slashes, or dashes will cause the import to fail.
- ISDEEMEDPOSITIVE: This determines the debit or credit state of the ledger leg. Set to Yes for Debits and No for Credits.
- AMOUNT Column Sign: Counter-intuitively, Tally XML requires debit amounts to be marked as **negative** (e.g., `-15000.00`) and credit amounts as **positive** (e.g., `15000.00`). If you invert these signs, your voucher legs will be reversed.
- LEDGERNAME: The string must match the exact spelling (case-sensitive) of the ledger pre-configured in your Tally company database.
How to Import XML Files into Tally Prime
To import your completed XML data sheets:
- Ensure Tally Prime is running and the correct company file is open.
- Go to Gateway of Tally > Import > Transactions.
- Choose XML format, specify the path to your file, and press enter.
- Check Tally's event log file (
tally.imp, found in the installation folder) to review any failures or warnings.
Bypassing Manual XML Coding with TrulyInvoice
Writing code to format transaction records into XML leads to syntax errors, unclosed tags, and wrong ledger assignments. TrulyInvoice does this work automatically:
- Direct Conversion: Our cloud engine compiles raw bank statement PDFs or Excel tables into valid Tally XML files in-memory.
- Port 9000 Push: Instead of manual file downloads and imports, TrulyInvoice pushes the compiled XML stream straight into Tally using standard HTTP calls over port 9000.
- Errors Checked: It pre-validates dates, ledger names, and double-entry balance legs before uploading, guaranteeing zero data duplication.
Frequently Asked Questions
Q: Can I import multiple vouchers in a single XML file?
A: Yes. You can wrap multiple <VOUCHER> elements inside separate <TALLYMESSAGE> tags under the main <DATA> block to perform bulk imports.
Q: Why does Tally show "Voucher Type not found" error?
A: Make sure the `VCHTYPE` and `VOUCHERTYPENAME` tags match Tally's default types exactly (e.g. Payment, Receipt, Contra, Journal, Sales, Purchase) or your custom voucher class name.
Q: What is the TrulyInvoice flat pricing?
A: TrulyInvoice charges a flat rate of plans starting at ₹399/month for Lite (1,000 pages) and ₹599/month for Plus (2,000 pages), enabling automated data entry directly to Tally Prime.
Sync Invoices and Statements Directly to Tally Prime
Stop spending hours on manual data entry. Simply upload purchase/sales invoices and bank statements, review mapped items, and sync transaction entries directly to Tally Prime. Get started at just plans starting at ₹399/month for unlimited sync.
Start Free TrialFounder & Chief Architect of TrulyInvoice