The Purple Turtles, a retailer that sells curated lighting and living products around India wanted to streamline inventory management they manage in Tally ERP after they opened more retails stores around Bangalore.
Many of their products are made in small numbers, some even one-off pieces and their challenge was when a customer bought the last of an item in stock offline, their Shopify website would show it is available online. This led to a race-condition which resulted in lot of cancelled orders even though they manually updated items’ stock multiple times a day.
Clarity was requested to solve this problem but we did not anticipate the scale of the task ahead. The Purple Turtles uses Tally ERP for their inventory management system.
Challenges with a primitive API
Tally ERP is a desktop accounting software used by millions of businesses for many years. Most ERPs these days have an API that can be accessed easily online, authenticated and well documented. We took a while researching this and found some useful information on their pdf documents.
Tally ERP has an XML based API accessible via a local port, most commonly, 9000. We need to send a request in a certain format and Tally send us an XML in return. This server was not accessible over the internet and we had to use our previous experience in building custom windows applications to come with a solution.
We built a Windows Service executable using Dotnet 3.1(now upgraded to Dotnet 6) which is installed on the same server as the Tally that periodically requests for a Tally ERP Stock Summary report, send this XML to our internet-hosted server, parses 400,000 lines of this and updates the product variant inventories in Shopify, every 5 minutes
They also wanted only stock from certain godowns to be accounted for in the Shopify store. Our team took a while because the XML report was a non-standard XML format and parsing it was a challenge but we finally managed to get it right.