validate_nif_es
Validates Spanish tax IDs (NIF, NIE, CIF) by automatically detecting the document type and returning a boolean validity flag, type, and normalized ID.
Instructions
Validates Spanish tax identification numbers — NIF (DNI, 8 digits + check letter, for Spanish citizens), NIE (Número de Identidad de Extranjero, starts with X/Y/Z, for foreign residents), and CIF (Código de Identificación Fiscal, letter + 7 digits + control, for companies). Automatically detects the document type. Returns { valid: boolean, type: 'NIF'|'NIE'|'CIF', id: string }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Spanish NIF, NIE or CIF. Examples: '12345678Z' (NIF), 'X1234567L' (NIE), 'B12345678' (CIF) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | Yes | ||
| type | No | ||
| id | No | ||
| reason | No |