NIF_VALIDATION_INVALID
The NIF is not in the AEAT census or, for an individual, the legal name does not match
Category: General
| HTTP status | 422 Unprocessable Content |
| Retry | After fixing the cause |
When it happens
AEAT does not identify the NIF: it is not in the census or, for an individual, the name sent does not match the one registered. AEAT gives the same answer in both cases, so they cannot be told apart. It is checked in the sandbox too, so a made-up NIF with a valid check digit is rejected.
How to fix it
Check the NIF and, for an individual, send the name exactly as it is registered with AEAT.
Retry
Not as is: the same request fails the same way. Fix the cause described above, then send the request again, under a new Idempotency-Key if the body changed.
Example response
When this error occurs, the API answers 422 Unprocessable Content with a JSON body of this shape:
{
"type": "https://docs.beel.es/errors/NIF_VALIDATION_INVALID",
"title": "NIF_VALIDATION_INVALID",
"detail": "The NIF is not in the AEAT census or, for an individual, the legal name does not match",
"instance": "/v1/<resource>",
"errors": [],
"success": false,
"error": {
"code": "NIF_VALIDATION_INVALID",
"message": "The NIF is not in the AEAT census or, for an individual, the legal name does not match",
"details": {}
},
"meta": {
"timestamp": "2026-05-21T10:00:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}The type URI is stable and always resolves to this page.
Message
Send the request with Accept-Language: <es|en|ca> to receive the message in your preferred language.
Other errors in this category
AUTOMATIC_EMAIL_CONFIG_INVALID
For automatic sending, you must provide an email configuration or a client with email
BAD_REQUEST
The provided data is not valid.
BUSINESS_RULE_VIOLATION
The operation breaks a business rule.
CITY_EMPTY
City cannot be empty
CITY_MAX_LENGTH
City cannot exceed ‹value› characters