Jump to content

GetInvoice API call - does it have tax or no tax?


Corneliu

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated