Examples and integrations for the Valix API — Spanish fiscal identifier validation (NIF, NIE, CIF, IBAN).
Valix is a REST API that validates Spanish fiscal identifiers in a single request. No need to implement and maintain validation algorithms yourself.
Supported identifiers:
- NIF (Número de Identificación Fiscal)
- NIE (Número de Identidad de Extranjero)
- CIF (Código de Identificación Fiscal)
- IBAN (International Bank Account Number)
curl -X POST https://api.getvalix.io/v1/validate/trial \
-H "Content-Type: application/json" \
-d '{"items": [{"value": "12345678Z", "type": "NIF"}]}'Response:
{
"total": 1,
"valid_count": 1,
"invalid_count": 0,
"results": [
{
"index": 0,
"value": "12345678Z",
"detected_type": "NIF",
"valid": true,
"formatted": "12345678Z",
"errors": []
}
]
}The type field accepts the following values:
| Value | Description |
|---|---|
AUTO |
Automatic detection (recommended) |
NIF |
Número de Identificación Fiscal |
NIE |
Número de Identidad de Extranjero |
CIF |
Código de Identificación Fiscal |
IBAN |
International Bank Account Number |
Example with automatic detection:
curl -X POST https://api.getvalix.io/v1/validate/trial \
-H "Content-Type: application/json" \
-d '{"items": [{"value": "12345678Z", "type": "AUTO"}]}'Example with multiple identifiers:
curl -X POST https://api.getvalix.io/v1/validate/trial \
-H "Content-Type: application/json" \
-d '{
"items": [
{"value": "12345678Z", "type": "NIF"},
{"value": "ES9121000418450200051332", "type": "IBAN"},
{"value": "X1234567L", "type": "AUTO"}
]
}'Learn more at getvalix.io.
Test the API without registration at getvalix.io or use the trial endpoint directly:
POST https://api.getvalix.io/v1/validate/trial
50 free validations per day. No API key required.
MIT