curl --request POST \
--url https://api.nocotax.app/tax_calculations \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_details": {
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"tax_registrations": [
{
"country": "<string>",
"number": "<string>"
}
]
},
"customer_id": "<string>",
"items": [
{
"reference": "<string>",
"tax_code": "<string>"
}
],
"supplier_details": {
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"tax_registrations": [
{
"country": "<string>",
"number": "<string>"
}
]
},
"supplier_id": "<string>"
}
'import requests
url = "https://api.nocotax.app/tax_calculations"
payload = {
"customer_details": {
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"tax_registrations": [
{
"country": "<string>",
"number": "<string>"
}
]
},
"customer_id": "<string>",
"items": [
{
"reference": "<string>",
"tax_code": "<string>"
}
],
"supplier_details": {
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"tax_registrations": [
{
"country": "<string>",
"number": "<string>"
}
]
},
"supplier_id": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_details: {
address: {
country: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
postal_code: '<string>',
state: '<string>'
},
tax_registrations: [{country: '<string>', number: '<string>'}]
},
customer_id: '<string>',
items: [{reference: '<string>', tax_code: '<string>'}],
supplier_details: {
address: {
country: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
postal_code: '<string>',
state: '<string>'
},
tax_registrations: [{country: '<string>', number: '<string>'}]
},
supplier_id: '<string>'
})
};
fetch('https://api.nocotax.app/tax_calculations', 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.nocotax.app/tax_calculations",
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([
'customer_details' => [
'address' => [
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '<string>'
],
'tax_registrations' => [
[
'country' => '<string>',
'number' => '<string>'
]
]
],
'customer_id' => '<string>',
'items' => [
[
'reference' => '<string>',
'tax_code' => '<string>'
]
],
'supplier_details' => [
'address' => [
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '<string>'
],
'tax_registrations' => [
[
'country' => '<string>',
'number' => '<string>'
]
]
],
'supplier_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.nocotax.app/tax_calculations"
payload := strings.NewReader("{\n \"customer_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"customer_id\": \"<string>\",\n \"items\": [\n {\n \"reference\": \"<string>\",\n \"tax_code\": \"<string>\"\n }\n ],\n \"supplier_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"supplier_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.nocotax.app/tax_calculations")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"customer_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"customer_id\": \"<string>\",\n \"items\": [\n {\n \"reference\": \"<string>\",\n \"tax_code\": \"<string>\"\n }\n ],\n \"supplier_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"supplier_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nocotax.app/tax_calculations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"customer_id\": \"<string>\",\n \"items\": [\n {\n \"reference\": \"<string>\",\n \"tax_code\": \"<string>\"\n }\n ],\n \"supplier_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"supplier_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "tax_cc_17920607808btjf8f02947",
"livemode": false,
"object": "tax_calculation",
"customer_details": {
"address": {
"city": "West Johnnieport",
"line1": "68481 Schoen Hill",
"line2": "Apt. 914",
"country": "SN",
"postal_code": "86577"
},
"tax_registrations": []
},
"items": [
{
"id": "tax_cci_17920607808jvv9d0a3372",
"livemode": false,
"reference": "ref-0000-0000-001-A",
"tax_code": "D10000000",
"tax_class": "DIGITAL_GOODS",
"tax_summary": {
"tax_collectible": false,
"taxes": [
{
"tax_id": "fallback-tax",
"jurisdiction": "SN",
"percentage": "0.0",
"tax_exemption": {
"type": "NOT_REGISTERED",
"legal_notice": null
}
}
]
}
},
{
"id": "tax_cci_17920607808pr0715bd253",
"livemode": false,
"reference": "ref-0000-0000-002-A",
"tax_code": "P10000000",
"tax_class": "PHYSICAL_GOODS",
"tax_summary": {
"tax_collectible": false,
"taxes": [
{
"tax_id": "fallback-tax",
"jurisdiction": "SN",
"percentage": "0.0",
"tax_exemption": {
"type": "NOT_REGISTERED",
"legal_notice": null
}
}
]
}
}
],
"supplier_details": {
"address": {
"city": "West Carlenabury",
"line1": "80664 Lang Knolls",
"line2": "Suite 331",
"country": "SI",
"postal_code": "20440-4930"
},
"tax_registrations": []
},
"created_at": "2026-10-15T10:39:40.410Z",
"updated_at": "2026-10-15T10:39:40.410Z"
}{
"message": "<string>",
"status": 123,
"type": "INVALID_REQUEST_ERROR",
"params": [
{
"field": "<string>",
"errors": [
"<string>"
]
}
]
}Create a Tax Calculation
Creates a Tax Calculation.
This endpoint calculates the applicable taxes for a given transaction. It is designed to support both B2B and B2C scenarios, including guest checkouts, self-owned organizations, and third-party transactions.
Use Cases:
- Calculate taxes for a guest user (no customer/supplier organization).
- Calculate taxes for a registered organization (customer or supplier).
- Calculate taxes for digital or physical goods.
- Calculate taxes for cross-border transactions (e.g., EU OSS, IOSS, or standard VAT).
Edge Cases:
- If both
customer_idandcustomer_detailsare provided, the API will return an error. - If both
supplier_idandsupplier_detailsare provided, the API will return an error. - If neither
customer_idnorcustomer_detailsis provided, the API will assume the self-owned organization is the customer. - If neither
supplier_idnorsupplier_detailsis provided, the API will assume the self-owned organization is the supplier. - The
countryfield inaddressis mandatory for both customer and supplier. - The
itemsarray must contain at least one item. - If
tax_codeis not provided for an item, the default tax codeD10000000(digital goods) will be used.
curl --request POST \
--url https://api.nocotax.app/tax_calculations \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_details": {
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"tax_registrations": [
{
"country": "<string>",
"number": "<string>"
}
]
},
"customer_id": "<string>",
"items": [
{
"reference": "<string>",
"tax_code": "<string>"
}
],
"supplier_details": {
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"tax_registrations": [
{
"country": "<string>",
"number": "<string>"
}
]
},
"supplier_id": "<string>"
}
'import requests
url = "https://api.nocotax.app/tax_calculations"
payload = {
"customer_details": {
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"tax_registrations": [
{
"country": "<string>",
"number": "<string>"
}
]
},
"customer_id": "<string>",
"items": [
{
"reference": "<string>",
"tax_code": "<string>"
}
],
"supplier_details": {
"address": {
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"postal_code": "<string>",
"state": "<string>"
},
"tax_registrations": [
{
"country": "<string>",
"number": "<string>"
}
]
},
"supplier_id": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_details: {
address: {
country: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
postal_code: '<string>',
state: '<string>'
},
tax_registrations: [{country: '<string>', number: '<string>'}]
},
customer_id: '<string>',
items: [{reference: '<string>', tax_code: '<string>'}],
supplier_details: {
address: {
country: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
postal_code: '<string>',
state: '<string>'
},
tax_registrations: [{country: '<string>', number: '<string>'}]
},
supplier_id: '<string>'
})
};
fetch('https://api.nocotax.app/tax_calculations', 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.nocotax.app/tax_calculations",
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([
'customer_details' => [
'address' => [
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '<string>'
],
'tax_registrations' => [
[
'country' => '<string>',
'number' => '<string>'
]
]
],
'customer_id' => '<string>',
'items' => [
[
'reference' => '<string>',
'tax_code' => '<string>'
]
],
'supplier_details' => [
'address' => [
'country' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'postal_code' => '<string>',
'state' => '<string>'
],
'tax_registrations' => [
[
'country' => '<string>',
'number' => '<string>'
]
]
],
'supplier_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.nocotax.app/tax_calculations"
payload := strings.NewReader("{\n \"customer_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"customer_id\": \"<string>\",\n \"items\": [\n {\n \"reference\": \"<string>\",\n \"tax_code\": \"<string>\"\n }\n ],\n \"supplier_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"supplier_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.nocotax.app/tax_calculations")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"customer_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"customer_id\": \"<string>\",\n \"items\": [\n {\n \"reference\": \"<string>\",\n \"tax_code\": \"<string>\"\n }\n ],\n \"supplier_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"supplier_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nocotax.app/tax_calculations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"customer_id\": \"<string>\",\n \"items\": [\n {\n \"reference\": \"<string>\",\n \"tax_code\": \"<string>\"\n }\n ],\n \"supplier_details\": {\n \"address\": {\n \"country\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"state\": \"<string>\"\n },\n \"tax_registrations\": [\n {\n \"country\": \"<string>\",\n \"number\": \"<string>\"\n }\n ]\n },\n \"supplier_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "tax_cc_17920607808btjf8f02947",
"livemode": false,
"object": "tax_calculation",
"customer_details": {
"address": {
"city": "West Johnnieport",
"line1": "68481 Schoen Hill",
"line2": "Apt. 914",
"country": "SN",
"postal_code": "86577"
},
"tax_registrations": []
},
"items": [
{
"id": "tax_cci_17920607808jvv9d0a3372",
"livemode": false,
"reference": "ref-0000-0000-001-A",
"tax_code": "D10000000",
"tax_class": "DIGITAL_GOODS",
"tax_summary": {
"tax_collectible": false,
"taxes": [
{
"tax_id": "fallback-tax",
"jurisdiction": "SN",
"percentage": "0.0",
"tax_exemption": {
"type": "NOT_REGISTERED",
"legal_notice": null
}
}
]
}
},
{
"id": "tax_cci_17920607808pr0715bd253",
"livemode": false,
"reference": "ref-0000-0000-002-A",
"tax_code": "P10000000",
"tax_class": "PHYSICAL_GOODS",
"tax_summary": {
"tax_collectible": false,
"taxes": [
{
"tax_id": "fallback-tax",
"jurisdiction": "SN",
"percentage": "0.0",
"tax_exemption": {
"type": "NOT_REGISTERED",
"legal_notice": null
}
}
]
}
}
],
"supplier_details": {
"address": {
"city": "West Carlenabury",
"line1": "80664 Lang Knolls",
"line2": "Suite 331",
"country": "SI",
"postal_code": "20440-4930"
},
"tax_registrations": []
},
"created_at": "2026-10-15T10:39:40.410Z",
"updated_at": "2026-10-15T10:39:40.410Z"
}{
"message": "<string>",
"status": 123,
"type": "INVALID_REQUEST_ERROR",
"params": [
{
"field": "<string>",
"errors": [
"<string>"
]
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
The tax calculation customer's details, if no organization is created. Useful when you need to display tax rates for a guest or to init a shipping cart. Cannot be used along with customer_id. Leave blank if your account's self-owned organization is the customer of the transaction
Show child attributes
Show child attributes
The ID of the organization this tax calculation refers as a customer. Cannot be used along with customer_details. Leave blank if your account's self-owned organization is the customer of the transaction.
A list of items the customer is buying or willing to buy. At least one item is required. Each item must have a unique reference within the calculation object.
Show child attributes
Show child attributes
The tax calculation supplier's details, if no organization is created. Useful when you need to display tax rates for a guest or to init a shipping cart. Cannot be used along with supplier_id. Leave blank if your account's self-owned organization is the supplier of the transaction
Show child attributes
Show child attributes
The ID of the organization this tax calculation refers as a merchant/supplier. Cannot be used along with supplier_details. Leave blank if your account's self-owned organization is the supplier/merchant of the transaction.
Response
successful
tax_calculation The tax calculation customer's details
Show child attributes
Show child attributes
The list of items the customer is buying or willing to buy, for which tax has been calculated
Show child attributes
Show child attributes
The tax calculation supplier's details
Show child attributes
Show child attributes
