cURL
curl --request POST \
--url https://api.numeralhq.com/tax/refund_reversals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refund_id": "ref_tr_123456789"
}
'import requests
url = "https://api.numeralhq.com/tax/refund_reversals"
payload = { "refund_id": "ref_tr_123456789" }
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({refund_id: 'ref_tr_123456789'})
};
fetch('https://api.numeralhq.com/tax/refund_reversals', 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/refund_reversals",
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([
'refund_id' => 'ref_tr_123456789'
]),
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/refund_reversals"
payload := strings.NewReader("{\n \"refund_id\": \"ref_tr_123456789\"\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/refund_reversals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refund_id\": \"ref_tr_123456789\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.numeralhq.com/tax/refund_reversals")
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 \"refund_id\": \"ref_tr_123456789\"\n}"
response = http.request(request)
puts response.read_body{
"id": "ref_tr_123456789",
"object": "tax.refund",
"refund_type": "partial",
"testmode": "false",
"refund_processed_at": 1714787673,
"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
}
]
}{
"error": {
"error_code": "missing_field",
"error_message": "Field is required",
"error_meta": {
"field": "path.to.fieldname",
"expected": "string",
"received": "undefined"
}
}
}Transactions
Create Refund Reversals
Reverse a refund you’ve previously created
POST
/
tax
/
refund_reversals
cURL
curl --request POST \
--url https://api.numeralhq.com/tax/refund_reversals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"refund_id": "ref_tr_123456789"
}
'import requests
url = "https://api.numeralhq.com/tax/refund_reversals"
payload = { "refund_id": "ref_tr_123456789" }
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({refund_id: 'ref_tr_123456789'})
};
fetch('https://api.numeralhq.com/tax/refund_reversals', 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/refund_reversals",
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([
'refund_id' => 'ref_tr_123456789'
]),
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/refund_reversals"
payload := strings.NewReader("{\n \"refund_id\": \"ref_tr_123456789\"\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/refund_reversals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"refund_id\": \"ref_tr_123456789\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.numeralhq.com/tax/refund_reversals")
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 \"refund_id\": \"ref_tr_123456789\"\n}"
response = http.request(request)
puts response.read_body{
"id": "ref_tr_123456789",
"object": "tax.refund",
"refund_type": "partial",
"testmode": "false",
"refund_processed_at": 1714787673,
"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
}
]
}{
"error": {
"error_code": "missing_field",
"error_message": "Field is required",
"error_meta": {
"field": "path.to.fieldname",
"expected": "string",
"received": "undefined"
}
}
}Refund Reversal Endpoint (2024-09-01)
Reverse a refund you’ve previously created.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The ID of the refund to reverse
Example:
"ref_tr_123456789"
Response
Refund response
The ID of the refund. We recommend you store this value. If you need to reverse this refund, you will be required to reference this ID.
Example:
"ref_tr_123456789"
The type of object: tax.refund.
Example:
"tax.refund"
This will be either 'full' or 'partial'.
Example:
"partial"
True if using a production API key. False if using a test API key.
Example:
"false"
Unix timestamp in seconds representing the date and time the refund was made. If not provided, the time the refund was created will be used.
Example:
1714787673
Show child attributes
Show child attributes
⌘I