Validate NIF against AEAT registry
**Public endpoint** to validate a NIF/CIF against the AEAT registry using VeriFactu. This endpoint is useful for: - Pre-validation before registration (proactive feedback) - Validating customer NIFs before creating invoices - Verifying that a NIF exists in the registry **Behavior:** - **VALID**: The NIF exists in the AEAT registry. Returns the fiscal name. - **INVALID**: The NIF has correct format but doesn't exist in the registry. - **PENDING**: VeriFactu API is temporarily unavailable. The NIF has valid syntax but couldn't be verified against the registry. - **ERROR**: Technical error during validation (invalid syntax, timeout, etc.) **Note about PENDING:** If you use this endpoint for pre-validation during registration, a PENDING status indicates that the NIF has valid format and the user can continue. The system will validate the NIF automatically when the service becomes available. **Rate limiting:** - With API Key: 100 requests/hour - With Session Cookie: 1000 requests/hour **Authentication:** This endpoint accepts both API Keys and Session Cookies.
API Key authentication.
Format: Authorization: Bearer beel_sk_<key>
Obtaining Keys: API Keys are managed from the BeeL dashboard
Security: API Keys are secret credentials. Do not share them or store them in source code
In: header
Last name and first name (individual) or business name (legal entity).
Important:
- REQUIRED for individuals (NIFs starting with a number)
- OPTIONAL for legal entities (NIFs starting with a letter)
AEAT validates that the provided name matches the one registered in the census. If it doesn't match, validation will return INVALID.
1 <= length <= 255Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://app.beel.es/api/v1/nif/validate" \ -H "Content-Type: application/json" \ -d '{ "nif": "B12345678" }'{
"success": true,
"data": {
"valid": true,
"status": "VALID",
"legal_name": "JUAN PEREZ GARCIA",
"message": "NIF successfully validated in AEAT registry",
"validated_at": "2025-01-15T10:30:00Z"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"error": {
"code": "BAD_REQUEST",
"message": "Invalid request"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation error",
"details": {
"field_name": "Field is required"
}
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}
}Void invoice POST
Voids an invoice by changing its status to `VOIDED`. **Status change:** `ISSUED`, `SENT`, `OVERDUE`, `PAID` or `RECTIFIED` → `VOIDED` **Use when:** The operation never took place (invoice issued by mistake, duplicate, etc.) For invoices already submitted to VeriFactu, the cancellation is sent to AEAT automatically. **Note:** If the operation did take place but with errors, use the corrective invoice endpoint instead.
Get invoice customization options GET
Retrieves available option catalogs to customize invoices: **Template types:** - MODERN_TABLE: Structured table design, ideal for standard products/services - PROFESSIONAL_SERVICE: Text-based design, ideal for notaries/consultancies **Suggested color palette:** - BeeL default colors (orange, blue) - Professional palette (dark grays) - Creative palette (violet, pink, amber, emerald green) - Classic palette (blue, red, green, purple) **Usage:** User can choose a template and accent color to customize their invoices. These values are saved in their profile and automatically applied when generating new invoice PDFs. Template and color names are returned translated to the user's invoice language preference.