Standard Tally XML Tags for Sales Vouchers: Integration Rules
Standard Tally XML Tags for Sales Vouchers: Integration Rules
Comprehensive technical reference guide to Tally XML dictionary tags for sales vouchers. Import schemas, envelope tags, and code snippets.
Who is this for: Tally Integration
TallyPrime uses XML (Extensible Markup Language) as its primary format for data exchange and integrations. Developers building retail integrations, billing portals, or custom ERP systems use Tally XML formats to transfer sales vouchers.
To build working integrations, you must use Tally's exact XML tag dictionary. If tags are missing or incorrectly capitalized, Tally's import engine will reject the file with XML parsing errors. This guide details standard sales voucher tags, structural rules, and XML code examples.
1. Root Node Envelope Headers
Every XML payload sent to Tally must include standard wrapper tags to authenticate and target the correct company parameters:
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Import Data</TALLYREQUEST>
</HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>Vouchers</REPORTNAME>
<STATICVARIABLES>
<SVCURRENTCOMPANY>Your Company Name</SVCURRENTCOMPANY>
</STATICVARIABLES>
</REQUESTDESC>
<REQUESTDATA>
<!-- Voucher nodes go here -->
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>2. Core Sales Voucher Object Tags
A sales voucher contains transaction-level tags to define its behavior:
| Tally XML Tag | Description & Purpose | Example Value |
|---|---|---|
| <DATE> | Voucher date (Format: YYYYMMDD) | 20260702 |
| <GUID> | Globally Unique Identifier (Alphanumeric string) | a1b2c3d4-e5f6-7890 |
| <VOUCHERTYPENAME> | Must match a valid voucher type name in Tally | Sales |
| <VOUCHERNUMBER> | Invoice Number reference | INV-2026-0012 |
| <PARTYLEDGERNAME> | Ledger Name of the customer being debited | Acme Industries |
| <PERSISTEDVIEW> | Internal view settings, standard setting is Invoice mode | InvoiceView |
3. Mapping Accounting Entries: Debit vs. Credit
Sales vouchers use `LEDGERENTRIES.LIST` nodes to record accounting postings:
- ISDEEMEDPOSITIVE: Set to
Yesfor debits (Customer ledger) andNofor credits (Sales ledger). - LEDGERNAME: The ledger name must match your Tally database records exactly.
- AMOUNT: Negative values represent credits, while positive values represent debits in Tally's internal database calculations.
4. Mapping Inventory Allocations
For transactions tracking inventory sales, add a child node structure under `ALLINVENTORYENTRIES.LIST`:
- STOCKITEMNAME: The item name must match your Tally database records exactly.
- RATE: The price per unit of the stock item.
- BILLEDQTY: The quantity sold, including the unit symbol (e.g.
100 PCS). - AMOUNT: The total line value (Rate * Quantity).
5. Reconciling XML Data Structures
Confirm that the total debit amount matches the sum of credits in your XML schema:
If these values do not balance, TallyPrime will import the voucher but mark it as an out-of-balance transaction, preventing the entry from appearing in your financial statements.
6. Handling GST tax ledger tags
To record GST tax postings, add a `LEDGERENTRIES.LIST` node for each tax category (CGST, SGST, IGST). Set the ledger name to match your tax ledgers exactly (e.g. Output CGST @ 9%).
7. Resolving XML Parsing and Schema Errors
If TallyPrime displays a "Schema mismatch" or "Tag not found" error during import, check your XML file formatting. Ensure all tags are correctly closed and capitalized, as Tally's XML engine is case-sensitive.
8. Customizing Narration Tags
Use the `NARRATION` tag inside the parent voucher node to record transaction details like payment modes, transporter details, or order reference numbers. This information is saved with the voucher in Tally, providing a clear reference for audit checks.
9. Setting Up Auto-Cost Center Allocations
If your company tracks divisions or departments, allocate costs using the `CATEGORYALLOCATIONS.LIST` and `COSTCENTREALLOCATIONS.LIST` sub-nodes. This allows Tally to distribute revenue and expenses across your cost centers during imports.
10. Best Practices for XML Integration Maintenance
To keep your integrations running smoothly:
- Validate your XML payloads against Tally's schema guidelines before importing.
- Assign unique GUID values to each transaction to prevent duplicate entries.
- Reconcile transaction counts daily to check for skipped or failed vouchers.
11. Full Parent-Child XML Transaction Sample
In a parent-child transaction, the primary voucher block contains header fields, while details are nested in item allocation lists. This structure allows TallyPrime to group several inventory rows into one voucher document. This nested configuration requires careful mapping of item batch details, warehouse godown locations, and tracking parameters. Every stock transaction profile must verify that the corresponding tax calculations are distributed correctly among parent and child ledger mappings.
12. Validating XML Encoding Formats
Ensure all XML outputs use UTF-8 encoding. Characters like ampersands (&) or quotes must be escaped as standard entity references (e.g. & or ") to prevent compilation crashes during parser processing. Standardizing encoding tags at the start of your files prevents character conversion glitches that cause Tally to drop vouchers or generate blank ledger entries. Writing custom validation routines is recommended for API integrations.
13. Re-importing Corrected XML Payloads
When correcting XML records, verify that the GUID remains identical to replace the existing voucher rather than creating duplicate entries. If you change the GUID, Tally will treat it as a new transaction and duplicate the accounting values on your ledger. This can lead to ledger balance reconciliation issues during audit checks, so maintaining a consistent ID mapping registry is critical.
14. Standard Logging Rules for API Data Interchange
When connecting an ERP system or billing portal to Tally via HTTP XML requests, ensure your integration logs all responses. If Tally returns an error, the log file will contain the exact line number and tag causing the parsing failure. Reviewing these logs monthly helps you maintain integration reliability and identify database inconsistencies early.
Simplify Tally Integrations with Automated XML Exports
TrulyInvoice automatically formats your transaction data into Tally-compliant XML payloads, handling complex inventory and tax ledger mapping without custom coding.
Chartered Accountant & Accounting Automation Specialist