Platform
Chatbot Builder Bulk Messaging Team Inbox Mini CRM API & Webhooks AI Integration WhatsApp Flows
Industries
E-commerce & D2C Real Estate Education Healthcare Finance & BFSI Logistics Hospitality Retail
Integrations
Learn
Learning Hub Help & Docs Connect Guides Automation Codex Blog Message Templates
Pricing Start Free Trial →
HomeConnect › Connect Tally to WhatsApp
TallyPrime Integration Guide · Accounting / India

Connect Tally to WhatsApp

For years, connecting Tally to anything was painful: no REST API, no cloud endpoint, just a local port on an office desktop. This guide explains exactly how Tally's XML-over-HTTP gateway works, how to bridge it to the internet safely, and how to send payment reminders and import orders between TallyPrime and WhatsApp.

Published 23 June 2026  ·  14 min read  ·  Accounting / India · Advanced
The honest summary, before you start

Tally has no REST API and no hosted cloud endpoint. It exposes an XML-over-HTTP gateway on a local port (default 9000). That gateway is genuinely powerful: you can read every report and write vouchers and masters. The only real difficulty is that the gateway lives on a local machine, so a cloud platform like WA.Expert needs a bridge to reach it. This guide covers the gateway, the bridge, and the exact XML for both directions.

1. How Tally integration actually works

Unlike a modern SaaS tool with a JSON REST API, TallyPrime communicates using XML over HTTP. When you enable the gateway, Tally itself becomes a small HTTP server. You POST an XML request describing what you want, and Tally responds with XML.

There are three request types, set in the <TALLYREQUEST> tag:

Request typeWhat it doesExample use
EXPORTRead data and reports out of TallyGet outstanding receivables, ledger balances, the Day Book, Trial Balance.
IMPORTWrite masters and transactions into TallyCreate a customer ledger, post a sales voucher from a WhatsApp order.
EXECUTERun a Tally functionLess common; used for specific TDL functions.

Every request shares the same envelope shape: a <HEADER> that says what you want, and a <BODY> that carries the detail.

The basic Tally XML envelope
<ENVELOPE>
  <HEADER>
    <VERSION>1</VERSION>
    <TALLYREQUEST>EXPORT</TALLYREQUEST>   <!-- EXPORT / IMPORT / EXECUTE -->
    <TYPE>COLLECTION</TYPE>               <!-- OBJECT / COLLECTION / DATA -->
    <ID>List of Ledgers</ID>             <!-- report or collection name -->
  </HEADER>
  <BODY>
    <DESC>
      <STATICVARIABLES>
        <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
        <SVCURRENTCOMPANY>ABC Traders</SVCURRENTCOMPANY>
      </STATICVARIABLES>
    </DESC>
  </BODY>
</ENVELOPE>
This integration is fully supported by Tally

Tally's own developer documentation states that Tally can communicate with any environment capable of sending and receiving XML over HTTP, including web scripting languages and applications. This is not a hack: it is the official, documented integration mechanism. Reference: Tally developer reference.

2. The bridge problem and three ways to solve it

Here is the catch that has frustrated businesses for years. The Tally gateway listens on localhost:9000. Localhost means "this machine only", so a cloud platform on the internet cannot reach it. WA.Expert's HTTP step runs in the cloud, not on your office PC, so it cannot call localhost:9000 directly.

There are three proven ways to bridge that gap. Choose based on your security needs and whether your Tally is on a desktop or already on a cloud server.

Bridge optionHow it worksBest for
Secure tunnel (Cloudflare Tunnel / ngrok)A small agent on the Tally PC creates an outbound HTTPS tunnel, giving Tally a public https URL without opening firewall ports.Quick setup, single office PC running Tally.
TallyPrime on Cloud (OCI / AWS)Tally runs on a cloud-hosted virtual machine that already has a reachable address. The gateway is exposed within the secured cloud network.Businesses already moving Tally to the cloud for remote access.
Outbound local connectorA small program on the Tally PC polls Tally with XML EXPORT, then calls WA.Expert outbound. Tally is never exposed to the internet at all.Regulated businesses; the most secure option.

For finance data, the outbound connector pattern is the safest: Tally stays completely private and only makes outbound calls.

Do not expose the raw Tally port to the open internet

The Tally gateway has no built-in authentication. Anyone who can reach the port can read and write your books. Always put it behind a secure tunnel with access controls, keep it inside a private cloud network, or use the outbound connector pattern so the port is never publicly reachable.

Step 1: Enable the Tally XML gateway

1
Open TallyPrime and load your company (Company → Select).
2
Go to Exchange → Data Synchronization (the Data Synchronization Configuration screen appears).
3
Set TallyPrime acting as to Server (or Both).
4
Set the Port to 9000 (or any free port).
5
Accept to save. Tally now listens for XML requests on http://localhost:9000.
Verify the gateway is live (run on the Tally PC)
# A simple POST that asks Tally for its list of ledgers.
# If Tally responds with XML, the gateway is working.

curl --location 'http://localhost:9000' \
  --header 'Content-Type: text/xml' \
  --data '<ENVELOPE>
    <HEADER>
      <VERSION>1</VERSION>
      <TALLYREQUEST>EXPORT</TALLYREQUEST>
      <TYPE>COLLECTION</TYPE>
      <ID>List of Ledgers</ID>
    </HEADER>
    <BODY>
      <DESC>
        <STATICVARIABLES>
          <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
        </STATICVARIABLES>
      </DESC>
    </BODY>
  </ENVELOPE>'
Content-Type and encoding

Tally accepts text/xml (UTF-8 by default), UTF-16 (needed for the Rupee symbol and other special characters), and ASCII. Use UTF-16 if amounts or names contain currency symbols. The HTTP method is always POST.

Step 2: Make Tally reachable with a secure tunnel

The fastest bridge for a single office PC is Cloudflare Tunnel. It runs a small agent on the Tally machine and gives Tally a public HTTPS URL without opening any firewall ports.

Cloudflare Tunnel — expose localhost:9000 over HTTPS
# 1. Install cloudflared on the Tally PC (one-time).
# 2. Authenticate and create a named tunnel:

cloudflared tunnel login
cloudflared tunnel create tally-gateway

# 3. Route a hostname to the local Tally port:
cloudflared tunnel route dns tally-gateway tally.yourdomain.com

# 4. Run the tunnel pointing at Tally:
cloudflared tunnel --hostname tally.yourdomain.com \
                   --url http://localhost:9000 run tally-gateway

# Tally is now reachable at:
#   https://tally.yourdomain.com
# Add Cloudflare Access in front of it to require authentication.
ngrok is a faster alternative for testing

For a quick test, ngrok http 9000 gives you a temporary public HTTPS URL in seconds. For production, Cloudflare Tunnel or a cloud-hosted Tally with access controls is more dependable. Whichever you choose, always require authentication in front of the tunnel.

Direction A: Tally to WhatsApp

This is the highest-value direction for most businesses: read data out of Tally, then send it to customers or the owner on WhatsApp. The flagship use case is automated payment reminders from outstanding receivables.

Read outstanding receivables

Send an EXPORT request for the Bills Receivable report. Tally returns every outstanding bill with the party name and amount.

EXPORT — outstanding receivables (Bills Receivable)
<ENVELOPE>
  <HEADER>
    <VERSION>1</VERSION>
    <TALLYREQUEST>EXPORT</TALLYREQUEST>
    <TYPE>DATA</TYPE>
    <ID>Bills Receivable</ID>
  </HEADER>
  <BODY>
    <DESC>
      <STATICVARIABLES>
        <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
        <SVCURRENTCOMPANY>ABC Traders</SVCURRENTCOMPANY>
        <SVFROMDATE TYPE="Date">20260401</SVFROMDATE>
        <SVTODATE TYPE="Date">20260623</SVTODATE>
      </STATICVARIABLES>
    </DESC>
  </BODY>
</ENVELOPE>

Tally responds with XML listing each outstanding bill:
party name, bill reference, due date, and pending amount.

Read a single party's ledger balance

When a customer messages "what is my balance?" on WhatsApp, fetch their exact outstanding from Tally with a Ledger export.

EXPORT — one ledger's closing balance
<ENVELOPE>
  <HEADER>
    <VERSION>1</VERSION>
    <TALLYREQUEST>EXPORT</TALLYREQUEST>
    <TYPE>OBJECT</TYPE>
    <SUBTYPE>Ledger</SUBTYPE>
    <ID TYPE="Name">Rajesh Enterprises</ID>
  </HEADER>
  <BODY>
    <DESC>
      <STATICVARIABLES>
        <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
      </STATICVARIABLES>
      <FETCHLIST>
        <FETCH>Name</FETCH>
        <FETCH>ClosingBalance</FETCH>
        <FETCH>LedgerMobile</FETCH>
      </FETCHLIST>
    </DESC>
  </BODY>
</ENVELOPE>

Returns Name, ClosingBalance, and the stored mobile number,
which you prepend +91 to before sending the WhatsApp.

The full payment-reminder flow

Worked flow — automated payment reminders from Tally
Connector or scheduled automation, once per day:

1. POST EXPORT 'Bills Receivable' to the Tally bridge URL.
   -> Tally returns all outstanding bills as XML.

2. Parse the XML. For each overdue party:
   party_name      = 'Rajesh Enterprises'
   pending_amount  = 48500.00
   due_date        = '2026-06-10'
   mobile          = '9820012345'  (from the ledger master)

3. wa_phone = '+91' + mobile = '+919820012345'   <- PREPEND +91

4. Call WA.Expert send-message API for each party:
   'Dear Rajesh Enterprises, our records show an outstanding
    balance of Rs. 48,500 due since 10 June 2026.
    Kindly arrange payment. Reply here for any query.'

Result: dozens of polite, accurate reminders sent automatically
every morning, straight from your Tally books.
Always prepend +91 to the Tally mobile field

Tally stores LedgerMobile as whatever was typed, usually a bare 10-digit Indian number. WA.Expert needs +919820012345. Prepend +91 in your connector or automation before sending, and strip any spaces or leading zeros.

Direction B: WhatsApp to Tally

The reverse direction writes into Tally. When a customer confirms an order on WhatsApp, create the sales voucher in Tally automatically so the books stay current without manual entry.

Create dependent masters first

Tally rejects a voucher if the ledgers it references do not exist. Before posting a sales voucher for a new customer, create the party ledger (under Sundry Debtors) and ensure the Sales ledger exists (under Sales Accounts). Send the ledger IMPORT first, then the voucher IMPORT.

Create a customer ledger

IMPORT — create a party ledger under Sundry Debtors
<ENVELOPE>
  <HEADER>
    <TALLYREQUEST>Import Data</TALLYREQUEST>
  </HEADER>
  <BODY>
    <IMPORTDATA>
      <REQUESTDESC>
        <REPORTNAME>All Masters</REPORTNAME>
      </REQUESTDESC>
      <REQUESTDATA>
        <TALLYMESSAGE xmlns:UDF="TallyUDF">
          <LEDGER Action="Create">
            <NAME>Priya Textiles</NAME>
            <PARENT>Sundry Debtors</PARENT>
            <LEDGERMOBILE>9820012345</LEDGERMOBILE>
            <LEDSTATENAME>Maharashtra</LEDSTATENAME>
            <COUNTRYNAME>India</COUNTRYNAME>
          </LEDGER>
        </TALLYMESSAGE>
      </REQUESTDATA>
    </IMPORTDATA>
  </BODY>
</ENVELOPE>

Post a sales voucher

The party ledger is debited (positive) and the sales ledger is credited (negative). The two must sum to zero or Tally rejects the voucher.

IMPORT — create a sales voucher (accounting mode)
<ENVELOPE>
  <HEADER>
    <VERSION>1</VERSION>
    <TALLYREQUEST>Import</TALLYREQUEST>
    <TYPE>Data</TYPE>
    <ID>Vouchers</ID>
  </HEADER>
  <BODY>
    <DESC></DESC>
    <DATA>
      <TALLYMESSAGE>
        <VOUCHER VCHTYPE="Sales" ACTION="Create">
          <DATE>20260623</DATE>
          <VOUCHERTYPENAME>Sales</VOUCHERTYPENAME>
          <VOUCHERNUMBER>1</VOUCHERNUMBER>
          <PERSISTEDVIEW>Accounting Voucher View</PERSISTEDVIEW>
          <ISINVOICE>No</ISINVOICE>
          <LEDGERENTRIES.LIST>
            <LEDGERNAME>Priya Textiles</LEDGERNAME>
            <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
            <ISPARTYLEDGER>Yes</ISPARTYLEDGER>
            <AMOUNT>-11800.00</AMOUNT>
          </LEDGERENTRIES.LIST>
          <LEDGERENTRIES.LIST>
            <LEDGERNAME>Sales</LEDGERNAME>
            <ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
            <AMOUNT>11800.00</AMOUNT>
          </LEDGERENTRIES.LIST>
        </VOUCHER>
      </TALLYMESSAGE>
    </DATA>
  </BODY>
</ENVELOPE>

Response includes <CREATED>1</CREATED> on success,
or <LINEERROR> describing why it failed.
The golden rule of Tally vouchers

Debit total must equal credit total, to the paisa. The party ledger amount is negative and the sales ledger amount is positive (or vice versa for a receipt). If they do not net to zero, Tally returns Voucher totals do not match! and creates nothing. Dates must be in YYYYMMDD format.

Common XML errors and how to fix them

Tally responseWhat it meansFix
DESC not foundA referenced master (ledger, stock item) does not exist in Tally.Create the dependent ledgers and stock items first with an IMPORT, then retry the voucher.
Voucher totals do not match!Debit and credit amounts do not net to zero.Check the signs: party ledger negative, sales ledger positive. They must sum to exactly zero.
No response / connection refusedGateway not running or not reachable.Confirm Tally is open with the company loaded, the port is set in Data Synchronization, and the tunnel or connector is running.
Empty or partial data on EXPORTCompany not loaded, or wrong SVCURRENTCOMPANY.Load the correct company in Tally and set SVCURRENTCOMPANY to the exact company name.
LINEERROR about ledger natureLedger created under the wrong group.Sales ledger must be under Sales Accounts, party ledger under Sundry Debtors. Create masters under the correct group.
Garbled currency symbolsEncoding mismatch on amounts with the Rupee symbol.Send the request as UTF-16 (Content-Type: UTF-16) so special characters render correctly.

Tally also logs every import to a Tally.imp file in the TallyPrime installation folder, which is useful for debugging failed vouchers.

A tip that saves hours: export first, then import

The most reliable way to learn the exact XML for any voucher or master is to create one manually in Tally, then export it as XML (Tally → export the master/voucher). Tally shows you the precise tag structure it expects. Copy those tags into your IMPORT request. This removes all guesswork about optional fields.

Frequently asked questions

Does Tally have a REST API or cloud API?
+
No. Tally uses XML over HTTP. It acts as an HTTP server on a local port (default 9000) that accepts XML requests and returns XML. This is the official, documented integration mechanism, not a workaround.
Why can't WA.Expert reach Tally directly?
+
Tally listens on localhost, which is only reachable from the same machine. Bridge it with a secure tunnel (Cloudflare Tunnel/ngrok), host Tally on a cloud server, or use an outbound connector on the Tally PC that calls WA.Expert outward.
What can I do with Tally and WhatsApp?
+
Outbound: payment reminders from outstandings, ledger balance on request, invoice confirmations, daily sales summaries. Inbound: create customer ledgers and sales vouchers from WhatsApp orders automatically.
How do I read outstanding receivables?
+
EXPORT request with ID 'Bills Receivable'. Tally returns each outstanding bill with party name and amount. Parse it and send each party a WhatsApp reminder.
How do I create a sales voucher from a WhatsApp order?
+
IMPORT request with a VOUCHER of type Sales. Party ledger amount negative, sales ledger positive, summing to zero. Create the ledgers first if they don't exist.
Is it safe to expose Tally to the internet?
+
Not the raw port, which has no authentication. Use a secure tunnel with access controls, a private cloud network, or the outbound connector pattern so Tally is never directly exposed. For regulated businesses, the outbound connector is safest.
Need help wiring this up?

Tally integration has more moving parts than a normal cloud API: the gateway, the bridge, and the XML mapping. If you would like a hand setting up the connector or the payment-reminder flow for your business, book a call and the WA.Expert team will walk you through it.

Connect ERPNext to WhatsApp

ERPNext: a modern open-source ERP with a proper REST API and webhooks.

Read guide →

Connect Zoho Books to WhatsApp

Zoho Books: cloud accounting with OAuth and webhooks for invoices.

Read guide →

External API Request Step

Master every field in WA.Expert's HTTP action step.

Read foundation guide →

Connect Tally to WhatsApp today

Free trial, no credit card. Tally setups are our specialty, we answer live on WhatsApp.

Start Free Trial → Book a Demo
1