action taxrates_all_tax_rates { label: "All tax rates" description: "
Get request. This method returns all tax rates configured on your account. Based on your country selection the endpoint will return all taxes for all countries. You can use the 'filter' parameter to narrow results to selected type of tax. Use 'zip' parameter when you have selected the United States.
\nWe have development an easy to use scheduler so you can call the API to get the rates every hour or day. Please click on the following link to see the code on Github.
\nPlease note in cases when a US state doesn't have sales tax and when a product is tax exempt for a zip code or for a state the API response will be \"null\"
\nTo get a response you need to have selected a product code in your Taxrates.io dashboard, please see the Introduction section above for description of the different types of product codes.
\nFor US sales tax you can filter the tax rate you want for each state or zip code with one of the following: (they are case sensitive)
\n\n var taxrates_endpoint = 'tax/rates';\n var taxrates_params = {'domain':'api.taxrates.io'};\n var taxrates_url = '/api/v3/';\n if ( localStorage.getItem(\"Taxrates_API_Client_Secret\") ){\n jQuery.support.cors = true;\n jQuery.ajax({\n url: taxrates_url+taxrates_endpoint,\n type: 'get',\n method: 'get',\n dataType: \"json\",\n data: taxrates_params,\n beforeSend: function (request) {\n request.withCredentials = true;\n request.setRequestHeader(\"Authorization\", \"Apikey \" + localStorage.getItem(\"Taxrates_API_Client_Secret\"));\n },\n headers: {\n \"accept\": \"application/json\"\n },\n contentType: 'application/json; charset=utf-8',\n success: function (data, textStatus, jqXHR) {\n //Maintain errors inside success because the API may return 200 in general, but different code inside\n if(data.ErrorCode=='404' || data.ErrorCode=='500'){\n //Maintain errors here\n console.log(data.ErrorMessage);\n return false;\n }else{\n var rates = [];\n var i=0;\n var taxrates_range = '';\n jQuery.each(data, function(k, v) {\n if(v.hasOwnProperty(\"rates\")){\n jQuery.each(v.rates, function(m, w) {\n rates[i] = [];\n //Only showing standard rate type\n if( w.Type == \"standard\" ){\n rates[i][0] = w.Type;\n rates[i][1] = w.data_value;\n rates[i][2] = w.product_code;\n i++;\n }\n });\n }\n }).fail(function(xhr) {\n //Maintain your errors here\n return false;\n });\n var cursor = jqXHR.getResponseHeader('X-Cursor-Next');\n if (cursor) {\n // get next page...\n }\n return true;\n }else{\n //Not logged into taxrates.io\n //Maintain your errors here\n return false;\n }\n"
provider: taxrates
method: GET
path: "/v3/tax/rates"
encoding: json
input: {
type: "object"
properties: {
Product_code: {
type: "string"
}
cursor: {
type: "string"
}
domain: {
type: "string"
}
filter: {
type: "string"
}
}
additionalProperties: false
}
output: {
type: "array"
items: {
type: "object"
properties: {
id: {
type: "string"
}
name: {
type: "string"
}
rates: {
type: "array"
items: {
type: "object"
properties: {
data_name: {
type: "string"
}
data_value: {
type: "string"
}
product_code: {
type: "string"
}
type: {
type: "string"
}
}
}
}
state: {
type: "string"
}
zip: {
type: "string"
}
}
}
}
}