## Validate NIF with the AEAT

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

Validates a NIF (Spanish tax ID) against the taxpayer register of the AEAT (Spanish Tax Agency). Verifactu requires invoices to individuals to be issued with the correct details (first name + last name + NIF). For legal entities, the NIF alone is enough.

**PARAMETERS**

- `nif` (string, required): NIF to validate. Ejemplo: `12345678Z`
- `nombre` (string, required only for individuals): First name + last name for individuals; optional for legal entities. Ejemplo: `Juan Martínez`

For individuals, the possible results are:

**IDENTIFICADO:**  The taxpayer matches the identification data provided. The last name(s) and first name linked to the NIF are returned.
**NO IDENTIFICADO-SIMILAR:**  The taxpayer does not match the identification data provided due to minor differences in the last name(s) and first name. The last name(s) and first name linked to the NIF are returned.
**NO IDENTIFICADO:**  The taxpayer does not match the identification data provided.

For legal entities, the “No Identificado-Similar” result does not exist, but these two results are added:

**IDENTIFICADO-BAJA:**  The taxpayer matches the NIF provided and is deregistered. The current NIF and its registered name are returned.
**IDENTIFICADO-REVOCADO:**  The taxpayer matches the NIF provided and is deregistered because the NIF was revoked. The current NIF and its registered name are returned.

**POST** `https://api.ticketbaiws.eus/validar-nif/`

```bash
$ curl --request POST \
     --url https://api.ticketbaiws.eus/validar-nif/ \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'Token: xxx' \
     --header 'Nif: 00000014Z'
	 --data '
{
    "nif": "12345678Z",
    "nombre": "Juan Martínez"
}'
```

Respuesta:

```json
HTTP/1.1 200 OK
{
    "result": "OK",
    "return": {
        "nif": "12345678Z",
        "nombre": "MARTINEZ RODRIGUEZ JUAN",
        "resultado": "IDENTIFICADO"
    },
    "msg": ""
}
```

Fuente: https://ticketbaiws.eus/en/validar-nif-post/
