Update tax association
curl --request PUT \
--url https://api.tirdad.ai/v1/taxes/associations/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"auto_apply": true,
"metadata": {},
"priority": 123
}
'import requests
url = "https://api.tirdad.ai/v1/taxes/associations/{id}"
payload = {
"auto_apply": True,
"metadata": {},
"priority": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({auto_apply: true, metadata: {}, priority: 123})
};
fetch('https://api.tirdad.ai/v1/taxes/associations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tirdad.ai/v1/taxes/associations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'auto_apply' => true,
'metadata' => [
],
'priority' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tirdad.ai/v1/taxes/associations/{id}"
payload := strings.NewReader("{\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.tirdad.ai/v1/taxes/associations/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tirdad.ai/v1/taxes/associations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n}"
response = http.request(request)
puts response.read_body{
"auto_apply": true,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"entity_id": "<string>",
"environment_id": "<string>",
"id": "<string>",
"metadata": {},
"priority": 123,
"tax_rate": {
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"fixed_value": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"percentage_value": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"tax_rate_id": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"details": {},
"http_status_code": 123,
"message": "<string>"
}{
"details": {},
"http_status_code": 123,
"message": "<string>"
}Tax Associations
Update tax association
Use when changing a tax association (e.g. switch rate or entity). Request body contains the fields to update.
PUT
/
taxes
/
associations
/
{id}
Update tax association
curl --request PUT \
--url https://api.tirdad.ai/v1/taxes/associations/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"auto_apply": true,
"metadata": {},
"priority": 123
}
'import requests
url = "https://api.tirdad.ai/v1/taxes/associations/{id}"
payload = {
"auto_apply": True,
"metadata": {},
"priority": 123
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({auto_apply: true, metadata: {}, priority: 123})
};
fetch('https://api.tirdad.ai/v1/taxes/associations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tirdad.ai/v1/taxes/associations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'auto_apply' => true,
'metadata' => [
],
'priority' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tirdad.ai/v1/taxes/associations/{id}"
payload := strings.NewReader("{\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.tirdad.ai/v1/taxes/associations/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tirdad.ai/v1/taxes/associations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"auto_apply\": true,\n \"metadata\": {},\n \"priority\": 123\n}"
response = http.request(request)
puts response.read_body{
"auto_apply": true,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"entity_id": "<string>",
"environment_id": "<string>",
"id": "<string>",
"metadata": {},
"priority": 123,
"tax_rate": {
"code": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"environment_id": "<string>",
"fixed_value": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"percentage_value": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
},
"tax_rate_id": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>"
}{
"details": {},
"http_status_code": 123,
"message": "<string>"
}{
"details": {},
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Path Parameters
Tax Config ID
Body
application/json
Tax Config Request
Response
OK
Whether this tax should be automatically applied
Currency
ID of the entity this tax rate applies to
Available options:
customer, subscription, invoice, tenant EnvironmentID is the ID of the environment this tax rate config belongs to
ID of the ent.
Metadata holds the value of the "metadata" field.
Show child attributes
Show child attributes
Priority for tax resolution (lower number = higher priority)
Available options:
published, deleted, archived Show child attributes
Show child attributes
Reference to the TaxRate entity
⌘I