API > Validate NIF with VIES

Validate NIF with VIES

POST  https://{entorno}.ticketbaiws.eus/validar-nif-vies/

Checks whether a NIF (VAT number) is registered in VIES: it verifies that the number is valid and whether it is registered as an intra-Community operator

PARAMETERS

nif string required
NIF to validate
B12345678
pais string required
Country code
ES


The possible results are:

IDENTIFICADO: Valid NIF, registered in VIES as an intra-Community operator
NO IDENTIFICADO: Invalid NIF, or not registered as an intra-Community operator

POST https://api.ticketbaiws.eus/validar-nif-vies/
$ curl --request POST \
     --url https://api.ticketbaiws.eus/validar-nif-vies/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '
{
    "nif": "12345678Z",
    "nombre": "Juan Martínez"
}'
$ composer require ticketbaiws/ticketbaiws-php
<?php
// Installation: composer require ticketbaiws/ticketbaiws-php
require 'vendor/autoload.php';

$tbai = new \TicketbaiWS\Client('xxx', '00000014Z', ['entorno' => 'real']);

$r = $tbai->validarNifVies('12345678Z', '');

if ($r->isError()) {
    echo $r->getMessageText();
} else {
    print_r($r->getData());
}
$ python -m pip install requests
import requests

url = "https://api.ticketbaiws.eus/validar-nif-vies/"
payload = {
    "nif": "12345678Z",
    "nombre": "Juan Martínez"
}

headers = {"Accept": "application/json", "Token" : "xxx", "Nif" : "00000014Z"}
response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.ticketbaiws.eus/validar-nif-vies/");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, '{"nif": "12345678Z","nombre": "Juan Martínez"}');

CURLcode ret = curl_easy_perform(hnd);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{"nif": "12345678Z","nombre": "Juan Martínez"}');

Request request = new Request.Builder()
  .url("https://api.ticketbaiws.eus/validar-nif-vies/")
  .post(body)
  .addHeader("Accept", "application/json")
  .addHeader("Token", "xxx")
  .addHeader("Nif", "00000014Z")
  .build();
  
Response response = client.newCall(request).execute();
{ } Response JSON
HTTP/1.1 200 OK
{
    "result": "OK",
    "return": {
        "nif": "12345678Z",
        "nombre": "MARTINEZ RODRIGUEZ JUAN",
        "resultado": "IDENTIFICADO"
    },
    "msg": ""
}

TicketBAI / Verifactu methods

Representation document

BATUZ BIZKAIA specific methods

SII (AEAT)

Customers and products (invoicing tool)

Other methods