Integrating Tally ERP, Razorpay and WhatsApp Business API Into Your Custom Web App
The three tools that appear in almost every integration brief we receive at Marketing Wise are Tally ERP, Razorpay and WhatsApp Business API. Together they cover the financial backbone, the payment layer, and the communication channel for the majority of businesses in Noida and Delhi NCR. This guide explains how each integration works technically, what data flows across the connection, and what to watch for during implementation.
Tally ERP integration
Tally does not expose a native REST API. Integration is achieved via TDL (Tally Definition Language) scripts that expose an XML-over-HTTP interface on a configurable local port (default: 9000). Your custom web application sends HTTP POST requests with XML payloads to this endpoint and receives XML responses containing ledger data, vouchers, stock items, parties, and outstanding balances.
At Marketing Wise, we wrap the TDL layer in a Node.js middleware service that: parses Tally's XML output into structured JSON, handles connection retries when Tally is restarted, exposes a clean REST API to the main application, and caches high-frequency read operations (like stock levels and ledger balances) in Redis to avoid hammering the local Tally instance.
What syncs: purchase vouchers, sales vouchers, stock items and quantities, party ledger balances, accounts payable/receivable, GST data. What does not sync cleanly: custom voucher types with non-standard TDL definitions (these need per-client TDL scripting).
Razorpay integration
Razorpay provides a well-documented REST API and official Node.js and Python SDKs. Integration covers three main use cases: one-time payments, subscription billing, and payment link generation.
One-time payments use Razorpay Orders API — your backend creates an order, the frontend loads the Razorpay checkout widget with the order ID, and the payment result is verified server-side using Razorpay's HMAC-SHA256 signature verification before updating the order status in your database. Never trust the client-side success callback without server-side signature verification.
Subscription billing uses Razorpay Subscriptions — you define plans, customers subscribe, and Razorpay handles recurring charge attempts, retry logic on failed payments, and webhook notifications for events (payment.captured, subscription.charged, subscription.halted). Your application listens for these webhooks and updates customer access accordingly.
Payment links are useful for B2B invoice payments — your app generates a Razorpay Payment Link via API and sends it to the customer via WhatsApp or email. When paid, Razorpay fires a webhook that marks the invoice settled in your system and triggers a Tally voucher creation.
WhatsApp Business API integration
WhatsApp Business API (via Meta's Cloud API) requires a verified business account and approved message templates for outbound messages. Once set up, your application sends HTTP POST requests to Meta's Graph API endpoint with the recipient's phone number and template parameters.
Common use cases we implement: order confirmation messages, delivery status updates (triggered by Shiprocket webhook events), payment receipt notifications (triggered by Razorpay webhook events), appointment reminders (scheduled via node-cron), and two-way customer support routing (inbound WhatsApp messages parsed via webhook and routed to an internal ticketing system).
Key implementation detail: WhatsApp only allows outbound messages using pre-approved templates for the first contact. Free-form messages are only permitted within a 24-hour window after the customer has messaged you first. Design your notification flows around this constraint from the start — retrofitting it later is expensive.
The three-way integration: closing the loop
The highest-value implementation combines all three: a customer places an order in your web app → Razorpay processes payment → on payment.captured webhook, the app creates a sales voucher in Tally via TDL → the app sends a WhatsApp payment confirmation to the customer. This eliminates manual data entry at every step and gives you a real-time, reconciled view of orders, payments and accounts without anyone copying data between systems.
Marketing Wise has implemented this three-way integration for businesses in manufacturing, logistics, healthcare and retail across Noida and Delhi NCR. If you are planning a similar build, call +91-95-602-919-70 to discuss your specific data flow requirements.