action taxrates_tax_rates_by_country_code { label: "Tax rates by Country Code" description: "Get request. This method returns all tax rates for country discovered based on country code. The country code must be 2 letters ISO 3166-1 alfa-2 country code (see here for more information). You can use 'filter' parameter to narrow results to selected type of tax\n

For 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/countrycode';\n  var taxrates_params = {'domain':'api.taxrates.io', 'country_code':'IE', 'product_code':'C010'};\n  var taxrates_url = '/api/v1/';\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) {\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            jQuery.each(data, function(k, v) {\n                if(v.hasOwnProperty(\"taxes\")){\n                    jQuery.each(v.taxes, function(m, w) {\n                        rates[i] = [];\n                        //Only showing standard rate type\n                        if( w.Type == \"standard\" ){\n                            rates[i][0] = w.Country;\n                            rates[i][1] = w.Type;\n                            rates[i][2] = w.data_value;\n                            i++;\n                        }\n                    });\n                }\n            //Now you have all your rates inside rates variable.\n            }).fail(function(xhr) {\n                    //Maintain your errors here\n                    return false;\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: "/v1/tax/countrycode" encoding: json input: { type: "object" properties: { country_code: { type: "string" } date: { type: "string" } domain: { type: "string" } filter: { type: "string" } "product_codes[]": { type: "string" } "province ": { type: "string" } zip: { type: "string" } } additionalProperties: false } output: { type: "object" properties: { country_name: { type: "string" } taxes: { type: "array" items: { type: "object" properties: { Country: { type: "string" } Type: { type: "string" } data_name: { type: "string" } data_value: { type: "string" } } } } } } }