---
title: "Validate a Spanish NIF, NIE or CIF"
method: POST
path: "/validate-tax-id"
tags: ["Validation"]
---

# Validate a Spanish NIF, NIE or CIF

`POST /validate-tax-id`

## Request

- Base URL: `https://api.cofferdock.com`
- URL: `https://api.cofferdock.com/validate-tax-id`
- Auth: API key in header `x-api-key`

Checks the check letter/digit of a Spanish tax ID (NIF, NIE or CIF). Spain only, no registry lookup. An invalid ID is still a successful call (valid=false).

Costs 1 credit per call.

## Request body

- object
  - `tax_id` string, required: The Spanish tax ID to check: a NIF (8 digits + letter, e.g. "12345678Z"), a NIE (X, Y or Z + 7 digits + letter, e.g. "X1234567L") or a CIF (letter + 7 digits + control digit or letter). Spaces and hyphens are ignored; case does not matter.

## Response `200`

Result.

- object
  - `success` boolean
  - `valid` boolean
  - `type` string, nullable
  - `formatted` string, nullable
  - `meta` object
    - `used` integer: Credits used this month, after this call.
    - `remaining` integer, nullable: Credits left this month (null = unlimited).
    - `unlimited` boolean

## Other responses

- `400`: Invalid input (nothing is charged).
- `401`: Missing or invalid API key.
- `403`: Email not verified.
- `429`: Monthly credit limit reached, or too many requests per minute for this key (see Retry-After).
- `503`: Server busy (queue full). Retry after the seconds in the Retry-After header.

---

[API](https://skmtc.dev/cofferdock/apis/cofferdock-api.md) · [All operations](https://skmtc.dev/cofferdock/apis/cofferdock-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cofferdock/apis/cofferdock-api/revisions/b57aa000d33a?raw)
