cURL
curl --request POST \
--url https://api.numeralhq.com/tax/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "customer@example.com",
"name": "Customer Name",
"is_tax_exempt": true,
"reference_customer_id": "20506"
}
'import requests
url = "https://api.numeralhq.com/tax/customers"
payload = {
"email": "customer@example.com",
"name": "Customer Name",
"is_tax_exempt": True,
"reference_customer_id": "20506"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'customer@example.com',
name: 'Customer Name',
is_tax_exempt: true,
reference_customer_id: '20506'
})
};
fetch('https://api.numeralhq.com/tax/customers', 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.numeralhq.com/tax/customers",
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([
'email' => 'customer@example.com',
'name' => 'Customer Name',
'is_tax_exempt' => true,
'reference_customer_id' => '20506'
]),
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://api.numeralhq.com/tax/customers"
payload := strings.NewReader("{\n \"email\": \"customer@example.com\",\n \"name\": \"Customer Name\",\n \"is_tax_exempt\": true,\n \"reference_customer_id\": \"20506\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.numeralhq.com/tax/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"customer@example.com\",\n \"name\": \"Customer Name\",\n \"is_tax_exempt\": true,\n \"reference_customer_id\": \"20506\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.numeralhq.com/tax/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"customer@example.com\",\n \"name\": \"Customer Name\",\n \"is_tax_exempt\": true,\n \"reference_customer_id\": \"20506\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cus_123456789",
"object": "tax.customer",
"reference_customer_id": "20506",
"name": "Customer Name",
"email": "customer@example.com",
"is_tax_exempt": true
}{
"error": {
"error_code": "missing_field",
"error_message": "Field is required",
"error_meta": {
"field": "path.to.fieldname",
"expected": "string",
"received": "undefined"
}
}
}Create Customer
Create a new customer
POST
/
tax
/
customers
cURL
curl --request POST \
--url https://api.numeralhq.com/tax/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "customer@example.com",
"name": "Customer Name",
"is_tax_exempt": true,
"reference_customer_id": "20506"
}
'import requests
url = "https://api.numeralhq.com/tax/customers"
payload = {
"email": "customer@example.com",
"name": "Customer Name",
"is_tax_exempt": True,
"reference_customer_id": "20506"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'customer@example.com',
name: 'Customer Name',
is_tax_exempt: true,
reference_customer_id: '20506'
})
};
fetch('https://api.numeralhq.com/tax/customers', 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.numeralhq.com/tax/customers",
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([
'email' => 'customer@example.com',
'name' => 'Customer Name',
'is_tax_exempt' => true,
'reference_customer_id' => '20506'
]),
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://api.numeralhq.com/tax/customers"
payload := strings.NewReader("{\n \"email\": \"customer@example.com\",\n \"name\": \"Customer Name\",\n \"is_tax_exempt\": true,\n \"reference_customer_id\": \"20506\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.numeralhq.com/tax/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"customer@example.com\",\n \"name\": \"Customer Name\",\n \"is_tax_exempt\": true,\n \"reference_customer_id\": \"20506\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.numeralhq.com/tax/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"customer@example.com\",\n \"name\": \"Customer Name\",\n \"is_tax_exempt\": true,\n \"reference_customer_id\": \"20506\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cus_123456789",
"object": "tax.customer",
"reference_customer_id": "20506",
"name": "Customer Name",
"email": "customer@example.com",
"is_tax_exempt": true
}{
"error": {
"error_code": "missing_field",
"error_message": "Field is required",
"error_meta": {
"field": "path.to.fieldname",
"expected": "string",
"received": "undefined"
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The customer's email
Example:
"customer@example.com"
The customer's name
Example:
"Customer Name"
If true, all POST /tax/calculations sold to this customer will return $0 in tax owed. The default value is false.
Example:
true
The ID of the customer in your system
Example:
"20506"
Response
Customer creation response
The ID of the customer
Example:
"cus_123456789"
The type of object: tax.customer
Example:
"tax.customer"
The ID of the customer in your system
Example:
"20506"
The name of the created customer
Example:
"Customer Name"
The email of the created customer
Example:
"customer@example.com"
If true, all POST /tax/calculations sold to this customer will return $0 in tax owed. The default value is false.
Example:
true
⌘I