/documentValidation
This API allows the morphological validation process of identity documents.
The process consists of 3 steps:
- Start: the information of the document (images, country and type of document) to be analyzed is sent.
- Status: the status of the operation is queried to see if it is possible to proceed to obtain the result of the operation. this query must be made n times until the analysis operation has been completed.
- Data: the results of the morphological analysis of the document are obtained.
Start
Morphological validation start request:
curl --location '{IDENTITY_API_BASE_URL}/verify/documentValidation/start' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"country": "{COUNTRY_CODE}",
"idType": "{ID_TYPE}",
"frontsideImage": "{FRONTSIDE_IMAGE}",
"backsideImage": "{BACKSIDE_IMAGE}",
"merchantIdScanReference": "{SCAN_REFERENCE}"
}'
Request parameters:
| Field | Required | Description |
|---|---|---|
| COUNTRY_CODE | Yes | ISO 3166-1 alpha-3 country code |
| ID_TYPE | Yes | Type of the provided ID. Allowed values: PASSPORT, DRIVING_LICENSE, ID_CARD, VISA |
| FRONTSIDE_IMAGE | Yes | Base64 encoded image of ID front side |
| BACKSIDE_IMAGE | No | Base64 encoded image of ID back side. Optional for single-sided documents like PASSPORT |
| SCAN_REFERENCE | No | Custom operation reference. Max. length: 100 characters |
Example response:
200 OK
Content-Type: application/json
{
"timestamp": "1970-01-01T00:00:00.000Z",
"scanReference": "fe294c25-17e1-4d98-a958-710edbf00064",
"type": "1"
}
Response fields:
| Field | Description |
|---|---|
| timestamp | Timestamp (UTC) of the response in ISO 8601 format |
| scanReference | Reference number for each scan |
| type | Deprecated value. Will be removed in future versions |
Status
Morphological validation status request:
curl --location '{IDENTITY_API_BASE_URL}/verify/documentValidation/status' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"scanReference": "{SCAN_REFERENCE}",
"type": "{TYPE}"
}'
Request parameters:
| Field | Required | Description |
|---|---|---|
| SCAN_REFERENCE | Yes | Scan reference number |
| TYPE | No | Deprecated value. Will be removed in future versions |
Example response:
200 OK
Content-Type: application/json
{
"timestamp": "1970-01-01T00:00:00.000Z",
"scanReference": "fe294c25-17e1-4d98-a958-710edbf00064",
"status": "DONE"
}
Response fields:
| Field | Description |
|---|---|
| timestamp | Timestamp (UTC) of the response in ISO 8601 format |
| scanReference | Scan reference number |
| status | Operation status. Possible states: PENDING, DONE, FAILED |
Data
Morphological validation data request:
curl --location '{IDENTITY_API_BASE_URL}/verify/documentValidation/data' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"scanReference": "{SCAN_REFERENCE}",
"type": "{TYPE}"
}'
Request parameters:
| Field | Required | Description |
|---|---|---|
| SCAN_REFERENCE | Yes | Scan reference number |
| TYPE | No | Deprecated value. Will be removed in future versions |
Example response:
nota
The response fields will depend on the configured morphology provider.