Update
curl --request PATCH \
--url https://{defaultHost}/v1/tax_protocol \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tax_protocol": {
"tax_enabled": true
}
}
'import requests
url = "https://{defaultHost}/v1/tax_protocol"
payload = { "tax_protocol": { "tax_enabled": True } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tax_protocol: {tax_enabled: true}})
};
fetch('https://{defaultHost}/v1/tax_protocol', 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://{defaultHost}/v1/tax_protocol",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tax_protocol' => [
'tax_enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{defaultHost}/v1/tax_protocol"
payload := strings.NewReader("{\n \"tax_protocol\": {\n \"tax_enabled\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://{defaultHost}/v1/tax_protocol")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tax_protocol\": {\n \"tax_enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/tax_protocol")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tax_protocol\": {\n \"tax_enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "56a8fb51-564a-4c46-9afe-34129861bce3",
"object": "tax_protocol",
"ca_tax_enabled": false,
"eu_micro_exemption_enabled": false,
"eu_tax_enabled": false,
"eu_vat_required": false,
"eu_vat_unverified_behavior": "error",
"eu_vat_local_reverse_charge": false,
"tax_behavior": "exclusive",
"tax_enabled": true,
"default_tax_enabled": false,
"default_rate": null,
"address": "2791ddf9-836a-4e2f-9981-1a4ab6b25bd0",
"ca_tax_identifier": null,
"eu_tax_identifier": null,
"created_at": 1793797015,
"updated_at": 1793797015
}Tax Protocols
Update
Updates the current account’s tax protocol.
PATCH
/
v1
/
tax_protocol
Update
curl --request PATCH \
--url https://{defaultHost}/v1/tax_protocol \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tax_protocol": {
"tax_enabled": true
}
}
'import requests
url = "https://{defaultHost}/v1/tax_protocol"
payload = { "tax_protocol": { "tax_enabled": True } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tax_protocol: {tax_enabled: true}})
};
fetch('https://{defaultHost}/v1/tax_protocol', 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://{defaultHost}/v1/tax_protocol",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'tax_protocol' => [
'tax_enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{defaultHost}/v1/tax_protocol"
payload := strings.NewReader("{\n \"tax_protocol\": {\n \"tax_enabled\": true\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://{defaultHost}/v1/tax_protocol")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tax_protocol\": {\n \"tax_enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/tax_protocol")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tax_protocol\": {\n \"tax_enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "56a8fb51-564a-4c46-9afe-34129861bce3",
"object": "tax_protocol",
"ca_tax_enabled": false,
"eu_micro_exemption_enabled": false,
"eu_tax_enabled": false,
"eu_vat_required": false,
"eu_vat_unverified_behavior": "error",
"eu_vat_local_reverse_charge": false,
"tax_behavior": "exclusive",
"tax_enabled": true,
"default_tax_enabled": false,
"default_rate": null,
"address": "2791ddf9-836a-4e2f-9981-1a4ab6b25bd0",
"ca_tax_identifier": null,
"eu_tax_identifier": null,
"created_at": 1793797015,
"updated_at": 1793797015
}Authorizations
Response
200 - application/json
Success
The address used for tax calculations.
Expandable – The associated address ID.
The Canadian tax identifier.
Expandable – The associated ca tax identifier ID.
The EU tax identifier.
Expandable – The associated eu tax identifier ID.
Was this page helpful?