> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Spain - DNI/NIE verification

> Verifies a Spanish DNI / NIE holder's name, date of birth and address against national identity records. Authoritative real-time identity lookup for Spain. Real-time lookup, pay-per-call.

<div hidden data-didit-db-validation-defaults="{&#x22;issuing_state&#x22;:&#x22;ESP&#x22;,&#x22;services&#x22;:&#x22;esp_dni&#x22;,&#x22;consent&#x22;:&#x22;true&#x22;,&#x22;first_name&#x22;:&#x22;John&#x22;,&#x22;last_name&#x22;:&#x22;Doe&#x22;,&#x22;date_of_birth&#x22;:&#x22;1990-01-01&#x22;,&#x22;address&#x22;:&#x22;{\&#x22;street_1\&#x22;:\&#x22;123 Sample Street\&#x22;,\&#x22;street_2\&#x22;:\&#x22;Unit 4\&#x22;,\&#x22;city\&#x22;:\&#x22;Sample City\&#x22;,\&#x22;region\&#x22;:\&#x22;Sample State\&#x22;,\&#x22;postal_code\&#x22;:\&#x22;10001\&#x22;,\&#x22;country\&#x22;:\&#x22;US\&#x22;}&#x22;,&#x22;national_id&#x22;:&#x22;SAMPLE-NID-12345&#x22;,&#x22;phone&#x22;:&#x22;+15550101000&#x22;,&#x22;vendor_data&#x22;:&#x22;user-1234&#x22;}" />

Verifies a Spanish DNI / NIE holder's name, date of birth and address against national identity records. Didit exposes this service through `POST /v3/database-validation/` so you can verify the submitted data against the authoritative source and receive normalized match results.

## Coverage

* **Coverage:** \~ 75%
* **Country:** Spain
* **Service ID:** `esp_dni`
* **Data domain:** Identity
* **Category:** NationalIDRegistry

## Inputs

| Field                 | Required | Example             |
| --------------------- | -------: | ------------------- |
| `first_name`          |      Yes | `John`              |
| `last_name`           |      Yes | `Doe`               |
| `date_of_birth`       |      Yes | `1990-01-01`        |
| `address.street_1`    |      Yes | `123 Sample Street` |
| `address.postal_code` |      Yes | `10001`             |
| `national_id`         |       No | `SAMPLE-NID-12345`  |
| `phone`               |       No | `+15550101000`      |
| `address.street_2`    |       No | `Unit 4`            |
| `address.city`        |       No | `Sample City`       |
| `address.region`      |       No | `Sample State`      |
| `vendor_data`         |       No | `user-1234`         |

* **Required inputs:** `first_name`, `last_name`, `date_of_birth`, `address.street_1`, `address.postal_code`
* **Optional inputs:** `national_id`, `phone`, `address.street_2`, `address.city`, `address.region`, `vendor_data`
* **Consent:** Required
* **Workflow availability:** Available in workflow
* **Coverage:** \~ 75%
* **Price:** \$1.26 per successful query

## Body parameters

<ParamField body="issuing_state" type="string" required default="ESP" placeholder="ESP">
  ISO 3166-1 alpha-3 country code for this database service.

  Example: `ESP`
</ParamField>

<ParamField body="services" type="string" required default="esp_dni" placeholder="esp_dni">
  Array containing this service ID. Pinning the service keeps the request scoped to this exact database.

  Example: `esp_dni`
</ParamField>

<ParamField body="consent" type="boolean" required default="true" placeholder="true">
  Explicit end-user consent for this service.

  Example: `true`
</ParamField>

<ParamField body="first_name" type="string" required default="John" placeholder="John">
  Given name to validate.

  Example: `John`
</ParamField>

<ParamField body="last_name" type="string" required default="Doe" placeholder="Doe">
  Family name to validate.

  Example: `Doe`
</ParamField>

<ParamField body="date_of_birth" type="string" required default="1990-01-01" placeholder="1990-01-01">
  Date of birth in `YYYY-MM-DD` format.

  Example: `1990-01-01`
</ParamField>

<ParamField body="address" type="object" required default="{&#x22;street_1&#x22;:&#x22;123 Sample Street&#x22;,&#x22;street_2&#x22;:&#x22;Unit 4&#x22;,&#x22;city&#x22;:&#x22;Sample City&#x22;,&#x22;region&#x22;:&#x22;Sample State&#x22;,&#x22;postal_code&#x22;:&#x22;10001&#x22;,&#x22;country&#x22;:&#x22;US&#x22;}" placeholder="{&#x22;street_1&#x22;:&#x22;123 Sample Street&#x22;,&#x22;street_2&#x22;:&#x22;Unit 4&#x22;,&#x22;city&#x22;:&#x22;Sample City&#x22;,&#x22;region&#x22;:&#x22;Sample State&#x22;,&#x22;postal_code&#x22;:&#x22;10001&#x22;,&#x22;country&#x22;:&#x22;US&#x22;}">
  Structured residential address object. Use `street_1`, `street_2`, `city`, `region`, `postal_code`, and `country`. A complete legacy address string is still accepted but not recommended.

  Example: `{"street_1":"123 Sample Street","street_2":"Unit 4","city":"Sample City","region":"Sample State","postal_code":"10001","country":"US"}`
</ParamField>

<ParamField body="national_id" type="string" default="SAMPLE-NID-12345" placeholder="SAMPLE-NID-12345">
  National identity number for this service.

  Example: `SAMPLE-NID-12345`
</ParamField>

<ParamField body="phone" type="string" default="+15550101000" placeholder="+15550101000">
  Phone number in international format.

  Example: `+15550101000`
</ParamField>

<ParamField body="vendor_data" type="string" default="user-1234" placeholder="user-1234">
  Your stable user reference for this person, such as your internal user ID. Didit uses it to link standalone checks to the same end user and reduce duplicate-detection noise.

  Example: `user-1234`
</ParamField>

## Input rules & validation notes

* For address services, send structured address fields instead of a single `address` string when possible.
* `address.street_1` is the street address, including street number and street type.
* `address.street_2` is apartment, unit, building, floor, or extra address line. Send it only when you have it.
* `address.city` is city, suburb, district, locality, or neighborhood.
* `address.region` is state, province, region, or town.
* `address.postal_code` is postcode or postal code.
* Address-based database services require at least street address and postal code; requests rejected before source lookup are not charged.

## How to call it

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://verification.didit.me/v3/database-validation/" \
    -H "x-api-key: YOUR_API_KEY" \
    -F "issuing_state=ESP" \
    -F "services=esp_dni" \
    -F "vendor_data=user-1234" \
    -F "consent=true" \
    -F "first_name=John" \
    -F "last_name=Doe" \
    -F "date_of_birth=1990-01-01" \
    -F 'address={"street_1":"123 Sample Street","street_2":"Unit 4","city":"Sample City","region":"Sample State","postal_code":"10001","country":"US"}'
  ```
</RequestExample>

<ResponseExample>
  Every successful call returns HTTP `200`. The **`outcome_code`** field tells you what actually happened — distinguishing, for example, a real biometric mismatch (`BIOMETRIC_NO_MATCH`) from a selfie that could not be read (`BIOMETRIC_IMAGE_UNUSABLE`). The `status` shown is the default feature status; your configured [Partial Match / No Match actions](/core-technology/database-validation/database-validation-warnings) can override it.

  **`MATCH`** — The registry confirmed the identity and every checked field matched.

  ```json 200 OK — MATCH theme={null}
  {
    "request_id": "req_01H…",
    "status": "Approved",
    "issuing_state": "ESP",
    "match_type": "full_match",
    "validations": [
      {
        "outcome_code": "MATCH",
        "service_id": "esp_dni",
        "service_name": "Spain - DNI/NIE verification",
        "source_data": {
          "address": "123 Sample Street",
          "address_match_score": "1.000",
          "city": "Sample City",
          "date_of_birth": "1990-01-01",
          "first_name": "John",
          "full_name": "John Doe",
          "identification_number": "SAMPLE-ID-12345",
          "last_name": "Doe",
          "name_match_score": "1.000",
          "postal_code": "10001",
          "street": "Sample Street",
          "verifications": {
            "address": true,
            "date_of_birth": true,
            "full_name": true
          }
        },
        "validation": {
          "address": "full_match",
          "date_of_birth": "full_match",
          "full_name": "full_match"
        }
      }
    ]
  }
  ```

  **`PARTIAL_MATCH`** — The identification number was found but one or more personal fields (usually name or date of birth) did not fully match.

  ```json 200 OK — PARTIAL_MATCH theme={null}
  {
    "request_id": "req_01H…",
    "status": "In Review",
    "issuing_state": "ESP",
    "match_type": "partial_match",
    "validations": [
      {
        "outcome_code": "PARTIAL_MATCH",
        "service_id": "esp_dni",
        "service_name": "Spain - DNI/NIE verification",
        "source_data": {
          "address": "123 Sample Street",
          "address_match_score": "1.000",
          "city": "Sample City",
          "date_of_birth": "1990-01-01",
          "first_name": "John",
          "full_name": "John Doe",
          "identification_number": "SAMPLE-ID-12345",
          "last_name": "Doe",
          "name_match_score": "1.000",
          "postal_code": "10001",
          "street": "Sample Street",
          "verifications": {
            "address": true,
            "date_of_birth": true,
            "full_name": false
          }
        },
        "validation": {
          "address": "full_match",
          "date_of_birth": "full_match",
          "full_name": "no_match"
        }
      }
    ]
  }
  ```

  **`NO_MATCH`** — The registry returned no match for the submitted data.

  ```json 200 OK — NO_MATCH theme={null}
  {
    "request_id": "req_01H…",
    "status": "Declined",
    "issuing_state": "ESP",
    "match_type": "no_match",
    "validations": [
      {
        "outcome_code": "NO_MATCH",
        "service_id": "esp_dni",
        "service_name": "Spain - DNI/NIE verification",
        "source_data": {
          "address": "NO_MATCH",
          "date_of_birth": "NO_MATCH",
          "full_name": "NO_MATCH"
        },
        "validation": {
          "address": "no_match",
          "date_of_birth": "no_match",
          "full_name": "no_match"
        }
      }
    ]
  }
  ```
</ResponseExample>

## Returned data

The exact fields surfaced in `source_data` depend on what the registry returns. The generated example for `esp_dni` currently documents this normalized shape:

* `address`
* `address_match_score`
* `city`
* `date_of_birth`
* `first_name`
* `full_name`
* `identification_number`
* `last_name`
* `name_match_score`
* `postal_code`
* `street`

## Pricing & SLAs

Spain - DNI/NIE verification queries are billed only when Didit receives a conclusive result from the validation source.

* **Per-call price:** \$1.26 USD.
* **Billing:** per successful query. You are not charged when the registry is unreachable, when required fields are missing, or when the request is rejected before reaching the source.
* **Latency:** typical p95 \< 2 s.
* **Availability:** 99.9% per quarter on Didit's side; downstream source availability varies by country and dataset.

## Continue reading

* [Spain Database Validation overview](/api-reference/database-validation/spain)
* [Database Validation overview](/core-technology/database-validation/overview)
* [Outcome Codes](/core-technology/database-validation/database-validation-outcome-codes)
