Accounting API
Taxes
Update Tax
this api endpoint (post) (post) updates an existing tax rate if the request succeeds, it returns a tax object docid\ ss8eayx qbyxxlmry9 rk permissions taxes edit webhook event tax events docid\ jslcolrwrmjjnfzwp4ajz path parameters id the id of the tax to update 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/update/\ id") 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 = { rate 12, label "custom shipping tax", applies to "all shipping" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/taxes/update/\ id' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "rate" 12, "label" "custom shipping tax", "applies to" "all shippings" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { rate 12, label "custom shipping tax", applies to "all shipping" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/taxes/update/\ id", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "tax" { "object" "tax", "id" "64305b0e 92f4 46b9 b2da fa27615c3821", "rate" 12 0, "amount" 0 0, "label" "custom shipping tax", "active" false, "country" null, "type" "shipping tax", "applies to" "all shippings", "postcodes" null, "states" null, "payments" null } }