Saltar al contenido principal

/documentValidation

This API allows the morphological validation process of identity documents.

The process consists of 3 steps:

  1. Start: the information of the document (images, country and type of document) to be analyzed is sent.
  2. 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.
  3. 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:

FieldRequiredDescription
COUNTRY_CODEYesISO 3166-1 alpha-3 country code
ID_TYPEYesType of the provided ID. Allowed values: PASSPORT, DRIVING_LICENSE, ID_CARD, VISA
FRONTSIDE_IMAGEYesBase64 encoded image of ID front side
BACKSIDE_IMAGENoBase64 encoded image of ID back side. Optional for single-sided documents like PASSPORT
SCAN_REFERENCENoCustom 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:

FieldDescription
timestampTimestamp (UTC) of the response in ISO 8601 format
scanReferenceReference number for each scan
typeDeprecated 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:

FieldRequiredDescription
SCAN_REFERENCEYesScan reference number
TYPENoDeprecated 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:

FieldDescription
timestampTimestamp (UTC) of the response in ISO 8601 format
scanReferenceScan reference number
statusOperation 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:

FieldRequiredDescription
SCAN_REFERENCEYesScan reference number
TYPENoDeprecated value. Will be removed in future versions

Example response:

nota

The response fields will depend on the configured morphology provider.