cURL
curl --request POST \
--url https://api.numeralhq.com/tax/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"calculation_id": "calc_123456789",
"reference_order_id": "343-45836",
"transaction_processed_at": 1714787673,
"metadata": {
"example_key": "example_value"
}
}
'import requests
url = "https://api.numeralhq.com/tax/transactions"
payload = {
"calculation_id": "calc_123456789",
"reference_order_id": "343-45836",
"transaction_processed_at": 1714787673,
"metadata": { "example_key": "example_value" }
}
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({
calculation_id: 'calc_123456789',
reference_order_id: '343-45836',
transaction_processed_at: 1714787673,
metadata: {example_key: 'example_value'}
})
};
fetch('https://api.numeralhq.com/tax/transactions', 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/transactions",
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([
'calculation_id' => 'calc_123456789',
'reference_order_id' => '343-45836',
'transaction_processed_at' => 1714787673,
'metadata' => [
'example_key' => 'example_value'
]
]),
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/transactions"
payload := strings.NewReader("{\n \"calculation_id\": \"calc_123456789\",\n \"reference_order_id\": \"343-45836\",\n \"transaction_processed_at\": 1714787673,\n \"metadata\": {\n \"example_key\": \"example_value\"\n }\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/transactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calculation_id\": \"calc_123456789\",\n \"reference_order_id\": \"343-45836\",\n \"transaction_processed_at\": 1714787673,\n \"metadata\": {\n \"example_key\": \"example_value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.numeralhq.com/tax/transactions")
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 \"calculation_id\": \"calc_123456789\",\n \"reference_order_id\": \"343-45836\",\n \"transaction_processed_at\": 1714787673,\n \"metadata\": {\n \"example_key\": \"example_value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "tr_123456789",
"object": "tax.transaction",
"calculation_id": "calc_123456789",
"reference_order_id": "343-45836",
"transaction_processed_at": 1714787673,
"customer_currency_code": "USD",
"filing_currency_code": "USD",
"line_items": [
{
"product": {
"reference_product_name": "Widget",
"reference_line_item_id": "line_987654321",
"reference_product_id": "p-1233543",
"product_tax_code": "GENERAL_MERCHANDISE"
},
"tax_jurisdictions": [
{
"tax_rate": 0.07,
"tax_due_decimal": 700,
"rate_type": "GENERAL STATE SALES TAX",
"fee_amount": 0,
"tax_authority_name": "Tennessee",
"tax_authority_type": "",
"tax_type": "SALES"
}
],
"quantity": 2,
"tax_amount": 14,
"amount_excluding_tax": 200,
"amount_including_tax": 214
}
],
"testmode": "false",
"metadata": {
"example_key": "example_value"
}
}{
"error": {
"error_code": "missing_field",
"error_message": "Field is required",
"error_meta": {
"field": "path.to.fieldname",
"expected": "string",
"received": "undefined"
}
}
}{
"error": {
"error_code": "calculation_not_found",
"error_message": "Unable to find calculation {calculation_id}."
}
}Create Transactions
Record a completed sale
POST
/
tax
/
transactions
cURL
curl --request POST \
--url https://api.numeralhq.com/tax/transactions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"calculation_id": "calc_123456789",
"reference_order_id": "343-45836",
"transaction_processed_at": 1714787673,
"metadata": {
"example_key": "example_value"
}
}
'import requests
url = "https://api.numeralhq.com/tax/transactions"
payload = {
"calculation_id": "calc_123456789",
"reference_order_id": "343-45836",
"transaction_processed_at": 1714787673,
"metadata": { "example_key": "example_value" }
}
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({
calculation_id: 'calc_123456789',
reference_order_id: '343-45836',
transaction_processed_at: 1714787673,
metadata: {example_key: 'example_value'}
})
};
fetch('https://api.numeralhq.com/tax/transactions', 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/transactions",
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([
'calculation_id' => 'calc_123456789',
'reference_order_id' => '343-45836',
'transaction_processed_at' => 1714787673,
'metadata' => [
'example_key' => 'example_value'
]
]),
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/transactions"
payload := strings.NewReader("{\n \"calculation_id\": \"calc_123456789\",\n \"reference_order_id\": \"343-45836\",\n \"transaction_processed_at\": 1714787673,\n \"metadata\": {\n \"example_key\": \"example_value\"\n }\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/transactions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calculation_id\": \"calc_123456789\",\n \"reference_order_id\": \"343-45836\",\n \"transaction_processed_at\": 1714787673,\n \"metadata\": {\n \"example_key\": \"example_value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.numeralhq.com/tax/transactions")
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 \"calculation_id\": \"calc_123456789\",\n \"reference_order_id\": \"343-45836\",\n \"transaction_processed_at\": 1714787673,\n \"metadata\": {\n \"example_key\": \"example_value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "tr_123456789",
"object": "tax.transaction",
"calculation_id": "calc_123456789",
"reference_order_id": "343-45836",
"transaction_processed_at": 1714787673,
"customer_currency_code": "USD",
"filing_currency_code": "USD",
"line_items": [
{
"product": {
"reference_product_name": "Widget",
"reference_line_item_id": "line_987654321",
"reference_product_id": "p-1233543",
"product_tax_code": "GENERAL_MERCHANDISE"
},
"tax_jurisdictions": [
{
"tax_rate": 0.07,
"tax_due_decimal": 700,
"rate_type": "GENERAL STATE SALES TAX",
"fee_amount": 0,
"tax_authority_name": "Tennessee",
"tax_authority_type": "",
"tax_type": "SALES"
}
],
"quantity": 2,
"tax_amount": 14,
"amount_excluding_tax": 200,
"amount_including_tax": 214
}
],
"testmode": "false",
"metadata": {
"example_key": "example_value"
}
}{
"error": {
"error_code": "missing_field",
"error_message": "Field is required",
"error_meta": {
"field": "path.to.fieldname",
"expected": "string",
"received": "undefined"
}
}
}{
"error": {
"error_code": "calculation_not_found",
"error_message": "Unable to find calculation {calculation_id}."
}
}