> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/rest-api/identity-api/identity-api-reference/onboarding/morphology/document-validation/document-validation-data.md).

# Document validation Data

Gets the results of the document's morphological analysis **once the validation process has been successfully completed**.

{% hint style="info" %}
The response fields will depend on the configured morphology provider.
{% endhint %}

### Endpoint

```
POST /verify/documentValidation/data
```

### Headers

| Name          | Type   | Required | Description                                                |
| ------------- | ------ | -------- | ---------------------------------------------------------- |
| **x-api-key** | string | **Yes**  | Access authorization API Key.                              |
| **family**    | string | No       | Value: **Onboarding**. Required with the Tracking service. |

{% hint style="info" %}
All calls to the Endpoints for Tracking with **Identity Platform** must contain the header `family`.
{% endhint %}

### Request body

**Content-Type:** `application/json`

#### Parameters

| Parameter              | Type   | Required | Description                                                                                          |
| ---------------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------- |
| `scanReference`        | string | **Yes**  | **Reference number** of the scan.                                                                    |
| `type`                 | string | No       | ⚠️ Value **deprecated**. Will be removed in future versions.                                         |
| `tracking`             | object | No       | Object representing the required tracking information.                                               |
| `tracking.extraData`   | string | No       | Token generated by the SDK Mobile/Web. It contains tokenized tracking information with the Platform. |
| `tracking.operationId` | string | No       | Operation identifier generated by the SDK Mobile/Web.                                                |

#### Request example

```json
{
  "scanReference": "fe294c25-17e1-4d98-a958-710edbf00064",
  "type": "1",
  "tracking": {
    "extraData": "BQABAQG2gBNjuHN4kLmPqYf7R...",
    "operationId": "123e4567-e89b-12d3-a456-426614174000"
  }
}
```

### Responses

#### `200` Success

#### Response parameters — `document`

Document validation details and extracted information.

| Parameter          | Type   | Nullable | Description                                                                                                                                                                                                                 |
| ------------------ | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dateOfBirthParts` | object | Yes      | Birth date parts (`year`, `month`, `day`).                                                                                                                                                                                  |
| `dob`              | string | Yes      | Date of birth in format **YYYY-MM-DD**.                                                                                                                                                                                     |
| `expiry`           | string | Yes      | Document expiration date in format **YYYY-MM-DD**.                                                                                                                                                                          |
| `expiryDateParts`  | object | Yes      | Expiration date parts (`year`, `month`, `day`).                                                                                                                                                                             |
| `firstName`        | string | Yes      | Document holder's first name.                                                                                                                                                                                               |
| `lastName`         | string | Yes      | Document holder's last name.                                                                                                                                                                                                |
| `gender`           | string | Yes      | Document holder's gender.                                                                                                                                                                                                   |
| `idSubtype`        | string | Yes      | Document subtype.                                                                                                                                                                                                           |
| `issuingCountry`   | string | Yes      | Country that issued the document.                                                                                                                                                                                           |
| `nationality`      | string | Yes      | Document holder's nationality.                                                                                                                                                                                              |
| `number`           | string | Yes      | Document number.                                                                                                                                                                                                            |
| `optionalData2`    | string | Yes      | Additional optional data field.                                                                                                                                                                                             |
| `status`           | string | No       | Document verification status. Possible values: `APPROVED_VERIFIED`, `DENIED_FRAUD`, `DENIED_UNSUPPORTED_ID_TYPE`, `DENIED_UNSUPPORTED_ID_COUNTRY`, `ERROR_NOT_READABLE`. See [Verification Results](#verification-results). |
| `type`             | string | Yes      | Document type. Possible values: `PASSPORT`, `DRIVING_LICENSE`, `ID_CARD`, `VISA`                                                                                                                                            |
| `issuingDate`      | string | Yes      | Document issue date.                                                                                                                                                                                                        |
| `issuingDateParts` | object | Yes      | Issue date parts (`year`, `month`, `day`).                                                                                                                                                                                  |
| `issuingPlace`     | string | Yes      | Place where the document was issued.                                                                                                                                                                                        |
| `issuingAuthority` | string | Yes      | Authority that issued the document.                                                                                                                                                                                         |

#### Response parameters — `transaction`

Transaction metadata and processing information.

| Parameter               | Type   | Description                                          |
| ----------------------- | ------ | ---------------------------------------------------- |
| `date`                  | string | Transaction creation date in format **ISO 8601**.    |
| `merchantScanReference` | string | Scan reference provided by the merchant.             |
| `source`                | string | Transaction source.                                  |
| `status`                | string | Transaction processing status.                       |
| `updatedAt`             | string | Timestamp of the last update in format **ISO 8601**. |

#### Response parameters — `verification`

Verification results and additional checks performed.

| Parameter          | Type   | Nullable | Description                                 |
| ------------------ | ------ | -------- | ------------------------------------------- |
| `additionalChecks` | object | Yes      | Additional verification checks performed.   |
| `mrzCheck`         | object | Yes      | Machine Readable Zone verification results. |

#### Verification Results

The field `document.status` in the Document Validation Data response indicates the verification result:

| Status                               | Description                                                               |
| ------------------------------------ | ------------------------------------------------------------------------- |
| **APPROVED\_VERIFIED**               | Successfully verified and approved for use.                               |
| **DENIED\_FRAUD**                    | The verification failed due to fraudulent content or suspected tampering. |
| **DENIED\_UNSUPPORTED\_ID\_TYPE**    | The document type is not supported by the validation system.              |
| **DENIED\_UNSUPPORTED\_ID\_COUNTRY** | The document country is not supported by the validation system.           |
| **ERROR\_NOT\_READABLE**             | Could not be processed due to poor image quality or legibility issues.    |

#### Response example

```json
{
  "document": {
    "dateOfBirthParts": {
      "year": "1995",
      "month": "10",
      "day": "16"
    },
    "dob": "XXXX-10-16",
    "expiry": "XXXX-10-16",
    "expiryDateParts": {
      "year": "XXXX",
      "month": "XX",
      "day": "XX"
    },
    "firstName": "XXX XXXXX",
    "gender": null,
    "idSubtype": null,
    "issuingCountry": "CHL",
    "lastName": "XXXX XXXXXX",
    "nationality": null,
    "number": "XXXXXXXXX",
    "optionalData2": "XXXXXX K",
    "status": "APPROVED_VERIFIED",
    "type": "ID_CARD",
    "issuingDate": null,
    "issuingDateParts": null,
    "issuingPlace": null,
    "issuingAuthority": null
  },
  "transaction": {
    "date": "2024-01-18T17:48:49.598029Z",
    "merchantScanReference": "680f8ef8-3ff5-XXXXX-XXXX-97182d998dfb",
    "source": "API",
    "status": "DONE",
    "updatedAt": "2024-01-18T17:49:15.310078Z"
  },
  "verification": {
    "additionalChecks": null,
    "mrzCheck": null
  }
}
```

#### `400` Bad Request

```json
{
  "status": 400,
  "title": "Bad Request",
  "detail": "Invalid request.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400",
  "errors": []
}
```

#### `401` Unauthorized

```json
{
  "message": "Unauthorized"
}
```

#### `403` Forbidden

```json
{
  "Message": "User is not authorized to access this resource with an explicit deny"
}
```

#### `502` Bad Gateway

```json
{
  "status": 502,
  "title": "Bad Gateway",
  "detail": "Server got an invalid response.",
  "type": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502"
}
```

#### `504` Gateway Timeout

```json
{
  "message": "Endpoint request timed out"
}
```
