Tally Prime Integration Guide: XML, ODBC, TDL and Cloud Connectors
A Tally Prime integration guide for developers and finance heads: XML over HTTP, ODBC, TDL, connectors, syncing masters and vouchers, GST fields and pitfalls.
Tally Prime integration means moving masters (ledgers, stock items, parties) and vouchers (sales, purchases, receipts, journals) between TallyPrime and another system, such as a POS, ERP, e-commerce store or document AI pipeline. There are four main routes: XML over HTTP, ODBC, TDL customizations and connectors. Most production integrations combine XML for writes with a queue and a desktop agent.
This guide is for two readers. Developers get the mechanics, payload shapes and failure modes. Finance heads get the questions to ask before anyone writes code, because most Tally integration problems are accounting problems (duplicate vouchers, wrong ledgers, missing GST details) rather than technical ones.
How does Tally Prime integration work?
TallyPrime is desktop software. Your company data lives on a Windows machine or a server in your office, not in a cloud API. To exchange data, TallyPrime can act as an HTTP server on a local port (9000 by default), which you enable in its connectivity settings. Other software then sends it XML requests to import or export data.
That one fact shapes every design decision:
- Tally must be running, with the right company loaded, for any request to succeed.
- The port is usually only reachable on the local network. A cloud application cannot call it directly without a tunnel, VPN or agent.
- Throughput is limited. Tally processes requests one at a time, so bulk imports need batching and patience.
What are the options for integrating with Tally Prime?
| Option | Direction | Best for | Watch out for |
|---|---|---|---|
| XML over HTTP | Read and write | Creating and altering masters and vouchers from another system | Tally must be open; error messages are terse; payload shape varies by release |
| ODBC | Mostly read | Reporting, BI extracts, reconciliation queries | Not a write path; driver and bitness issues on Windows |
| TDL (Tally Definition Language) | Inside Tally | Custom fields (UDFs), custom reports, pushing data out of Tally on an event | Needs TDL skills; must be deployed on every Tally installation |
| Connectors (third-party or custom desktop agent) | Read and write | Cloud apps that must reach Tally on many customer machines | You own (or depend on) installation, updates and monitoring |
Recent TallyPrime releases have added JSON support alongside XML. Check the release your users run before you depend on it; many businesses stay on older versions for years, so XML remains the safest common ground.
XML over HTTP
This is the workhorse. You POST an ENVELOPE to http://<tally-host>:9000. For imports, the header says Import Data and the body names the target report (All Masters or Vouchers). A minimal sales voucher looks like this:
<ENVELOPE>
<HEADER><TALLYREQUEST>Import Data</TALLYREQUEST></HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>Vouchers</REPORTNAME>
<STATICVARIABLES><SVCURRENTCOMPANY>Acme Traders Pvt Ltd</SVCURRENTCOMPANY></STATICVARIABLES>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF="TallyUDF">
<VOUCHER VCHTYPE="Sales" ACTION="Create" REMOTEID="pos-store12-INV-000431">
<DATE>20261118</DATE>
<VOUCHERTYPENAME>Sales</VOUCHERTYPENAME>
<VOUCHERNUMBER>S12/000431</VOUCHERNUMBER>
<PARTYLEDGERNAME>Cash</PARTYLEDGERNAME>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>Cash</LEDGERNAME>
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
<AMOUNT>-1180.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>Sales @ 18%</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>1000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
<!-- CGST and SGST ledger entries of 90.00 each -->
</VOUCHER>
</TALLYMESSAGE>
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>
Two details catch every new developer. Debits are negative amounts with ISDEEMEDPOSITIVE set to Yes; credits are positive with No. And the response is not an HTTP error code. Tally returns HTTP 200 with counters such as CREATED, ALTERED and ERRORS, plus a LINEERROR when something fails. Your client must parse that response and treat ERRORS > 0 as a failure.
ODBC
TallyPrime can expose its collections over ODBC, which suits read-heavy work: pulling ledger balances into a BI tool, reconciling outstanding bills, or checking whether a voucher already exists. Treat it as a reporting interface. For writes, use XML.
TDL
TDL is the language Tally itself is customized in. You need it when the integration has to live inside Tally: adding user-defined fields (for example, an external order ID on a voucher), building a custom export, or sending data out to your API when a user saves a voucher. TDL is powerful, but it is a deployment as well as a code change: the TDL file has to be loaded on every installation that needs it.
Connectors and desktop agents
If you are a SaaS provider whose customers each run Tally, you need something on their machine that can reach the local port. That is a connector: a small Windows service that pulls jobs from your cloud, posts them to Tally over XML and reports results back. You can buy one or build one. Building gives you control over mapping, retries and support; buying is faster if your use case is standard.
How do you sync masters and vouchers?
Order matters. A voucher that references a ledger or stock item Tally does not know will fail. A reliable sync runs in this sequence:
- Groups and ledgers. Customers under Sundry Debtors, suppliers under Sundry Creditors, plus sales, purchase, tax and round-off ledgers.
- Units, stock groups and stock items, if you post inventory vouchers.
- Godowns (warehouses) and cost centers, if used.
- Vouchers: sales, purchases, credit and debit notes, receipts, payments, journals.
Some practical rules we follow:
- Keep a mapping table outside Tally. Store your source ID, the Tally name and the Tally GUID or master ID for every record you create. Names in Tally are the key, and users rename ledgers.
- Decide who owns each master. If both your system and the accountant create customers, you will get “ABC Traders” and “ABC Traders Pvt Ltd” as two ledgers. Pick one source of truth per master type.
- Summarize where it makes sense. A POS with thousands of bills a day rarely needs one Tally voucher per bill. A day-end summary per store and payment mode is often what the accountant wants, with the detail kept in the POS.
- Use
ACTION="Alter"for updates and keep the original identifier, rather than deleting and recreating vouchers.
Which GST fields matter in a Tally integration?
GST is where most “the sync worked but the books are wrong” problems come from. Plan for these fields from the start:
- Party GSTIN, state and registration type on customer and supplier ledgers. The place of supply decides whether you post CGST plus SGST (intra-state) or IGST (inter-state).
- HSN or SAC codes and GST rates on stock items or sales ledgers, so Tally’s GST reports and returns pick them up.
- Separate tax ledgers for CGST, SGST, IGST and cess, mapped explicitly rather than guessed.
- Company GST registration. TallyPrime supports multiple GST registrations in one company in recent releases, so vouchers may need to name the registration they belong to.
- E-invoice details (IRN, acknowledgement number and date) if invoices are generated outside Tally but must be reflected inside it.
The XML tags for GST details have changed between TallyPrime releases. Do not copy tags from an old blog post. Create one correct voucher and ledger by hand in your target version, export it as XML, and mirror that structure.
What are the most common Tally integration pitfalls?
Duplicates
The most common and most expensive failure. A network timeout after Tally has already saved the voucher leads to a retry, and now the sale is booked twice. Voucher numbers do not save you: many voucher types allow duplicate numbers, and auto-numbering ignores the number you send.
Idempotency
Make every write safe to repeat:
- Derive a stable identifier from the source record (for example,
pos-store12-INV-000431) and send it with the voucher, as aREMOTEIDor a user-defined field. - Record it in your mapping table with its state: pending, posted, failed.
- Before retrying an uncertain write, check Tally first (by export request or ODBC) for that identifier.
- Use a fingerprint (hash of party, date, amount and reference) as a second line of defense against the same document arriving twice from different channels.
Offline Tally
Tally is closed at night, the PC restarts for updates, or the accountant has a different company open. Your integration must not lose data when that happens. Put a queue between your system and Tally. The source publishes events; the connector consumes them only when Tally answers; failed messages are retried with backoff and parked in a dead-letter queue with a readable reason. Show sync status somewhere a finance user will actually see it.
Other traps
- Locked periods and date ranges. Vouchers dated outside the company’s books period or before a lock date fail.
- Rounding. Line-level GST rounding in your system and invoice-level rounding in Tally differ by paise; post an explicit round-off entry.
- Special characters such as
&in party names must be XML-escaped. - Large batches time out. Send small batches and log each result.
- Edits after posting. If a user edits a synced voucher in Tally, your system no longer matches. Decide whether Tally or the source wins, and reconcile on a schedule.
From our projects
We build and run Tally integrations in production, in three shapes:
- AI document to ledger. FinAIQ, the AI accounting platform we built, extracts invoices and receipts, validates GSTIN, PAN and HSN/SAC, and posts clean records into Tally, Zoho Books, QuickBooks, Xero, SAP and NetSuite. SHA-256 fingerprinting catches duplicate documents before they ever reach the ledger.
- POS to accounting. For a point-of-sale and billing software provider, we built a config-driven integration engine that syncs sales, purchases and inventory into TallyPrime, Busy, QuickBooks, Zoho Books and Xero. Mappings live in PostgreSQL rather than code, delivery runs through AWS SQS and SNS, and a Windows desktop connector writes vouchers and masters into on-premise ledgers over their local interfaces.
- Queue-first delivery. In both cases, a slow or closed accounting system never loses a record. It waits in the queue and posts when Tally is back.
These patterns are what our accounting system integration service is built on, and our Tally integration services apply them to TallyPrime specifically. If you run both ledgers, see Zoho Books and Tally integration. If Tally is one of several systems you need to connect, see our system integration and API development and integration work.
How much does a Tally integration cost?
We will not quote a number without seeing the scope, but these are the cost drivers:
- Number of voucher and master types (sales only, or the full purchase-to-pay and order-to-cash set).
- Direction: one-way posting is simpler than two-way sync with conflict rules.
- Deployment: one Tally installation in your office versus a connector rolled out to hundreds of customer machines.
- GST and e-invoicing depth, multi-registration companies and inventory.
- Reconciliation and monitoring requirements, including who fixes failed postings.
If you want a second pair of eyes on your Tally integration plan, we offer a free 30-minute review. Tell us what you are connecting and we will point out the risks before you build.
FAQ
Does TallyPrime have a REST API?
Not a cloud REST API. TallyPrime runs an HTTP server on the local machine that accepts XML requests (and JSON in recent releases). A cloud system reaches it through a desktop connector, tunnel or VPN.
Can I integrate Tally with a cloud application?
Yes. The usual pattern is a cloud queue plus a small Windows connector installed next to Tally. The connector pulls jobs, posts them to Tally locally and reports results back, so nothing is lost when Tally is offline.
Is ODBC or XML better for Tally integration?
Use ODBC for reading and reporting, and XML for creating or altering masters and vouchers. Many integrations use both: XML to write, ODBC or XML export to verify and reconcile.
How do I stop duplicate vouchers in Tally?
Send a stable external identifier with every voucher, keep a mapping table with posting state, check Tally before retrying an uncertain write, and fingerprint source documents to catch the same document arriving twice.
Do I need TDL for a Tally integration?
Not always. Standard masters and vouchers can be created over XML without TDL. You need TDL when you want custom fields, custom reports or Tally to push data out on its own.