Case Study I – XML Request and Response Formats
Let us consider different scenarios to understand the Request and Response XML structure.
- Export
- Request to Export Data and Corresponding response
- Request to Export different TDL components and the corresponding response
- Import
- Request to Import Data and the corresponding response Execute
- Request to Execute Action and Corresponding response
Export
Request to Export Data and Corresponding Response
Tags used for sending a request to export data from TallyPrime<HEADER> contains the following:
- Tag < TALLYREQUEST > must contain value Export
- Tag < TYPE > must contain value Data and
- Tag < ID > should contain the Name of the TDL Report
< BODY > contains the following:
- Tag < DESC > can contain report settings like Company Name, Format, etc. as desired which should be enclosed within < STATICVARIABLES > tag.
- If the Report Name specified in the <ID> tag does not exist within Tally running at the spec-ified port, the TDL defining the Report & other supporting definition needs to be described and enclosed within tag <TDL>.
Request for a detailed Trial Balance in XML Format from Tally
- Where Report exists in Tally
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Trial Balance</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<EXPLODEFLAG>Yes</EXPLODEFLAG>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
</DESC>
</BODY>
</ENVELOPE>
In the above XML request, < HEADER > describes the expected result.
- The value of the Tag < TALLYREQUEST > is Export which indicates that some information needs to be exported from Tally.
- The value of the Tag < TYPE > is Data which indicates that the data needs to be exported from Tally.
- The value of the Tag < ID > must be a TDL Report Name, if the previous Tag <TYPE> contains Data and Tag < TALLYREQUEST > contains Export. Any Report which needs to be exported from Tally can be specified within this Tag.
< BODY > tag contains parameters, if any. Additional settings for the report like format required, company from which data is required, etc. can be passed within < STATICVARIABLES > Tag enclosed within < DESC > Tag. All variables are considered as Tag Names and their value are enclosed within these tags. For example , in the above XML, variables SVEXPORTFORMAT and EXPLODEFLAG are considered as Tags and their respective values $$SysName:XML and Yes are enclosed within. TDL Internal Function SysName is evaluated at Tally end and the response is being sent accordingly.
XML Response received is as shown:
<ENVELOPE>
<DSPACCNAME>
<DSPDISPNAME>Capital Account</DSPDISPNAME>
</DSPACCNAME>
<DSPACCINFO>
<DSPCLDRAMT>
<DSPCLDRAMTA></DSPCLDRAMTA>
</DSPCLDRAMT>
<DSPCLCRAMT>
<DSPCLCRAMTA>100000.00</DSPCLCRAMTA>
</DSPCLCRAMT>
</DSPACCINFO>
</DSPACCNAME>
<DSPACCINFO>
<DSPCLDRAMT>
<DSPCLDRAMTA>-100000.00</DSPCLDRAMTA>
</DSPCLDRAMT>
<DSPCLCRAMT>
<DSPCLCRAMTA></DSPCLCRAMTA>
</DSPCLCRAMT>
</DSPACCINFO>
.
.
.
</ENVELOPE>
Note: Apart from XML,< SVEXPORTFORMAT >Tag can contain the values $$SysName:HTML, $$SysName:ASCII, $$SysName:SDF and BinaryXML.
- Where Report do not exist in Tally
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Simple Trial balance</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<EXPLODEFLAG>Yes</EXPLODEFLAG> <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<REPORT NAME=”Simple Trial balance”> <FORMS>Simple Trial balance</FORMS> <TITLE>”Trial Balance”</TITLE></REPORT>
<FORM NAME=”Simple Trial balance”> <TOPPARTS>Simple TB Part</TOPPARTS> <HEIGHT>100% Page</HEIGHT> <WIDTH>100% Page</WIDTH></FORM>
<PART NAME=”Simple TB Part”><TOPLINES>Simple TB Title,Simple TB Details</TOPLINES> <REPEAT>
Simple TB Details : Simple TB Ledgers </REPEAT>
<SCROLLED>Vertical</SCROLLED> <COMMONBORDERS>Yes</COMMONBORDERS></PART>
<LINE NAME=”Simple TB Title”> <USE>Simple TB Details</USE> <LOCAL>Field : Default : Type : String </LOCAL>
<LOCAL>Field : Default : Align : Centre </LOCAL>
<LOCAL>Field : Simple TB Name Field : Set as: “Particulars” </LOCAL>
<LOCAL>Field : Simple TB Amount Field: Set as: “Amount” </LOCAL>
<BORDER>Flush Totals</BORDER> </LINE>
<LINE NAME=”Simple TB Details”><LEFTFIELDS>Simple TB Name Field</LEFTFIELDS>
<RIGHTFIELDS>Simple TB Amount Field</RIGHTFIELDS></LINE>
<FIELD NAME=”Simple TB Name Field”><USE>Name Field</USE> <SET>$Name</SET></FIELD>
<FIELD NAME=”Simple TB Amount Field”><USE>Amount Field</USE> <SET>$ClosingBalance</SET> <BORDER>Thin Left</BORDER></FIELD>
<COLLECTION NAME=”Simple TB Ledgers”><TYPE>Ledger</TYPE><FILTERS>NoProfitsimple</FILTERS></COLLECTION>
<SYSTEM TYPE=”Formulae” NAME=”NoProfitSimple”> NOT $$IsLedgerProfit</SYSTEM>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
<TDL>
<TDLMESSAGE>
<OBJECT NAME=”Ledger” ISINITIALIZE=”Yes”>
<LOCALFORMULA> TNetBalance: $$AsPositive: $$AmountSubtract:$ClosingBalance: $OpeningBalance </LOCALFORMULA>
</OBJECT>
</TDLMESSAGE>
</TDL>
The above XML Request is similar to the previous Trial Balance Report request. The difference is the Report Name contained within the <ID> Tag is not defined in Tally.
In the <BODY> Tag within < DESC > Tag, an additional tag < TDL > must be specified with the TDL describing the Report and its components enclosed within Tag < TDLMESSAGE >.
XML Response received is as shown:
<ENVELOPE>
<SIMPLETBNAMEFIELD>Bank of India</SIMPLETBNAMEFIELD>
<SIMPLETBAMOUNTFIELD>351265.00</SIMPLETBAMOUNTFIELD>
<SIMPLETBNAMEFIELD>Cash</SIMPLETBNAMEFIELD>
<SIMPLETBAMOUNTFIELD>-147600.00</SIMPLETBAMOUNTFIELD>
<SIMPLETBNAMEFIELD>Conveyance</SIMPLETBNAMEFIELD>
<SIMPLETBAMOUNTFIELD>-157665.00</SIMPLETBAMOUNTFIELD>
‘
‘
</ENVELOPE>
In the above XML request, <HEADER> describes the expected result.
- The value of the Tag < TALLYREQUEST > is Export which indicates that some information needs to be exported from Tally.
- The value of the Tag < TYPE > is Object which indicates that information pertaining to some Object needs to be exported from Tally.
- The value of the Tag < SUBTYPE > is Ledger which indicates that Ledger Object info needs to be exported from Tally.
- The value of the Tag < ID > must contain the Ledger Identifier which is the name of the ledger.
- The < BODY > Tag contains description within <DESC> Tag which requires all info pertaining to the Object required.
XML Response received is as shown:
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<STATUS>1</STATUS>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<TALLYMESSAGE>
<LEDGER NAME=”ABC India Pvt. Ltd.” RESERVEDNAME=””>
<NAME.LIST TYPE=”String”><NAME TYPE=”String”>ABC India Pvt. Ltd.</NAME><NAME/></NAME.LIST>
<RESERVEDNAME TYPE=”String”></RESERVEDNAME>
<LEDGERPHONE TYPE=”String”>9940421583</LEDGERPHONE>
<TNETBALANCE TYPE=”Amount”>-13240.00</TNETBALANCE>
</LEDGER>
</TALLYMESSAGE>
</DATA>
</BODY>
</ENVELOPE>
Request to Export different TDL components & Corresponding Response
The different TDL components used for exporting are:
- Object
- Collection
- Function
Request to Export Object & Corresponding Response
For sending a request to export an Object Info from Tally,<HEADER> contains the following
- Tag <TALLYREQUEST> must contain value Export
- Tag <TYPE> must contain value Object
- Tag <SUBTYPE> must contain the Type of Object and
- Tag <ID> should contain the Object Identifier
<BODY> contains the following within <DESC> Tag
- Settings like Company Name, Format to be exported, etc. as desired enclosed within <STATICVARIABLES> Tag.
- Methods that need to be retrieved within the <FETCHLIST> Tag under each <FETCH> Tag.
- External Methods, if any, must be specified within <LOCAL FORMULA> Tag enclosed within <OBJECT> Tag.
- Above Local Formula, if dependent on any Local or Global Formula needs to be specified
Request for an Object info in XML Format from TallyPrime
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>OBJECT</TYPE> <SUBTYPE>Ledger</SUBTYPE> <ID TYPE=”Name”>ABC India Pvt. Ltd. </ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES><SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT></STATICVARIABLES>
<FETCHLIST>
<FETCH>Name</FETCH>
<FETCH>TNetBalance</FETCH>
<FETCH>LedgerPhone</FETCH>
</FETCHLIST>
<TDL>
<TDLMESSAGE>
<OBJECT NAME=”Ledger” ISINITIALIZE=”Yes”>
<LOCALFORMULA>
TNetBalance: $$AsPositive: $$AmountSubtract: $ClosingBalance: $OpeningBalance
</LOCALFORMULA>
</OBJECT>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
The above response has been received based on the XML request specified. The required detail of the Ledger “ABC India Pvt Ltd” i.e., Phone No, Contact, Opening, Closing has been sent from Tally.
Request to Export Collection & Corresponding Response
For sending a request to export Collection data from Tally, <HEADER> contains the following
- Tag < TALLYREQUEST > must contain value Export
- Tag < TYPE > must contain value Collection
- Tag < ID > should contain the Collection Name which is being described within the <DESC> Tag
<BODY> contains the following within <DESC> Tag
- Tag < DESC > can contain settings like Company Name, Format, etc. as desired which should be enclosed within < STATICVARIABLES > tag.
- Collection declared within the < HEADER > tag < TYPE > must be defined within < TDLMESSAGE > tag under < TDL > tag.
- All the TDL Collection Attributes must be specified as tags and their respective values within the relevant tag.
Where Collection exists in Tally
Request for Collection Data in XML Format from TallyPrime.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>COLLECTION</TYPE>
<ID>Remote Ledger Coll</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<COLLECTION NAME=”Remote Ledger Coll”
ISINITIALIZE=”Yes”>
<TYPE>Ledger</TYPE>
<NATIVEMETHOD>Name</NATIVEMETHOD>
<NATIVEMETHOD>OpeningBalance
</NATIVEMETHOD>
</COLLECTION>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
In the above XML request, <HEADER> describes the expected result.
- The value of the Tag < TALLYREQUEST > is Export which indicates that some information needs to be exported from Tally.
- The value of the Tag < TYPE > is Collection which indicates that information pertaining to Collection needs to be exported from Tally.
- The value of the Tag < ID > must contain the Collection Name which is defined available Tally.
Response in XML – Collection data in XML Format
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<STATUS>1</STATUS>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<STOCKITEM NAME=”Item” RESERVEDNAME=””>
<LANGUAGENAME.LIST>
<NAME.LIST TYPE=”String”>
<NAME>Item</NAME>
</NAME.LIST>
<LANGUAGEID TYPE=”Number”> 1033</LANGUAGEID>
</LANGUAGENAME.LIST>
</STOCKITEM>
</COLLECTION>
</DATA
</BODY>
</ENVELOPE>
Where Collection does not exist in Tally
In such case, Collection Tag must be defined along with their attributes as sub tags inside the Body Tag enclosed within TDL Message Tag. Request for Collection Data in XML Format from TallyPrime
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>COLLECTION</TYPE>
<ID>Remote Ledger Coll</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<COLLECTION NAME=”Remote Ledger Coll” ISINITIALIZE=”Yes”>
<TYPE>Ledger</TYPE>
<NATIVEMETHOD>Name</NATIVEMETHOD>
<NATIVEMETHOD>OpeningBalance</NATIVEMETHOD>
</COLLECTION>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
In the above XML request, <HEADER> describes the expected result.
- The value of the Tag <TALLYREQUEST> is Export which indicates that some information needs to be exported from Tally.
- The value of the Tag <TYPE> is Collection which indicates that information pertaining to Collection needs to be exported from Tally.
- The value of the Tag <ID> must contain the Collection Name which is defined below in <TDLMESSAGE> Tag within <DESC> Tag under the Tag <BODY>.
Response XML Fragment for the above :
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<STATUS>1</STATUS>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<COLLECTION>
<LEDGER NAME=”ABC India Pvt. Ltd.” RESERVEDNAME=””>
<OPENINGBALANCE TYPE=”Amount”> 5000.00 </OPENINGBALANCE>
<LANGUAGENAME.LIST>
<NAME.LIST TYPE=”String”>
<NAME>ABC India Pvt. Ltd.</NAME>
</NAME.LIST>
<LANGUAGEID TYPE=”Number”> 1033</LANGUAGEID>
</LANGUAGENAME.LIST>
</LEDGER>
<LEDGER NAME=”XYZ Loan A/c” RESERVEDNAME=””>
<OPENINGBALANCE TYPE=”Amount”> 0.00
</OPENINGBALANCE>
<LANGUAGENAME.LIST>
<NAME.LIST TYPE=”String”>
<NAME>XYZ Loan A/c</NAME>
</NAME.LIST>
<LANGUAGEID TYPE=”Number”> 1033</LANGUAGEID>
</LANGUAGENAME.LIST>
</LEDGER>
<LEDGER NAME=”Accum. Dep. on Airconditioner” RESERVEDNAME=””>
<OPENINGBALANCE TYPE=”Amount”>0.00</OPENINGBALANCE>
<LANGUAGENAME.LIST>
<NAME.LIST TYPE=”String”>
<NAME>Accum. Dep. on Airconditioner</NAME>
</NAME.LIST>
<LANGUAGEID TYPE=”Number”> 1033</LANGUAGEID>
</LANGUAGENAME.LIST>
</LEDGER>
</COLLECTION>
</DATA>
</BODY>
</ENVELOPE>
The above response has been received based on the XML request specified. All the Ledgers with the required Methods i.e., Name and Opening Balance are sent from Tally.
Request To Export Function & Corresponding Response
For sending a request to evaluate the result of Function from TallyPrime < HEADER > contains the following
- Tag < TALLYREQUEST > must contain value Export
- Tag < TYPE > must contain value Function
- Tag < ID > should contain the Function which is being described within the <DESC> Tag within the Tag < BODY >
- < BODY > contains the following:
- Tag < DESC > can contain settings like Company Name, Format, etc. as desired which should be enclosed within < STATICVARIABLES > Tag.
Request for evaluating function in Tally without parameter
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>FUNCTION</TYPE>
<ID>$$NumStockItems</ID>
</HEADER>
<BODY>
<DESC>
</DESC>
</BODY>
</ENVELOPE>
In the above XML request, <HEADER> describes the expected result.
- The value of the Tag < TALLYREQUEST > is Export which indicates that some information needs to be exported from Tally.
- The value of the Tag < TYPE > is Function which indicates that some Function needs to be evaluated within Tally and some value is returned as a response in XML.
- The value of the Tag < ID > must contain the Function Name prefixed with $$ since Function in TDL is activated by $$.
Response XML Fragment for the above would be
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<STATUS>1</STATUS>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<RESULT TYPE=”Number”>33</RESULT>
</DATA>
</BODY>
</ENVELOPE>
Request for evaluating function with Parameters in Tally
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>FUNCTION</TYPE>
<ID>$$Round</ID>
</HEADER>
<BODY>
<DESC>
<FUNCPARAMLIST>
<PARAM>@@FirstParameter</PARAM>
<PARAM TYPE=”Number”>0.10</PARAM>
</FUNCPARAMLIST>
<TDL>
<TDLMESSAGE>
<SYSTEM TYPE=”Formulae” NAME=”FirstParameter”> 1242849 / 1000 </SYSTEM>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
The above XML request is similar to the previous request except for this Function evaluation request needs Parameters to be specified.
- All the Parameters must be specified within the Tag <FUNCPARAMLIST> in the <DESC> Tag under <BODY> Tag.
- Each parameter must be enclosed within <PARAM> Tag.
- Parameters must follow exactly in the order required by the Function which is specified in the <ID> Tag.
- Dependency, if any i.e., Global/System Formula must be defined with <TDLMESSAGE> Tag under Tag <TDL>.
Response XML Fragment for the above would be:
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<STATUS>1</STATUS>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<RESULT TYPE=”Number”>1242.80</RESULT>
</DATA>
</BODY>
</ENVELOPE>
The above response has been generated from Tally based on the request specified. <DATA> Tag contains the <RESULT> Tag which holds the result after function evaluation.
Import
Request to Import Data and Corresponding Response
Tally can import data objects either in the form of a Master or Voucher. <HEADER> contains the following:
- Tag < TALLYREQUEST > must contain value Import
- Tag < TYPE > must contain value Data and
- Tag < ID > should contain the Import TDL Report i.e., either All Masters or Vouchers.
<BODY> contains the following
- Tag <DESC> can contain report settings like Company Name, behavior of Import in case of duplicates found; as desired which should be enclosed within <STATICVARIABLES> Tag.
- Tag <DATA> must contain the XML Data Fragment within Tag <TALLYMESSAGE> that needs to be imported
Request for importing Master data in Tally
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Import</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>All Masters</ID
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<IMPORTDUPS>@@DUPCOMBINE</IMPORTDUPS>
</STATICVARIABLES>
</DESC>
<DATA>
<TALLYMESSAGE>
<LEDGER NAME=”ICICI” Action = “Create”>
<NAME>ICICI</NAME>
<PARENT>Bank Accounts</PARENT>
<OPENINGBALANCE>-12500</OPENINGBALANCE>
</LEDGER>
<GROUP NAME=” Bangalore Debtors” Action = “Create”>
<NAME>Bangalore Debtors</NAME>
<PARENT>Sundry Debtors</PARENT>
</GROUP>
<LEDGER NAME=”RK Builders Pvt Ltd” Action = “Create”>
<NAME>RK Builders Pvt Ltd</NAME>
<PARENT>Bangalore Debtors</PARENT>
<OPENINGBALANCE>-1000</OPENINGBALANCE>
</LEDGER>
</TALLYMESSAGE>
</DATA>
</BODY>
</ENVELOPE>
In the above XML Request, Create action is used. Any of the following system formulae can be used to choose the required behaviour in case the system encounters a ledger with the same name. The behavior is for the treatment of the Opening Balance which is being imported. DupModify specifies that the current Opening Balance should be modified with the new one that is being imported.
DupIgnoreCombine specifies that the ledger if exists need to be ignored. DupCombine specifies the system to combine both the Opening Balances. Ideally, this option is used when Data pertaining to Group Companies are merged together into a single company. On processing the above request for importing ledgers, the requested ledgers are created in Tally and the following response is received:
<RESPONSE>
<CREATED>2</CREATED>
<ALTERED>0</ALTERED>
<LASTVCHID>0</LASTVCHID>
<LASTMID>0</LASTMID>
<COMBINED>0</COMBINED>
<IGNORED>0</IGNORED>
<ERRORS>0</ERRORS>
</RESPONSE>
The above XML Response is a log of masters created, altered, combined, ignored or not imported due to some errors. It also contains information pertaining to the last Master ID imported. For Alteration and Deletion of Masters, the Object action needs to be Alter or Delete respectively.
For instance, in the above example,
<LEDGER NAME=”ICICI” Action = “Alter”>
<NAME>HDFC</NAME>
Name of an existing ledger ICICI will get altered to HDFC. In case of Deletion, following line suffices
<LEDGER NAME=”ICICI” Action = “Delete”>
Request for importing Voucher in Tally (Voucher Creation)
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Import</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Vouchers</ID>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<TALLYMESSAGE>
<VOUCHER>
<DATE>20080402</DATE>
<NARRATION>Ch. No. Tested</NARRATION>
<VOUCHERTYPENAME>Payment</VOUCHERTYPENAME>
<VOUCHERNUMBER>1</VOUCHERNUMBER>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>Conveyance</LEDGERNAME>
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
<AMOUNT>-12000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>Bank of India</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>12000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
</VOUCHER>
<VOUCHER>
<DATE>20080402</DATE>
<NARRATION>Ch. No. : Tested</NARRATION>
<VOUCHERTYPENAME>Payment</VOUCHERTYPENAME>
<VOUCHERNUMBER>2</VOUCHERNUMBER>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>Conveyance</LEDGERNAME>
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
<AMOUNT>-5000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
<ALLLEDGERENTRIES.LIST>
<LEDGERNAME>Bank of India</LEDGERNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<AMOUNT>5000.00</AMOUNT>
</ALLLEDGERENTRIES.LIST>
</VOUCHER>
</TALLYMESSAGE>
</DATA>
</BODY>
</ENVELOPE>
On processing the above request for importing vouchers, the requested vouchers are created in Tally and the following response is received:
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<STATUS>1</STATUS>
</HEADER>
<BODY>
<DATA>
<IMPORTRESULT>
<CREATED>2</CREATED>
<ALTERED>0</ALTERED>
<LASTVCHID>119</LASTVCHID>
<LASTMID>0</LASTMID>
<COMBINED>0</COMBINED>
<IGNORED>0</IGNORED>
<ERRORS>0</ERRORS>
</IMPORTRESULT>
</DATA>
</BODY>
</ENVELOPE>
The above XML Response is a log of vouchers created, altered, combined, ignored or not imported due to some errors. It also contains information pertaining to last Voucher ID imported.
Request for importing Voucher in Tally (Voucher Alteration)
In case of Voucher Alteration, Cancellation or Deletion, vital information required is the voucher identifier. Identification of Voucher can be direct Methods within Voucher Object. For example, Master ID, Voucher Number, Reference, Narration, etc. Specifying Voucher Date is mandatory.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Import</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Vouchers</ID>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<TALLYMESSAGE>
<VOUCHER DATE=”02-Apr-2008″ TAGNAME = “Voucher Number” TAGVALUE=”3″ Action=”Alter” VCHTYPE = “Sales”>
<DATE>20080402</DATE>
<NARRATION>Being Goods sold</NARRATION>
</VOUCHER>
</TALLYMESSAGE>
</DATA>
</BODY>
</ENVELOPE>
Request for importing Voucher in Tally (Voucher Cancellation)
Voucher cancellation is similar to above Voucher Alteration. For Voucher Cancellation, Action must be set to “Cancel”.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Import</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Vouchers</ID>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<TALLYMESSAGE>
<VOUCHER DATE=”02-Apr-2008″ TAGNAME = “Voucher Number” TAGVALUE=”3″ VCHTYPE = “Sales” ACTION=”Cancel”>
<NARRATION>
Being cancelled due to XYZ Reasons
</NARRATION>
</VOUCHER>
</TALLYMESSAGE>
</DATA>
</BODY>
</ENVELOPE>
Request for importing Voucher in Tally (Voucher Deletion)
Voucher Deletion is similar to above Voucher Alteration or Cancellation. For Voucher Deletion, Action must be set to “Delete”.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Import</TALLYREQUEST>
<TYPE>Data</TYPE>
<ID>Vouchers</ID>
</HEADER>
<BODY>
<DESC>
</DESC>
<DATA>
<TALLYMESSAGE>
<VOUCHER DATE=”02-Apr-2008″ TAGNAME = “Voucher Number” TAGVALUE=”3″ VCHTYPE = “Sales” ACTION=”Delete”>
</VOUCHER>
</TALLYMESSAGE>
</DATA>
</BODY>
</ENVELOPE>
Execute
Request to Execute Action & Corresponding Response
Tags used for sending a request to Execute an action from TallyPrime <HEADER> contains the following:
- Tag <TALLYREQUEST> must contain value Execute
- Tag <TYPE> must contain value TDLAction and
- Tag <ID> should contain the Name of the TDL Action
As of now only Sync action is introduced. For sync no parameters are required.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Execute</TALLYREQUEST>
<TYPE>TDLAction</TYPE>
<ID>Sync</ID>
</HEADER>
</ENVELOPE>
In the above XML request, <HEADER> describes the expected result.
- The value of the Tag <TALLYREQUEST> is Execute which indicates that some action needs to be executed in Tally.
- The value of the Tag <TYPE> is TDLAction which indicates that some TDLAction has to be executed in Tally.
- The value of the Tag <ID> must be a TDL Action Name. Any action which needs to be executed in Tally can be specified within this Tag.
Response XML Fragment for the above would be:
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<STATUS>1</STATUS>
</HEADER>
</ENVELOPE>
Ensure the following while executing the sync action: ♦ All synchronization setup has to be done at server end as well as client end ♦ Set the Option Enable ODBC server in Advanced configuration to Yes ♦ Pass the Request from the client end only