ml-connector
TallyPrimeSquare

TallyPrime and Square integration

Square processes your sales and payments; TallyPrime keeps your books. Connecting them keeps your accounting in sync with reality. Sales transactions from Square flow into TallyPrime as vouchers, customers are synced as ledger entries, and inventory adjustments from Square update your TallyPrime stock. ml-connector bridges the gap between Square's cloud REST API and TallyPrime's local server, running a lightweight agent on your network to poll both systems and move data without manual re-entry.

How TallyPrime works

TallyPrime is a desktop accounting application that exposes ledgers, groups, vouchers, and stock items through XML and JSON over HTTP POST to a local server on port 9000. Authentication relies on network-level security (firewall or VPN), company name, and optional credentials. The application must be running with the target company open for API calls to succeed. TallyPrime has no native webhooks, so data is read by polling with date-range filters, and the local HTTP server requires manual enablement in TallyPrime Settings. Concurrent requests are not safe, so polling must be sequential.

How Square works

Square exposes payments, invoices, orders, customers, inventory, vendors, and catalog data through a versioned REST API secured with OAuth 2.0 bearer tokens that expire in 30 days. Square supports both push webhooks (payment.created, payment.updated, order.created, order.updated, customer.created, customer.updated, inventory.count.updated) and pull API calls for transaction history. Webhook signatures are verified via HMAC-SHA256. Square is commerce-layer only, with no general ledger or chart of accounts API, so financial data must be mapped to TallyPrime's accounting structure. Inventory can be adjusted but not created directly via the API.

What moves between them

Sales transactions and customer data flow primarily from Square into TallyPrime. ml-connector reads Square payments and orders via REST API or webhooks, maps them to TallyPrime sales vouchers and customer ledgers aligned with your TallyPrime groups and items, and imports them using the SVCURRENTCOMPANY context. Customer records created in Square are synced as new ledger entries in TallyPrime. Inventory counts from Square adjustments can be reflected in TallyPrime stock items using ALTERID operations. The flow is push-capable via Square webhooks but falls back to polling on a schedule you configure, with the local agent bridging the network gap.

How ml-connector handles it

ml-connector runs a local agent that connects to TallyPrime's port 9000 and speaks to Square's REST API via your OAuth tokens. When Square webhooks are enabled, ml-connector receives payment and order notifications and queues them for import; when webhooks are unavailable, it polls Square's transaction history on your chosen interval and compares against the last-seen state to detect new sales. For each transaction, it extracts the customer, line items, and amounts, maps them to TallyPrime group and item masters (by name or code), and imports a corresponding voucher via the TALLYREQUEST Import Data envelope with SVCURRENTCOMPANY set to your active company. Customer records are synced as new Ledger entries in TallyPrime's customer group. The agent handles Square's 30-day token expiry by refreshing the Bearer token before each call, retries Square API errors with exponential backoff, and maintains an audit trail of every import. TallyPrime's lack of native idempotency is handled by tracking imported voucher IDs to prevent duplicates on retry. All dates are converted to YYYYMMDD format for TallyPrime. Sequential request handling ensures TallyPrime's single-user architecture is respected.

A real-world example

A small retail shop in India runs Square for point-of-sale payments and online orders, and TallyPrime for daily accounting and GST filing. Before the integration, the shop owner manually exported sales from Square each day and re-entered each transaction into TallyPrime as a sales voucher by hand, which took 30 minutes and introduced typos that broke the books. With TallyPrime and Square connected via ml-connector, each sale in Square automatically becomes a voucher in TallyPrime the same day, mapped to the correct customer and item groups, so the books are always current and accurate for daily reconciliation and month-end GST preparation.

What you can do

  • Sync Square payments and orders into TallyPrime as sales vouchers, mapped to your TallyPrime groups and items.
  • Keep TallyPrime customer ledgers in sync with Square customer records, creating new ledger entries for new customers.
  • Handle Square's OAuth 2.0 30-day token expiry with automatic refresh, ensuring continuous sync without manual intervention.
  • Run a local agent that bridges TallyPrime's local port 9000 to Square's cloud REST API, with sequential request handling to respect TallyPrime's single-user design.
  • Support both Square webhooks for real-time notifications and polling-based sync when webhooks are unavailable, with duplicate-prevention via imported transaction tracking.

Questions

Does the integration require Square webhooks, or can it work with polling alone?
ml-connector can work with either. If you register the webhook endpoint with Square, it will receive real-time payment and order notifications. If webhooks are not available or disabled, ml-connector falls back to polling Square's transaction history on a schedule you set, comparing each poll to the last-seen transaction state to detect new sales. Polling is the fallback and works reliably without webhook setup.
How does ml-connector handle TallyPrime running on a local machine behind a firewall?
ml-connector runs a lightweight local agent on the same network as TallyPrime that connects to port 9000 directly. The agent bridges TallyPrime's local server to Square's cloud API, so no inbound firewall rule is needed. The agent requires TallyPrime to be running with the target company open, and the HTTP server must be manually enabled in TallyPrime Advanced Configuration.
What happens if a Square customer or product code does not have a match in TallyPrime?
ml-connector requires a mapping between Square customers and TallyPrime ledger group names, and between Square items and TallyPrime stock items, configured during setup. If a Square customer or item has no mapping, the import fails for that transaction and is logged in the audit trail for review. You can then create the missing ledger or item in TallyPrime, add the mapping, and rerun the import.

Related integrations

Connect TallyPrime and Square

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started