curl --request POST \
--url https://us.api.flexprice.io/v1/taxes/associations \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tax_rate_code": "<string>",
"auto_apply": true,
"currency": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"external_customer_id": "<string>",
"metadata": {},
"priority": 123,
"start_date": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://us.api.flexprice.io/v1/taxes/associations"
payload = {
"tax_rate_code": "<string>",
"auto_apply": True,
"currency": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"external_customer_id": "<string>",
"metadata": {},
"priority": 123,
"start_date": "2023-11-07T05:31:56Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tax_rate_code: '<string>',
auto_apply: true,
currency: '<string>',
end_date: '2023-11-07T05:31:56Z',
entity_id: '<string>',
external_customer_id: '<string>',
metadata: {},
priority: 123,
start_date: '2023-11-07T05:31:56Z'
})
};
fetch('https://us.api.flexprice.io/v1/taxes/associations', 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://us.api.flexprice.io/v1/taxes/associations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tax_rate_code' => '<string>',
'auto_apply' => true,
'currency' => '<string>',
'end_date' => '2023-11-07T05:31:56Z',
'entity_id' => '<string>',
'external_customer_id' => '<string>',
'metadata' => [
],
'priority' => 123,
'start_date' => '2023-11-07T05:31:56Z'
]),
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://us.api.flexprice.io/v1/taxes/associations"
payload := strings.NewReader("{\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"currency\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"entity_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"metadata\": {},\n \"priority\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://us.api.flexprice.io/v1/taxes/associations")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"currency\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"entity_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"metadata\": {},\n \"priority\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.flexprice.io/v1/taxes/associations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"currency\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"entity_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"metadata\": {},\n \"priority\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"auto_apply": true,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"environment_id": "<string>",
"id": "<string>",
"metadata": {},
"priority": 123,
"start_date": "2023-11-07T05:31:56Z",
"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>"
}{
"http_status_code": 123,
"message": "<string>"
}{
"http_status_code": 123,
"message": "<string>"
}Create Tax Association
Use when linking a tax rate to an entity (e.g. customer, product, or region) so that rate applies on invoices.
curl --request POST \
--url https://us.api.flexprice.io/v1/taxes/associations \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tax_rate_code": "<string>",
"auto_apply": true,
"currency": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"external_customer_id": "<string>",
"metadata": {},
"priority": 123,
"start_date": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://us.api.flexprice.io/v1/taxes/associations"
payload = {
"tax_rate_code": "<string>",
"auto_apply": True,
"currency": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"external_customer_id": "<string>",
"metadata": {},
"priority": 123,
"start_date": "2023-11-07T05:31:56Z"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tax_rate_code: '<string>',
auto_apply: true,
currency: '<string>',
end_date: '2023-11-07T05:31:56Z',
entity_id: '<string>',
external_customer_id: '<string>',
metadata: {},
priority: 123,
start_date: '2023-11-07T05:31:56Z'
})
};
fetch('https://us.api.flexprice.io/v1/taxes/associations', 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://us.api.flexprice.io/v1/taxes/associations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tax_rate_code' => '<string>',
'auto_apply' => true,
'currency' => '<string>',
'end_date' => '2023-11-07T05:31:56Z',
'entity_id' => '<string>',
'external_customer_id' => '<string>',
'metadata' => [
],
'priority' => 123,
'start_date' => '2023-11-07T05:31:56Z'
]),
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://us.api.flexprice.io/v1/taxes/associations"
payload := strings.NewReader("{\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"currency\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"entity_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"metadata\": {},\n \"priority\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://us.api.flexprice.io/v1/taxes/associations")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"currency\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"entity_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"metadata\": {},\n \"priority\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.flexprice.io/v1/taxes/associations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tax_rate_code\": \"<string>\",\n \"auto_apply\": true,\n \"currency\": \"<string>\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"entity_id\": \"<string>\",\n \"external_customer_id\": \"<string>\",\n \"metadata\": {},\n \"priority\": 123,\n \"start_date\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"auto_apply": true,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"currency": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"environment_id": "<string>",
"id": "<string>",
"metadata": {},
"priority": 123,
"start_date": "2023-11-07T05:31:56Z",
"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>"
}{
"http_status_code": 123,
"message": "<string>"
}{
"http_status_code": 123,
"message": "<string>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
Tax Config Request
EndDate sets when this association expires. Must be after StartDate when both are provided.
customer, subscription, invoice, tenant Show child attributes
Show child attributes
StartDate sets when this association becomes active. Defaults to now if omitted.
Response
OK
Whether this tax should be automatically applied
Currency
EndDate is the optional date until which this association is active
ID of the entity this tax rate applies to
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)
StartDate is the date from which this association is active
published, deleted, archived Show child attributes
Show child attributes
Reference to the TaxRate entity

