Settings
Set US Nexus States
Replace the tenant’s entire set of declared US sales-tax nexus states.
PUT
/
v1
/
settings
/
tax
/
nexus
Set US sales-tax nexus states
curl --request PUT \
--url https://billing.example.com/v1/settings/tax/nexus \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"states": [
{
"state_code": "CA",
"nexus_type": "physical"
}
]
}
'import requests
url = "https://billing.example.com/v1/settings/tax/nexus"
payload = { "states": [
{
"state_code": "CA",
"nexus_type": "physical"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({states: [{state_code: 'CA', nexus_type: 'physical'}]})
};
fetch('https://billing.example.com/v1/settings/tax/nexus', 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://billing.example.com/v1/settings/tax/nexus",
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([
'states' => [
[
'state_code' => 'CA',
'nexus_type' => 'physical'
]
]
]),
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://billing.example.com/v1/settings/tax/nexus"
payload := strings.NewReader("{\n \"states\": [\n {\n \"state_code\": \"CA\",\n \"nexus_type\": \"physical\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://billing.example.com/v1/settings/tax/nexus")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"states\": [\n {\n \"state_code\": \"CA\",\n \"nexus_type\": \"physical\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/settings/tax/nexus")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"states\": [\n {\n \"state_code\": \"CA\",\n \"nexus_type\": \"physical\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"state_code": "CA",
"nexus_type": "physical",
"established_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Replaces the tenant’s entire nexus set — states omitted from the request
are removed.
The updated nexus set is returned in the
owner/admin only. Scope to a legal entity with the optional
entity_id query parameter.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
states | array | No | The full set of nexus declarations. |
states[].state_code | string | Yes | Two-letter US state code, e.g. CA. |
states[].nexus_type | string | No | One of physical, voluntary, economic. Defaults to physical. |
Example Request
curl -X PUT https://api.recurso.dev/v1/settings/tax/nexus \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"states": [
{ "state_code": "CA", "nexus_type": "physical" },
{ "state_code": "NY", "nexus_type": "economic" }
]
}'
data envelope, in the same shape as
List US Nexus States.Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Query Parameters
Legal entity to scope the tax config to (Multi-Entity Books). Omit for the tenant's primary entity / default config.
Body
application/json
Show child attributes
Show child attributes
Response
Updated nexus states.
Show child attributes
Show child attributes
⌘I
Set US sales-tax nexus states
curl --request PUT \
--url https://billing.example.com/v1/settings/tax/nexus \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"states": [
{
"state_code": "CA",
"nexus_type": "physical"
}
]
}
'import requests
url = "https://billing.example.com/v1/settings/tax/nexus"
payload = { "states": [
{
"state_code": "CA",
"nexus_type": "physical"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({states: [{state_code: 'CA', nexus_type: 'physical'}]})
};
fetch('https://billing.example.com/v1/settings/tax/nexus', 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://billing.example.com/v1/settings/tax/nexus",
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([
'states' => [
[
'state_code' => 'CA',
'nexus_type' => 'physical'
]
]
]),
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://billing.example.com/v1/settings/tax/nexus"
payload := strings.NewReader("{\n \"states\": [\n {\n \"state_code\": \"CA\",\n \"nexus_type\": \"physical\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://billing.example.com/v1/settings/tax/nexus")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"states\": [\n {\n \"state_code\": \"CA\",\n \"nexus_type\": \"physical\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/settings/tax/nexus")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"states\": [\n {\n \"state_code\": \"CA\",\n \"nexus_type\": \"physical\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"state_code": "CA",
"nexus_type": "physical",
"established_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}