Corneliu Posted September 20, 2011 Share Posted September 20, 2011 Hi, We try to get data through the WHMCS REST API from multiple WHMCS servers. The call to GetInvoice on some of them returns the (line)item amounts including tax while on others it returns it excluding tax. Here are two samples from two servers. They both run the same WHMCS version 4.5.2: 1. Subtotal = sum of Item Amounts (13.50+25.00=38.50) Clearly no tax is applied on the line item. Applying tax brings the total to 42.35 <?xml version="1.0" encoding="iso-8859-1"?> <whmcsapi version="4.5.2"> <action>getinvoice</action> <result>success</result> <invoiceid>91001399</invoiceid> <invoicenum>0910369</invoicenum> <subtotal>38.50</subtotal> <credit>0.00</credit> <tax>3.85</tax> <tax2>0.00</tax2> <total>42.35</total> <balance>0.00</balance> <taxrate>10.00</taxrate> <taxrate2>0.00</taxrate2> <status>Paid</status> <items> <item> <id>1069</id> <type>DomainRegister</type> <relid>261</relid> <description>.....</description> <amount>13.50</amount> <taxed>1</taxed> </item> <item> <id>1070</id> <type>DomainRegister</type> <relid>262</relid> <description>...</description> <amount>25.00</amount> <taxed>1</taxed> </item> </items> </whmcsapi> 2. Line Items Amounts all include the tax amount: 100.00+100.00+100.00-68.18 = 231.82 Subtotal is 210.75 so clearly the sum of the line items includes the tax this time. <?xml version="1.0" encoding="utf-8"?> <whmcsapi version="4.5.2"> <action>getinvoice</action> <result>success</result> <invoiceid>3452</invoiceid> <invoicenum></invoicenum> <subtotal>210.75</subtotal> <credit>0.00</credit> <tax>21.07</tax> <tax2>0.00</tax2> <total>231.82</total> <balance>231.82</balance> <taxrate>10.00</taxrate> <taxrate2>0.00</taxrate2> <items> <item> <id>1334</id> <type>Addon</type> <relid>37</relid> <description>...</description> <amount>100.00</amount> <taxed>1</taxed> </item> <item> <id>1335</id> <type>Addon</type> <relid>39</relid> <description>...</description> <amount>100.00</amount> <taxed>1</taxed> </item> <item> <id>1336</id> <type>Addon</type> <relid>38</relid> <description>...</description> <amount>100.00</amount> <taxed>1</taxed> </item> <item> <id>1337</id> <type>GroupDiscount</type> <relid>0</relid> <description>...</description> <amount>-68.18</amount> <taxed>1</taxed> </item> </items> </whmcsapi> Any idea why we get different results from different servers? Is this an option somewhere that has to be turned on/off? Is it possible to get a consistent result from this API? Thanks, Corneliu. 0 Quote Link to comment Share on other sites More sharing options...
Corneliu Posted October 3, 2011 Author Share Posted October 3, 2011 Hello, Anyone from @support willing to answer this or should I just drop it in the "we don't support you bucket"? Thanks, Corneliu 0 Quote Link to comment Share on other sites More sharing options...
D9Hosting Posted October 3, 2011 Share Posted October 3, 2011 Hello, Anyone from @support willing to answer this or should I just drop it in the "we don't support you bucket"? Thanks, Corneliu The forum is for peer to peer support, if you drop them (WHMCS) a ticket I'm sure you'll get an answer through that. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.