Calculate VAT endpoint
curl --request GET \
--url https://vat.abstractapi.com/v1/calculateimport requests
url = "https://vat.abstractapi.com/v1/calculate"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://vat.abstractapi.com/v1/calculate', 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://vat.abstractapi.com/v1/calculate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://vat.abstractapi.com/v1/calculate"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://vat.abstractapi.com/v1/calculate")
.asString();require 'uri'
require 'net/http'
url = URI("https://vat.abstractapi.com/v1/calculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"amount_excluding_vat": "175.00",
"amount_including_vat": "208.25",
"vat_amount": "33.25",
"vat_category": "standard",
"vat_rate": "0.190",
"country": {
"code": "DE",
"name": "Germany"
}
}
Calculate VAT endpoint
The calculate endpoint makes it easy to calculate a VAT compliant price given a country and price, as well as optional values such as the type of goods.
GET
/
v1
/
calculate
Calculate VAT endpoint
curl --request GET \
--url https://vat.abstractapi.com/v1/calculateimport requests
url = "https://vat.abstractapi.com/v1/calculate"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://vat.abstractapi.com/v1/calculate', 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://vat.abstractapi.com/v1/calculate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://vat.abstractapi.com/v1/calculate"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://vat.abstractapi.com/v1/calculate")
.asString();require 'uri'
require 'net/http'
url = URI("https://vat.abstractapi.com/v1/calculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"amount_excluding_vat": "175.00",
"amount_including_vat": "208.25",
"vat_amount": "33.25",
"vat_category": "standard",
"vat_rate": "0.190",
"country": {
"code": "DE",
"name": "Germany"
}
}
Getting started
Base URL
https://vat.abstractapi.com/v1/calculate
Validation endpoint
Thecalculate endpoint simply requires your unique API key, the country and the price you’d like to check:
https://vat.abstractapi.com/v1/calculate
? api_key = YOUR_UNIQUE_API_KEY
& amount = 175
& country_code = DE
{
"amount_excluding_vat": "175.00",
"amount_including_vat": "208.25",
"vat_amount": "33.25",
"vat_category": "standard",
"vat_rate": "0.190",
"country": {
"code": "DE",
"name": "Germany"
}
}
Request parameters
Your unique API key. Note that each user has unique API keys for each of Abstract’s APIs, so your VAT Validation API key will not work for as your IP Geolocation API, for example.
The two letter ISO 3166-1 alpha-2 code of the country in which the transaction takes place.
If the amount already has VAT added and you’d like to do the reverse calculation and split out the amount and VAT, set this parameter to true. If this parameter is not explicitly included it will default to false.
Some countries offer a reduced VAT rate for certain categories of goods. To determine if a reduced VAT is available and to apply it to the final amount, include the vat_category in the request.
Response parameters
The API response is returned in a universal and lightweight JSON format.The optional category of the purchase, used to determine whether it qualifies for a reduced rate. See below for a list of supported categories.