I was playing around a bit with Tally ERP software. I like it for its simplicity. This is from the perspective of a software developer who wants to integrate with Tally, and not as a user of Tally. I am not competent to talk about that.
My intention was to understand what it takes to integrate with Tally; write a piece of Java code to query for information from within Tally, and to update information within Tally. Decided to use their XML/HTTP interface to try this out.
In essence, these are the steps for that – first install the software, then configure it, and finally try the XML/HTTP interface to interact with it.
Install
- Download Tally. I tried the “Educational Version”.
- Double-click the installable to install it.
- Once you start Tally, create a default “Company” in it. Also enable the Payroll module, so that you can perform CRUD operations on Employee information.
- The documentation or a web search can help you with these steps, in case you falter.
Configure
- To initiate XML interaction over HTTP with Tally, the server port has to be enabled in Tally. Click on “Configurations” or F3-> “Advanced Configurations”, and then select the following options: I set the “Tally is acting as” to “Both”, and “Port” to “9002″. Save, and exit. Restart Tally.
- Open a browser, and enter http://localhost:9002 in the address bar. You should see a message “<RESPONSE>Tally.ERP 9 Server is Running</RESPONSE>”. Now you are good to go. Else, have a look at the documentation.
Integration using XML over HTTP
- Tally requires the client (the one which is integrating with Tally) to HTTP-POST XML documents. The XML documents contain the action to be performed, and details of the Tally Data on which this action needs to be performed.
- I searched for some sample XMLs with which I could experiment with this interaction. I came across some useful ones on the RTSLink site: http://www.rtslink.com/download-tally-xml-tags.html.
- Used cURL command line tool to try this out:
curl -X POST localhost:9002 --data @all_inventory_master.xml
- The structure of all_inventory_master.xml is as follows:
<ENVELOPE> <HEADER> <TALLYREQUEST>Export Data</TALLYREQUEST> </HEADER> <BODY> <EXPORTDATA> <REQUESTDESC> <REPORTNAME>List of Accounts</REPORTNAME> <STATICVARIABLES> <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT> <ACCOUNTTYPE>All Inventory Masters</ACCOUNTTYPE> </STATICVARIABLES> </REQUESTDESC> </EXPORTDATA> </BODY> </ENVELOPE>
- The next option was to insert an Employee’s information into Tally.
- curl -X POST localhost:9002 –data @payrollEnvelope.xml
- The structure of payrollEnvelope.xml is as follows:
<ENVELOPE> <HEADER> <TALLYREQUEST>Import Data</TALLYREQUEST> </HEADER> <BODY> <IMPORTDATA> <REQUESTDESC> <REPORTNAME>All Masters</REPORTNAME> <STATICVARIABLES> <SVCURRENTCOMPANY>MyCompany</SVCURRENTCOMPANY> </STATICVARIABLES> </REQUESTDESC> <REQUESTDATA> <TALLYMESSAGE xmlns:UDF="TallyUDF"> <COSTCENTRE NAME="ImportPSOFT" RESERVEDNAME=""> <ADDRESS.LIST TYPE="String"> <ADDRESS>Bangalore</ADDRESS> </ADDRESS.LIST> <MAILINGNAME.LIST TYPE="String"> <MAILINGNAME>10</MAILINGNAME> </MAILINGNAME.LIST> <CATEGORY>Primary Cost Category</CATEGORY> <LOCATION>Bangalore</LOCATION> <DESIGNATION>Software Engineer</DESIGNATION> <BLOODGROUP>O Positive</BLOODGROUP> <AFFECTSSTOCK>No</AFFECTSSTOCK> <FORPAYROLL>Yes</FORPAYROLL> <FORJOBCOSTING>No</FORJOBCOSTING> <ISEMPLOYEEGROUP>No</ISEMPLOYEEGROUP> <SORTPOSITION> 1000</SORTPOSITION> <DEFAULTLANGUAGE>0</DEFAULTLANGUAGE> <LANGUAGENAME.LIST> <NAME.LIST TYPE="String"> <NAME>Kiran Subbaraman</NAME> </NAME.LIST> <LANGUAGEID> 1033</LANGUAGEID> </LANGUAGENAME.LIST> </COSTCENTRE> </TALLYMESSAGE> </REQUESTDATA> </IMPORTDATA> </BODY> </ENVELOPE>
- This should insert a new employee record, in Tally.
References
Use this Tally Integration Guide (pdf) to better understand what goes into the various integration options that Tally supports.
Good luck, and let me know if this works for you.
Kishalay
30 July, 2010
Hi Kiran,
Good post. Very informative.
I am also playing with Tally integration via http interface. May be we can catch up and learn from each other. I am at kishalay.haldar@gmail.com
Have you tried to obtain list of all vouchers in a particular ledger? For example I want to retrieve all vouchers that have been passed in “Cash” ledger. I have been unsuccessful so far.
Cheers,
Kish
Kiran
5 August, 2010
Kishalay,
Thanks for stopping by. Well, am no expert with Tally, but this is something I tried:
curl -X POST localhost:9002 --data @allmasters.xmlwhere allmasters.xml contains the following:
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Export Data</TALLYREQUEST>
</HEADER>
<BODY>
<EXPORTDATA>
<REQUESTDESC>
<REPORTNAME>List of Accounts</REPORTNAME>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<ACCOUNTTYPE>All Masters</ACCOUNTTYPE>
</STATICVARIABLES>
</REQUESTDESC>
</EXPORTDATA>
</BODY>
</ENVELOPE>
curl -X POST localhost:9002 --data @ledger.xmlwhere ledger.xml contains this:
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Export Data</TALLYREQUEST>
</HEADER>
<BODY>
<EXPORTDATA>
<REQUESTDESC>
<REPORTNAME>List of Accounts</REPORTNAME>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<ACCOUNTTYPE>Ledgers</ACCOUNTTYPE>
</STATICVARIABLES>
</REQUESTDESC>
</EXPORTDATA>
</BODY>
</ENVELOPE>
Pratiek
5 September, 2010
Kiran: Thanks dude!!!
But can you help me on a very specific problem i want to export excel files in to tally. I dont want to purchase the tool need urgently please help.
Kiran
8 September, 2010
Pratiek, I do not have a mechanism to do this. I would explore the various excel munching libraries and write the code to extract/insert content from/to excel and Tally.
Good luck with your search.
Kishan
16 January, 2011
Kiran, very informative post.
I had dozens of xmls that I make from excel sheets and I had to keep re-import them via UI until I had no errors. You post helped me to batch script all this using curl – Thanks a looot!!
Pratiek – you can make Tally format xml file from excel sheets data.
Kishan
16 January, 2011
One addition – I could not import decent sized xml files – curl would not submit all data.
But I could import using wget:
wget –post-file all_data.xml localhost:9002
Kiran
17 January, 2011
Kishan,
Glad this helped you. And thanks for the wget tip – I hadn’t run into the curl-file-size issue.
Umesh Nayak
19 February, 2011
Hello,
I am from Give Foundation, a non-profit.
When I try to import data through XML, the data gets imported into Tally. However, when I push the SAME data into Tally through VBA using the command-
Dim tally_db As New MSXML2.ServerXMLHTTP30
tally_db.Open “POST”, “http://localhost:9000″, False
tally_db.send xml_string
I get error
Could not set ‘SVCurrentCompany’ to ‘Give Foundation -2010-2011 – (From 1-Apr-2010)’
The SAME data in the XML works and XML gets imported. I tried importing on educational version using XML over HTTP, it worked, but on server, it gave me the above error. In both cases, data was EXACTLY the same, company name was SAME.
Please help.
Regards,
Umesh
Kiran
19 February, 2011
Umesh,
As much as I would like to help you out with this one, I really have no idea as to what is causing this error.
A general web search yielded the trouble-shooting guide, where the explanations seem to be:
and
Maybe you have come across this already.
Good luck with your search for a solution.
Mike
9 March, 2011
Hello,
I was able to see only few sample XML formats to connect to Tally. Where can i find the complete API document?
Please help.
Thanks,
Mike
Kiran
14 March, 2011
Mike,
I am not sure if there is an API document for the Tally Http/XML support. Would be a useful resource to have.
In the meantime, I usually refer to the TDL document: http://www.tallysolutions.com/newwebsite/Downloads/TDL%20Developer/TDL%20Reference%20Manual.pdf
Satish Mike
10 March, 2011
Hello,
I was able to see only few sample XML formats to connect to Tally. Where can i find the complete API document?
Please help.
Thanks,
Mike
Patrick
8 April, 2011
Tally is very closed, very difficult to customize. Though Tally software itself offers customizations, it is clear those avenues are open for Tally and their ‘selected partners’ to take advantage of, to sell more software to customers and not really for developers to take advantage of these Tally features.
Google searching for Tally xml tags for a few days kept leading me to the 2-3 sites which were not useful at all. I couldn’t even find a proper list of basic xml tags to query Tally. All I find is desperate people crying out for help without any assistance given.
Emails to Tally Solutions have not yielded any satisfactory answers.
If Tally needs to reach a broader audience and fast, it will need to be more open, lay out more APIs, xml tags for downloads, more extensive sample codes.
Meanwhile, all the best to developers trying to extend Tally. If I get a breakthrough, I will definitely put it up in a website for everyone’s benefit and I urge fellow developers to do the same so we can all share and leverage the power of Tally.
Nilesh
30 April, 2011
Hi Kiran,
I have followed the steps that you have mentioned, but whatever xml I post, I get a constant static response as ‘Tally.ERP 9 Server is Running’
Did it happen to you ever, and know of a fix? Kindly Let me know.
Regards,
Nilesh
Kiran
30 April, 2011
Nilesh, I do not have a clue as to what the issue could be. I have not faced such an issue – you are sure the XML you are posting is well formed?
Nilesh
30 April, 2011
yea, Its exactly same as what you have, Just that I am using PHP to post it, curl library. Din’t mention it earlier coz I think it shouldn’t make any difference.
Nilesh
30 April, 2011
oh, seems to be an issuse with my PHP thing, works fine from console. Will get back to you if I need anything. Thanks
sithes
18 July, 2011
Hi, I’m to trying to post xml from PHP. I couldn’t get any response from Tally.
Kiran
18 July, 2011
Sithes,
Not sure what could be causing it; did you try with the curl tool? And also do the other verbs work for you – GET, HEAD, PUT, DELETE? I would check for all of that.
Jovish P
4 August, 2011
Kiran , can we use Tally XML Interface to integrate my application with Tally 9.1 ?
Kiran
5 August, 2011
Jovish,
The Tally XML interface is one integration option. I would recommend that you have a look at the Tally Integration documentation to better understand all the available integration options, and choose the one that Tally recommends AND fits your application’s requirements.
Jovish P
5 August, 2011
I gone through that document already , in that document they specified the version of Tally as Tally ERP 9. My doubt is can we use Tally XML interface and Tally ODBC interface for earlier versions of Tally? Where we can find the proper documentation for XML Tags that we are using to make the request ?
Kiran
6 August, 2011
Jovish, I don’t know the answer to that one. I would give it a try to see if it works. As for the documentation on the XML schemas, see one of my comments above
Jovish P
8 August, 2011
Thanks Kiran. I have one doubt regarding Tally Integration , is it possible to access data from Tally when it is closed?
Kiran
9 August, 2011
I guess not. Google has this for your question: possible to access data from Tally when it is closed?
Srinath
22 September, 2011
Guys, Has someone tried to export Pay Slip for an employee. We need to show PaySlip via the portal.
Pandian
13 October, 2011
Really very nice stuff.
Since I am not much aware of Curl let me know how to install and use Curl in my 32 bit Windows 7, If possible.
makpandian@gmail.com
Chaitanya
5 January, 2012
Hi Kiran, I am trying to run a jsp code which connects java code with tally using jdbc – “TallyODBC_9000″ DSN but stuck up at GENERAL EXCEPTION. I dont know how to go ahead as I cant even fetch couple of fields from Tally DB…here is my code,
Obtaining a Connection
This Page Obtains a Connection to with Tally and executes a query
<%
try {
out.println("” + “Not Yet Connected”);
Connection conn = DriverManager.getConnection(“jdbc:odbc:TallyODBC_9000″);
out.println(“” + “Connected”);
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery (“SELECT * FROM `TallyUser`.`Ledger`”);
if (rset.next()) {
%>
Name
Closing Balance
$
$
Sorry, the query returned no rows!
<%
}
rset.close();
stmt.close();
} catch (SQLException e) {
out.println("” + “There was an error doing the query:”);
out.println (“
\n “);
}
%>
Can you or anybody provide me few insights?