ml-connector
TallyPrimeSPS Commerce

TallyPrime and SPS Commerce integration

TallyPrime runs accounting and inventory in India and Southeast Asia. SPS Commerce networks suppliers with retail trading partners and exposes purchase orders and invoices via REST APIs. Connecting them lets you send TallyPrime invoices to retail partners on the SPS network without re-entering line items or payment terms. TallyPrime's local-only XML API and SPS's OAuth2 REST API sit on opposite sides of a cloud boundary, and ml-connector bridges both.

How TallyPrime works

TallyPrime exposes ledgers, groups, vouchers (sales, purchase, payment, receipt, purchase orders), and stock items through XML or JSON over HTTP POST to http://<tally-host-ip>:9000. Port 9000 must be manually enabled in TallyPrime Settings. Authentication is company-level within the envelope request, with optional username and password if the company is password-protected. The server is LAN-only with no public IP, so a local agent on the same network must bridge cloud calls to it. TallyPrime has no webhooks, so data is read by polling Export requests with date range filters and comparing returned IDs against previously seen records. The application must be running and the target company open for requests to succeed. Dates must be in YYYYMMDD format.

How SPS Commerce works

SPS Commerce exposes purchase orders, invoices, advance ship notices, inventory advice, and warehouse documents through REST APIs at https://api.spscommerce.com, all wrapped in RSX 7.7.7 JSON envelope format. Authentication is OAuth2 client credentials with a JWT bearer token obtained from https://api.spscommerce.net/authorization/v1/token. Polling is the primary sync pattern via /fulfillment/v1/purchaseorders at configurable intervals. Documents are not discoverable raw; they arrive wrapped in RSX envelopes with the document type and trading partner ID embedded. Rate limits are not publicly documented but SPS recommends exponential backoff and jitter on HTTP 429 responses. Idempotency is application-layer, keyed on document identifiers like invoiceNumber or purchaseOrderNumber.

What moves between them

Sales invoices flow from TallyPrime to SPS Commerce. ml-connector polls TallyPrime's Export endpoint on a configurable schedule (typically 5-15 minutes), filters for Sales Vouchers by date range, and maps each voucher into an EDI 810 invoice record. Each 810 is wrapped in the RSX 7.7.7 JSON envelope with the trading partner ID, then posted to SPS via REST. TallyPrime Ledger accounts and Stock Items become EDI line items with quantities, rates, and GST/tax allocations. The flow is outbound only; purchase orders from SPS are not written back into TallyPrime.

How ml-connector handles it

ml-connector runs a local agent on the same LAN as TallyPrime to reach port 9000. It stores the TallyPrime host IP, port, company name, and optional credentials (username, password) encrypted, then constructs XML TALLYREQUEST Export Data envelopes with SVFROMDATE and SVTODATE filters to poll for new sales vouchers. Each returned voucher is mapped to EDI 810 fields: ledger names become ship-to and bill-to details, stock items become invoice line items with quantity and unit price, and GST amounts are mapped to tax blocks. ml-connector obtains an SPS OAuth2 bearer token before each batch of posts, wraps each 810 in the RSX 7.7.7 envelope with the trading partner ID (provisioned during SPS onboarding), and POSTs to the SPS fulfillment endpoint. Duplicate vouchers are prevented by tracking the highest TallyPrime voucher ID seen; SPS deduplication is application-layer on invoiceNumber. If SPS returns HTTP 429, ml-connector backs off with exponential jitter and retries. All records carry a full audit trail and can be replayed if a downstream call fails.

A real-world example

A mid-sized textile distributor in India runs TallyPrime for invoicing and GST compliance and supplies retail chains like Flipkart and Big Bazaar through the SPS Commerce network. Before integration, the operations team exported invoices from TallyPrime as PDF or CSV every afternoon, reformatted them for SPS's EDI 810 format and RSX envelope, and manually uploaded them to the SPS portal, a process that took 30-45 minutes per day and created gaps when staff was absent. With TallyPrime and SPS Commerce connected, invoices are automatically pushed to the SPS network within minutes of being finalized in TallyPrime, GST amounts are correctly allocated to tax blocks, and retail partners receive documents on time. The operations team spends no time on manual uploads, and compliance audits are cleaner because all posted invoices are recorded in both systems.

What you can do

  • Poll TallyPrime for sales invoices and map them to EDI 810 documents for retail trading partners on the SPS network.
  • Bridge TallyPrime's LAN-only port 9000 to SPS's cloud REST endpoints with a local agent.
  • Wrap each invoice in SPS's RSX 7.7.7 JSON envelope format with the correct trading partner ID.
  • Map TallyPrime ledger accounts, stock items, and GST amounts to EDI fields without manual re-entry.
  • Obtain and refresh SPS OAuth2 bearer tokens, handle rate limiting, and maintain a full audit trail for every invoice posted.

Questions

How does the integration bridge TallyPrime's LAN-only port 9000 to SPS's cloud API?
ml-connector runs a local agent on the same network as TallyPrime to reach port 9000 directly. The agent polls TallyPrime's Export endpoint for sales vouchers, transforms them to EDI 810 format, then connects to SPS's cloud REST API from that agent to post the formatted invoices. The agent handles the network boundary between TallyPrime's local-only server and SPS's cloud infrastructure.
What happens if TallyPrime's application is not running when ml-connector polls?
Polling requests will fail until TallyPrime is running and the target company is open. ml-connector retries failed polls with exponential backoff and jitter, so temporary application downtime does not cause data loss. Alerts can be configured to notify you if polling repeatedly fails.
How are GST and tax amounts handled in the EDI 810 document?
TallyPrime vouchers include GST allocations by ledger. ml-connector maps these ledger-level tax amounts to the RSX envelope's tax blocks and line-item tax references, preserving GST compliance for regulatory reporting. The 810 document is then wrapped with all tax details intact for the retail partner to receive complete invoice information.

Related integrations

Connect TallyPrime and SPS Commerce

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

Get started