On this page

VAT Checker API

VAT Checker API can be used by busineses for tax verificationof their buyers. This screening is essential for the reverse charge scheme and exempted transactions and might be done one-by-one or in bulks. 

Post check user’s VAT number.
Authorization is required to call this API.
API is designed for collecting of customer’s VAT numbers and checking for correctness.

POST

Request

POST /returns/declarations/check_users_vat_number/{access_token}

Parameters

Parameter Type Description
input_vat_numbers JSON JSON object contains information about
access_token String User’s website token

API returns a summary rates JSON object with an array of summarized rates for each region/state.

Input VAT numbers example

Command Line

curl -X 'POST' \
  'https://merchant.vatcompliance.co/api/1/returns/declarations/check_users_vat_number/{token}' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "vat_numbers": [
     {
            "country": "CZE",
            "number": "685345797"
       }
  ]
}'

Command line

require 'net/http'
require 'json'

post_fields = {
  'vat_numbers' => [
    {
      "country" => "CZE",
      "number" => "685345797"
    },
    {
      "country" => "EST",
      "number" => "101977100"
    },
    {
      "country" => "CZE",
      "number" => "685"
    }
  ]
}

token = 'MY_TOKEN'
url = "https://merchant.vatcompliance.co/api/1/returns/declarations/check_users_vat_number/#{token}"

uri = URI(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri.path, { 'Content-Type' => 'application/json' })
request.body = post_fields.to_json

response = http.request(request)
puts response.body
Command line

import requests
import json

post_fields = {
    'vat_numbers': [
        {
            "country": "CZE",
            "number": "685345797"
        },
        {
            "country": "EST",
            "number": "101977100"
        },
        {
            "country": "CZE",
            "number": "685"
        }
    ]
}

token = 'MY_TOKEN'
url = f'https://merchant.vatcompliance.co/api/1/returns/declarations/check_users_vat_number/{token}'

headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, data=json.dumps(post_fields), headers=headers)

print(response.text)

const https = require('https');

const postFields = {
    'vat_numbers': [
        {
            "country": "CZE",
            "number": "685345797"
        },
        {
            "country": "EST",
            "number": "101977100"
        },
        {
            "country": "CZE",
            "number": "685"
        }
    ]
};

const token = 'MY_TOKEN';
const url = `https://merchant.vatcompliance.co/api/1/returns/declarations/check_users_vat_number/${token}`;

const postData = JSON.stringify(postFields);

const options = {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Content-Length': postData.length
    }
};

const req = https.request(url, options, (res) => {
    let data = '';

    res.on('data', (chunk) => {
        data += chunk;
    });

    res.on('end', () => {
        console.log(data);
    });
});

req.on('error', (error) => {
    console.error(error);
});

req.write(postData);
req.end();
Command line

$postFields = [
	'vat_numbers' => [
		[
			"country" => "CZE",
			"number" => "685345797"
		],
		[
			"country" => "EST",
			"number" => "101977100"
		],
		[
			"country" => "CZE",
			"number" => "685"
		]
	]
];
$token = 'MY_TOKEN';
$curl = curl_init();

curl_setopt_array($curl, [
	CURLOPT_URL => 'https://merchant.vatcompliance.co/api/1/returns/declarations/check_users_vat_number/' . $token,
	CURLOPT_RETURNTRANSFER => true,
	CURLOPT_ENCODING => '',
	CURLOPT_MAXREDIRS => 10,
	CURLOPT_TIMEOUT => 0,
	CURLOPT_FOLLOWLOCATION => true,
	CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
	CURLOPT_CUSTOMREQUEST => 'POST',
	CURLOPT_POSTFIELDS => json_encode($postFields),
	CURLOPT_HTTPHEADER => [
		'Content-Type: application/json'
	],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Command line

/* Your code... */

Command line

using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace VATComplianceAPI
{
    class Program
    {
        static async Task Main(string[] args)
        {
            var postFields = new
            {
                vat_numbers = new[]
                {
                    new { country = "CZE", number = "685345797" },
                    new { country = "EST", number = "101977100" },
                    new { country = "CZE", number = "685" }
                }
            };

            string token = "MY_TOKEN";
            string url = $"https://merchant.vatcompliance.co/api/1/returns/declarations/check_users_vat_number/{token}";

            var json = Newtonsoft.Json.JsonConvert.SerializeObject(postFields);
            var content = new StringContent(json, Encoding.UTF8, "application/json");

            using (var httpClient = new HttpClient())
            {
                var response = await httpClient.PostAsync(url, content);
                string responseContent = await response.Content.ReadAsStringAsync();
                Console.WriteLine(responseContent);
            }
        }
    }
}

Command line

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String token = "MY_TOKEN";
        String url = "https://merchant.vatcompliance.co/api/1/returns/declarations/check_users_vat_number/" + token;

        String postFields = "{ \"vat_numbers\": [ { \"country\": \"CZE\", \"number\": \"685345797\" }, { \"country\": \"EST\", \"number\": \"101977100\" }, { \"country\": \"CZE\", \"number\": \"685\" } ] }";

        try {
            URL apiUrl = new URL(url);
            HttpURLConnection conn = (HttpURLConnection) apiUrl.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/json");
            conn.setDoOutput(true);

            try (OutputStream outputStream = conn.getOutputStream()) {
                outputStream.write(postFields.getBytes());
                outputStream.flush();
            }

            int responseCode = conn.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                try (BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {
                    String response = reader.readLine();
                    System.out.println(response);
                }
            } else {
                System.out.println("Error: " + responseCode);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Command line

package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	postFields := map[string][]map[string]string{
		"vat_numbers": {
			{
				"country": "CZE",
				"number":  "685345797",
			},
			{
				"country": "EST",
				"number":  "101977100",
			},
			{
				"country": "CZE",
				"number":  "685",
			},
		},
	}

	token := "MY_TOKEN"
	url := fmt.Sprintf("https://merchant.vatcompliance.co/api/1/returns/declarations/check_users_vat_number/%s", token)

	postData, err := json.Marshal(postFields)
	if err != nil {
		fmt.Println("Error encoding JSON:", err)
		return
	}

	req, err := http.NewRequest("POST", url, bytes.NewBuffer(postData))
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}

	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error sending request:", err)
		return
	}

	defer resp.Body.Close()

	var response map[string]interface{}
	err = json.NewDecoder(resp.Body).Decode(&response)
	if err != nil {
		fmt.Println("Error decoding response:", err)
		return
	}

	fmt.Println(response)
}

Response Example

Summary response shortened for brevity

Command Line


{
"correct": [
"685345797",
"101977100"
],
"incorrect": [
"685"
],
"pending": []
}
"incorrect": [
"685"
]  "pending": []
}