Accounting API
Taxes
Create Product Tax
this api endpoint (post) (post) creates a product tax if the request succeeds, it returns a tax object docid\ ss8eayx qbyxxlmry9 rk permissions taxes create webhook event tax events docid\ jslcolrwrmjjnfzwp4ajz body parameters label string the label of the tax rate applies to string the possible values are all products and selected products rate decimal the tax rate percentage not required if amount is provided amount decimal the fixed tax amount not required if rate is provided country string appendix docid\ kfbmx4q3dxjtduqf75yx1 the country where this tax rate applies to postcodes array of strings an array of postcodes to use for filtering when customers attempt to make an order, the tax rate will apply if their postcode matches (full or partial) any of the values in the array states array of strings an array of states to use for filtering when customers attempt to make an order, the tax rate will apply if their state matches any of the values in the array states are supported by a limited number of countries which you can see appendix docid\ kfbmx4q3dxjtduqf75yx1 active boolean this attribute shows whether the tax rate is currently enabled the default value is false payments array of strings appendix docid\ kfbmx4q3dxjtduqf75yx1 the payment whitelist for the tax rate when customers attempt to make an order, the tax rate will apply if their selected payment method matches any of the values in the array products array of strings the product ids that you like this tax rate to apply to required if condition is set to selected products require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/taxes/product tax/create") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["authorization"] = "bearer your token here" data = { country "de", rate 10, label "german tax", applies to "all products" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/taxes/product tax/create' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw ' { "country" "de", "rate" 10, "label" "german tax", "applies to" "all products" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { country "de", rate 10, label "german tax", applies to "all products" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/taxes/product tax/create", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "tax" { "object" "tax", "id" "8c79abbc 0748 4545 9514 afa28d6f983d", "rate" 10 0, "amount" 0 0, "label" "german tax", "active" false, "country" "de", "type" "product tax", "applies to" "all products", "postcodes" null, "states" null, "payments" null } }