Document Validation v2
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/v2/start' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data '{
"country": "{COUNTRY_CODE}",
"idType": "{ID_TYPE}",
"documentRawImageMimeType": "image/jpeg",
"documentFrontRawImage": "{FRONTSIDE_IMAGE}",
"documentBackRawImage": "{BACKSIDE_IMAGE}",
"merchantIdScanReference": "{SCAN_REFERENCE}"
}'
Request parameters:
| Field | Required | Description |
|---|---|---|
| country | Yes | ISO 3166-1 alpha-3 country code |
| idType | Yes | Type of the provided ID. Allowed values: PASSPORT, DRIVING_LICENSE, ID_CARD, RESIDENCE_PERMIT, VISA |
| documentFrontRawImage | Yes | Base64 encoded image of ID front side |
| documentBackRawImage | Yes | Base64 encoded image of ID back side. Optional for single-sided documents like PASSPORT |
| merchantIdScanReference | No | Custom operation reference. Max. length: 100 characters |
| documentRawImageMimeType | No | Mime format of image "image/png" or "image/jpeg" |
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/v2/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/v2/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:
200 OK
Content-Type: application/json
{
"status": "success",
"verification": {
"scanReference": "12df6045-3846-3e45-946a-14fa6136d79a",
"code": 9001,
"person": {
"gender": null,
"idNumber": null,
"lastName": "PEREZ",
"firstName": "MATIAS",
"citizenship": null,
"dateOfBirth": "1973-03-30",
"nationality": null,
"yearOfBirth": "1973",
"placeOfBirth": "MADRID"
},
"reason": null,
"status": "approved",
"document": {
"type": "DRIVERS_LICENSE",
"number": "PEREZ771116SM1AJ",
"country": "ESP",
"validFrom": null,
"validUntil": "2024-04-20",
"placeOfIssue": "MADRID",
"firstIssue": "2015-03-21",
"issueNumber": "01",
"issuedBy": "ISSUER"
},
"reasonCode": null,
"merchantScanReference": "12345678",
"decisionTime": "2019-11-06T07:18:36.916Z",
"acceptanceTime": "2019-11-06T07:15:27.000Z",
}
}
Response fields:
Successful requests return an HTTP status code 200 OK accompanied by a JSON object containing the information described in the following table:
| Parameter | Type | Description |
|---|---|---|
| status | string | State of the service: Success or Fail |
| verification | object | |
| acceptanceTime | string | Initial timestamp in the format YYYY-MMDDThh:mm:ss.SSSZ |
| code | int | Corresponding status code. Possible values: Started (7001), Submitted (7002), Approved (9001), Declined (9102), Resubmission (9103), Expired/Abandoned (9104), Review (9121) |
| decisionTime | string | Timestamp corresponding to the moment of the final decision in the format YYYY-MMDDThh:mm:ss.SSSZ |
| merchantScanReference | string | Validation reference number |
| ScanReference | string | Internal reference provided in the start status |
| status | string | Status of the document validation process. Possible states: Started, Submitted, Approved, Declined, Resubmission, Expired/Abandoned, Review |
| reason | string | Description of the reason for document rejection (status declined). Null if status approved |
| reasonCode | int | Code associated with the reason for rejection. Null if status approved |
| Document | object | |
| type | string | Type of document. Possible values: PASSPORT, DRIVING_LICENSE, ID_CARD, VISA, UNSUPPORTED |
| country | string | Issuing country code in ISO 3166-1 alpha-3 format |
| number | string | Document number |
| validFrom | string | Document issue date |
| validUntil | string | Document expiry date |
| placeOfIssue | string | Place of issue |
| firstIssue | string | Date of the document's first issue |
| issueNumber | string | Issue number |
| issuedBy | string | Issuing authority |
| person | object | |
| firstName | string | User's first name |
| lastName | string | User's last name |
| idNumber | string | User's document number |
| citizenship | string | Citizenship |
| nationality | string | Nationality |
| gender | string | Gender |
| dateOfBirth | string | Date of birth in the format YYYY-MM-DD |
| yearOfBirth | string | Year of birth YYYY |
| placeOfBirth | string | Place of birth |
Table: Reason Code
| Code | Description |
|---|---|
| 101 | Physical document not used |
| 102 | Suspected document tampering |
| 103 | Person showing the document does not appear to match document photo |
| 105 | Suspicious behaviour |
| 106 | Known fraud |
| 108 | Velocity/abuse duplicated end-user |
| 109 | Velocity/abuse duplicated device |
| 110 | Velocity/abuse duplicated ID |
| 112 | Restricted IP location |
| 113 | Suspicious behaviour - Identity Farming |
| 120 | Person on the portrait does not appear to match reference photo |
| 121 | User ID missing |
| 122 | No reference found |
| 123 | Unable to pass registry checks |
| 126 | Potential PEP match |
| 127 | Face match with blocklist |
| 203 | Full document not visible |
| 502 | Multiple parties present in session |
| 503 | Attempted deceit |
| 504 | Attempted deceit, device screen used |
| 505 | Attempted deceit, printout used |
| 507 | Presented document tampered, data cross reference |
| 508 | Presented document tampered, document similarity to specimen |
| 509 | Person showing the document does not match document photo |
| 510 | Presented document type not supported |
| 511 | Presented document expired |
| 515 | Attempted deceit, device screen used for face image |
| 526 | Attempted deceit, photos streamed |
| 527 | Unable to collect proof of address data |
| 528 | Proof of address issue date too old |
| 530 | Person is under 13 years old |
| 531 | Person is under 14 years old |
| 532 | Person is under 16 years old |
| 533 | Person is under 18 years old |
| 534 | Person is under 20 years old |
| 535 | Person is under 21 years old |
| 536 | Person is under 25 years old |
| 537 | Unable to perform document media portrait cropping |
| 539 | Resubmission limit exceeded |
| 540 | Low confidence score for the session |
| 541 | Name on document does not match with name in session initialisation data |
| 542 | Unable to validate CPF |
| 543 | Reference face image has poor quality |
| 544 | Registry did not respond |
| 545 | Reference image missing |
| 546 | Face image quality insufficient |
| 547 | Face missing |
| 548 | Attempted deceit, with face reference missing |
| 549 | NFC validation failed |
| 602 | Presented document type not supported |
| 603 | Video missing |
| 605 | Face image missing |
| 606 | Face is not clearly visible |
| 608 | Document front missing |
| 609 | Document back missing |
| 614 | Document front not fully in frame |
| 615 | Document back not fully in frame |
| 619 | Document data not visible |
| 620 | Presented document expired |
| 621 | Document annulled or damaged |
| 625 | Unable to collect surname |
| 626 | Unable to collect first names |
| 627 | Unable to collect date of birth |
| 628 | Unable to collect issue date |
| 629 | Unable to collect expiry date |
| 630 | Unable to collect gender |
| 631 | Unable to collect document number |
| 632 | Unable to collect personal number |
| 633 | Unable to collect nationality |
| 634 | Unable to collect home address |
| 635 | Document and face image missing |
| 636 | Presented document not real, screen used |
| 637 | Presented document not real, printout used |
| 640 | Person did not give consent |
| 641 | Multiple Faces Detected |
| 642 | Multiple Documents Uploaded |
| 643 | Unable to crop face image from a document front |
| 644 | Unable to collect Identificador de Ciudadano (INE) |
| 645 | Resubmit - Unable to collect OCR (IFE) |
| 646 | Unable to estimate age |
| 647 | Document not recognised |
| 648 | Technical issues |
| 649 | Unable to collect foreigner information |
| 650 | Unable to collect process number |
| 651 | Unable to collect occupation information |
| 652 | Unable to collect employer information |
| 653 | Unable to collect residence permit type |
| 654 | Unable to collect driver's license number |
| 655 | Unable to collect additional name |
| 657 | Open passport image missing |
| 662 | Unable to collect document remarks |
| 1001 | Query ID must be between 20 and 40 symbols |
| 1002 | Query ID must be a valid UUID V4 |
| 1003 | Query ID must be unique, it has already been used. |
| 1102 | Mandatory parameters are missing from the request. |
| 1104 | Request includes invalid parameters. |
| 1201 | Invalid timestamp. Timestamp must not be older than one hour. |
| 1202 | Timestamp format is incorrect. YYYY-MM-DDTHH:MM:S+Timezone Offset |
| 1203 | Invalid ISO 8601 date. Date needs to be in format YYYY-MM-DD. |
| 1301 | Requested features are not supported. |
| 1302 | Only HTTPS return URLs are allowed. |
| 1303 | Invalid status. |
| 1304 | Cannot transition to "$STATUS" status. |
| 1308 | ID number is missing. |
| 1309 | SSN validation requires person firstName + lastName OR fullName to be provided. |
| 1310 | SSN validation requires person.dateOfBirth or address data to be provided. |
| 1400 | Image data not found. |
| 1401 | Image is not in valid base64. |
| 1402 | Image context is not supported. |
| 1403 | Image property is missing. |
| 1500 | vendorData field cannot be more than 1000 symbols. |
| 1501 | vendorData must be a string. |
| 2003 | Date of birth is not a valid date. |
| 2101 | Document number has to be between 6 and 9 characters. |
| 2102 | Document number may contain only characters and numbers A-Z, 0-9. |
| 2103 | Document type is not supported. |
| 2104 | Document from provided country is not supported. |