The short answer
- A Tally XML import is an
ENVELOPEwith an Import Data request, and oneVOUCHERper bank entry insideTALLYMESSAGE. - Each voucher has a date (
YYYYMMDD), a voucher type, a narration and two or more ledger entries. - Debit lines carry a negative amount and ISDEEMEDPOSITIVE Yes; credit lines a positive amount and No. The amounts in a voucher add up to zero.
- Every ledger name must already exist in the company, spelled exactly the same, or the voucher is rejected.
On this page
When you import bank entries into Tally with Alt+O › Transactions (see importing a bank statement into TallyPrime), the file is almost always XML. Converters, Excel add-ins and other software all produce the same basic structure, because it's what Tally reads, in TallyPrime and Tally.ERP 9 alike (see how the two versions differ).
The structure, outside in
| Tag | What it does |
|---|---|
ENVELOPE | Wraps the whole request |
HEADER › TALLYREQUEST | Import Data: tells Tally this is an import |
IMPORTDATA › REQUESTDESC › REPORTNAME | Vouchers: what is being imported |
STATICVARIABLES › SVCURRENTCOMPANY | Optional: the company to import into. Leave it out to import into the company that's open |
REQUESTDATA › TALLYMESSAGE | Holds the vouchers, one VOUCHER element each |
Here's a complete file with one Payment voucher, a rent payment from the bank:
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Import Data</TALLYREQUEST>
</HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>Vouchers</REPORTNAME>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF="TallyUDF">
<VOUCHER VCHTYPE="Payment" ACTION="Create">
<DATE>20261002</DATE>
<VOUCHERTYPENAME>Payment</VOUCHERTYPENAME>
<NARRATION>Office rent for October</NARRATION>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>Office Rent</LEDGERNAME>
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
<AMOUNT>-25000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>HDFC Bank - 0423</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>25000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
</VOUCHER>
</TALLYMESSAGE>
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>
Inside a voucher
| Field | Meaning | Watch out for |
|---|---|---|
VCHTYPE and VOUCHERTYPENAME | Payment, Receipt, Contra or Journal (or a custom voucher type you created) | Must match a voucher type in the company |
ACTION="Create" | Create a new voucher | Importing the same file again creates duplicates |
DATE | Voucher date as YYYYMMDD | Must fall inside the company's books period |
NARRATION | Free text, usually the bank narration | Escape &, < and > |
ALLLEDGERENTRIES.LIST | One block per ledger line | At least two per voucher |
LEDGERNAME | Ledger to post to | Exact spelling, existing ledger |
ISDEEMEDPOSITIVE and AMOUNT | Debit or credit, and how much | See the sign rule below |
The sign rule
Tally stores debits as negative amounts. In each ledger line, a debit has a negative AMOUNT with ISDEEMEDPOSITIVE set to Yes, and a credit has a positive amount with No. All the amounts in one voucher add up to zero.
| Voucher | Debit line (negative, Yes) | Credit line (positive, No) |
|---|---|---|
| Payment: rent paid | Office Rent −25,000 | Bank +25,000 |
| Receipt: customer paid | Bank −62,300 | Customer +62,300 |
| Contra: cash withdrawn | Cash −10,000 | Bank +10,000 |
| Payment: EMI | Loan −18,200 and Interest on Loan −6,800 | Bank +25,000 |
The same rule applied to a customer receipt:
<VOUCHER VCHTYPE="Receipt" ACTION="Create"> <DATE>20261004</DATE> <VOUCHERTYPENAME>Receipt</VOUCHERTYPENAME> <NARRATION>Payment against invoice 118</NARRATION> <ALLLEDGERENTRIES.LIST> <LEDGERNAME>HDFC Bank - 0423</LEDGERNAME> <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE> <AMOUNT>-62300.00</AMOUNT> </ALLLEDGERENTRIES.LIST> <ALLLEDGERENTRIES.LIST> <LEDGERNAME>Sharma Traders</LEDGERNAME> <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE> <AMOUNT>62300.00</AMOUNT> </ALLLEDGERENTRIES.LIST> </VOUCHER>
Errors you'll meet, and the fixes
| Symptom | Cause | Fix |
|---|---|---|
| Ledger does not exist | A LEDGERNAME isn't in the company, or is spelled differently | Create the ledger or correct the name; import masters first if you have many |
| Voucher type does not exist | VOUCHERTYPENAME doesn't match the company | Use the exact voucher type name |
| Nothing imported | Dates outside the books period, or the wrong company open | Open the right company; check the financial year |
| Import stops at a character | An unescaped & in a narration or ledger name | Write & for & |
| Debits and credits reversed | Sign or ISDEEMEDPOSITIVE flipped | Fix the sign rule in the file |
| Everything doubled | The same file imported twice | Restore the backup taken before the second import |
Tally lists failed vouchers in its import summary and writes details to its import log, Tally.imp in the Tally folder. Read it before re-importing. Tally's own pages on importing vouchers and XML integration go further.
Good habits with XML imports
- Back up the company before every import.
- Import into a test company first when the generator, the client or the Tally version is new.
- One file per client per period, named so you can tell which periods are done.
- Check the bank ledger's closing balance against the statement straight after import, then reconcile.
Generating the XML from a statement
Writing XML by hand only makes sense for a handful of entries. FileKey builds it from the statement PDF: every row is checked against the running balance, carries the ledger and voucher type you set (Payment & Receipt, or Contra), and uses your bank ledger name. The company name is only added if you choose one, so by default the file imports into whichever company is open. See the bank statement to Tally converter and how to map transactions to ledgers.
Frequently asked questions
What format does Tally use to import bank vouchers?
XML: an ENVELOPE with an Import Data request, and one VOUCHER per entry inside TALLYMESSAGE. Newer TallyPrime releases also import from Excel and JSON, but XML works in every version.
Why is the amount negative in Tally XML?
Tally stores debits as negative amounts. A debit line has a negative AMOUNT with ISDEEMEDPOSITIVE Yes; a credit line has a positive AMOUNT with No.
Do I need SVCURRENTCOMPANY in the XML?
Only to force the import into a named company. Without it, the vouchers go into the company that's open, which is usually what you want.
How do I import the XML file into TallyPrime?
Open the company, press Alt+O (Import), choose Transactions and select the file. Back up first, and import each file only once.
Sources and further reading
- Tally help: importing vouchers
- Tally developer reference: XML integration case study
- TallyPrime help: import data FAQ
Rules change by notification and advisory. Check the GST portal before you file.