LIST Current Tax Settings - GET /tax_settings.xml
You can retrieve current tax settings and tax rates using this GET /tax_settings.xml. Tax settings returns 2 settings and list of tax rates.
Tax Settings
FIELD NAME | DESCRIPTION |
compute_tax | indicates whether tax needs to be applied (default is false) |
tax_inclusive | indicates whether price already includes tax (default is false) |
Tax Rate Fields
FIELD NAME | DESCRIPTION |
id | unique id of the tax rate |
branch_id | if branch id is specified, it is applicable to only this branch, otherwise, applicable to branches. |
name | name of tax |
status | is nil if the tax rate is active, otherwise, it is "D" |
value | tax rate is express in decimal (0.1 means 10%) |
tax_rate_type | 0 - applicable to all products, 1 - applicable to selected products only |
The default tax rate will have no id, no branch_id and tax_rate_type of 0.
Example
curl -u 4acc660ce98b9d38d7fea10705aa1ebd7d836fe0:X \
-H "Accept: application/xml" \
-H "Content-Type: application/xml" \
"https://test_account.imonggo.com/api/tax_settings.xml"
Sample result
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<compute_tax type="boolean">true</compute_tax>
<tax_inclusive type="boolean">false</tax_inclusive>
<tax_rates type="array">
<tax_rate>
<branch_id nil="true"></branch_id>
<id nil="true"></id>
<name>Tax</name>
<status nil="true"></status>
<value>0.1</value>
<tax_rate_type>0</tax_rate_type>
</tax_rate>
</tax_rates>
</hash>
Tax Exemption
Any tax by default is applicable to all products, except if the product is tax exempt. The tax computation should also be ignored if a particular customer has tax_exempt set to true.
Product Specific Tax and Branch Specific Tax
If the a tax has tax_rate_type of 1, it is applicable to only selected products. When downloading products, the tax_rates array is returned if the items contains product specific tax.
A tax can be applied to only specific branch. In this case, the branch id will be specified. Please see the 3rd entry in the example below.
Example:
Example below shows the system is configured with multiple tax rates. It has two 3 rates.
The first one is VAT of 10% applicable to all items.
<tax_rate>
<branch_id nil="true"></branch_id>
<id>1</id>
<name>VAT</name>
<status nil="true"></status>
<value>0.1</value>
<tax_rate_type>0</tax_rate_type>
</tax_rate>
While the second is the alcohol tax of 5% applicable to only selected items.
<tax_rate>
<branch_id nil="true"></branch_id>
<id>2</id>
<name>Alchohol Tax</name>
<status nil="true"></status>
<value>0.05</value>
<tax_rate_type>1</tax_rate_type>
</tax_rate>
The 3rd tax rate is Gambling tax of 3% applicable to only selected products and selected branch only (branch id 9).
<tax_rate>
<branch_id>9</branch_id>
<id>3</id>
<name>State Tax</name>
<status nil="true"></status>
<value>0.03</value>
<tax_rate_type>0</tax_rate_type>
</tax_rate>
The following XML results contains 2 products. The first item is California Nap Red Wine should be tax with Alcohol tax of 5%, as well as VAT of 10% which is applicable to all items.
The second item wine glass only needs to be taxed 10% VAT.
<?xml version="1.0" encoding="UTF-8"?>
<products type="array">
<product>
<allow_decimal_quantities>false</allow_decimal_quantities>
<cost>100.0</cost>
<description></description>
<disable_discount>false</disable_discount>
<disable_inventory>false</disable_inventory>
<enable_open_price>false</enable_open_price>
<id>62</id>
<name>California Napa Red Wine</name>
<retail_price>120.0</retail_price>
<status nil="true"></status>
<stock_no>A1</stock_no>
<tax_exempt>false</tax_exempt>
<tag_list></tag_list>
<barcode_list></barcode_list>
<utc_created_at>2011-04-23T11:24:58Z</utc_created_at>
<utc_updated_at>2011-04-23T11:24:58Z</utc_updated_at>
<thumbnail_url></thumbnail_url>
<tax_rates type="array">
<tax_rate>
<branch_id nil="true"></branch_id>
<id>2</id>
<name>Alchohol Tax</name>
<status nil="true"></status>
<value>0.05</value>
<tax_rate_type>1</tax_rate_type>
</tax_rate>
</tax_rates>
<branch_prices type="array"/>
</product>
<product>
<allow_decimal_quantities>false</allow_decimal_quantities>
<cost>10.0</cost>
<description></description>
<disable_discount>false</disable_discount>
<disable_inventory>false</disable_inventory>
<enable_open_price>false</enable_open_price>
<id>63</id>
<name>Correl Wine Glass</name>
<retail_price>20.0</retail_price>
<status nil="true"></status>
<stock_no>A2</stock_no>
<tax_exempt>false</tax_exempt>
<tag_list></tag_list>
<barcode_list></barcode_list>
<utc_created_at>2011-04-23T11:25:31Z</utc_created_at>
<utc_updated_at>2011-04-23T11:25:31Z</utc_updated_at>
<thumbnail_url></thumbnail_url>
<tax_rates type="array"/>
<branch_prices type="array"/>
</product>
</products>