Skip to main content

Veritran Docs

Custom ScanDocument

This function allows you to scan several document types at the same time.

It requires you to configure the input register values shown in the Input Registers section.

Function ID

Register

Value

110

3

Input Registers

Register

Description

Mandatory

Value

390

Parameters list used to configure visual information such as colors and texts in JSON format.

Yes

The JSON structure should be as follows:

{
   "country_code":"4",
   "face_image_id":"faceimageid",
   "front_image_id":"frontimageid",
   "back_image_id":"backimageid",
   "button_enabled_color":"#2E97F2",
   "button_disabled_color":"#B3B3B3",
   "json_messages_string":{
      "card_message_front": "Position the front of the document within the frame",
      "card_message_back": "Position the back of the document within the frame",
      "dot_label_front": "Front",
      "dot_label_back": "Back",
      "main_button_clicked_text": "Scanning...",
      "main_button_title_front": "Capture Front",
      "main_button_title_back": "Capture Back",
      "main_button_title_success": "Finished",
      "card_message_success": "The document was successfully scanned"
   },
   "time_out_seconds":"",
   "image_extension_factor":"0.1"
}

391

List of parameters to be read in the scan.

Yes

Example 1: The JSON considers all parameters as optional. This means that, when reading the document, if any field comes back empty, the Call API response in the 112 output register will not be Mandatory fields not found (103). The JSON structure should be as follows:

[
  {
    "document_type": "ID",
    "country" : "GUATEMALA",
    "document_fields": [
      {
        "field_name": "document_type",
        "field_presence": "optional"
      },
      {
        "field_name": "documentDataMatch",
        "field_presence": "optional"
      },
      {
        "field_name": "date_of_birth",
        "field_presence": "optional",
        "field_type" : "date",
        "output_field_format": "dd-MM-yyyy"
      },
      {
        "field_name": "date_of_expiry",
        "field_presence": "optional",
        "field_type" : "date",
        "output_field_format": "yyyy-MM-dd"
      },
      {
        "field_name": "date_of_issue",
        "field_presence": "optional",
        "field_type" : "date",
        "output_field_format": "yyyy-dd-MM"
      },
      {
        "field_name": "document_additional_number",
        "field_presence": "optional"
      },
      {
        "field_name": "document_number",
        "field_presence": "optional"
      },
      {
        "field_name": "back_document_number",
        "field_presence" : "optional"
      },
      {
        "field_name": "front_document_number",
        "field_presence" : "optional"
      },       {
        "field_name": "first_name",
        "field_presence": "optional"
      },
      {
        "field_name": "last_name",
        "field_presence": "optional"
      },
      {
        "field_name": "nationality",
        "field_presence": "optional"
      },
      {
        "field_name": "sex",
        "field_presence": "optional"
      },
      {
        "field_name": "address",
        "field_presence": "optional"
      },
      {
        "field_name": "mrz",
        "field_presence": "optional"
      },
      {
        "field_name": "marital_status",
        "field_presence": "optional"
      },
      {
        "field_name": "issuing_authority",
        "field_presence": "optional"
      },
      {
        "field_name": "place_of_birth",
        "field_presence": "optional"
      },
      {
        "field_name": "personal_id_number",
        "field_presence": "optional"
      },
      {
        "field_name": "religion",
        "field_presence": "optional"
      },
      {
        "field_name": "race",
        "field_presence": "optional"
      }
    ]
  }
]

Example 2: The JSON considers two different types of documents: "ID" and "PASSPORT", where all the fields for the "ID" type are set as "always". This means that the "document_type", "document_data_match", "date_of_birth" and "date_of_expiry" are not expected to be empty. If any of these fields comes back empty, the Call API response in the 112 output register will be Mandatory fields not found (103).

[
  {
    "document_type": "ID",
     "country" : "GUATEMALA",
     "document_fields": [
      {
        "field_name": "document_type",
        "field_presence": "always"
      },
      {
        "field_name": "document_data_match",
        "field_presence": "always"
      },
      {
        "field_name": "date_of_birth",
        "field_presence": "always",
        "field_type" : "date",
        "output_field_format": "dd-MM-yyyy"
      },
      {
        "field_name": "date_of_expiry",
        "field_presence": "always",
        "field_type" : "date",
        "output_field_format": "yyyy-MM-dd"
      }
    ]
  },
  {
     "document_type": "PASSPORT",
     "country" : "COLOMBIA",
     "document_fields": [
      {
        "field_name": "date_of_issue",
        "field_presence": "optional",
        "field_type" : "date",
        "output_field_format": "yyyy-dd-MM"
      },
      {
        "field_name": "document_additional_number",
        "field_presence": "optional"
      },
      {
        "field_name": "document_number",
        "field_presence": "optional"
      },
      {
        "field_name": "first_name",
        "field_presence": "optional"
      },
      {
        "field_name": "last_name",
        "field_presence": "optional"
      },
      {
        "field_name": "nationality",
        "field_presence": "optional"
      },
      {
        "field_name": "sex",
        "field_presence": "optional"
      },
      {
        "field_name": "address",
        "field_presence": "optional"
      },
      {
        "field_name": "mrz",
        "field_presence": "optional"
      },
      {
        "field_name": "marital_status",
        "field_presence": "optional"
      },
      {
        "field_name": "issuing_authority",
        "field_presence": "optional"
      },
      {
        "field_name": "place_of_birth",
        "field_presence": "optional"
      },
      {
        "field_name": "personal_id_number",
        "field_presence": "optional"
      },
      {
        "field_name": "religion",
        "field_presence": "optional"
      },
      {
        "field_name": "race",
        "field_presence": "optional"
      }
    ]
  }
]

Note

In register 391, you can use the field_presence tag with the values "always" or "optional". If the tag is set as always and comes back empty, the reading will be invalid and the Call API response in the 112 output register will be Mandatory fields not found (103).

Output Registers

Register

Description

Value

112

Call Result

-1

GENERIC_ERROR

000

NO_ERROR

2

INVALID_IMAGE_EXTENSION_FACTOR

101

STATUS_NOT_OS_SUPPORTED

102

PARAMS_ERROR

103

INVALID_SCANNED_DATA

106

ERR_STATUS_PERMISSION_NOT_ALLOWED

130

UNKNOWN_COUNTRY_CODE

131

LICENSE_EXPIRED_ERROR

132

TIME_OUT_ERROR

200

CANCEL_ERROR

290

Returns

{
    "document_type":"PASSPORT",
    "document_data_match":"success",
    "date_of_birth":"21-07-1991",
    "date_of_expiry":"2027-08-29",
    "date_of_issue":"2022-30-08",
    "document_additional_number":"F815555555",
    "document_number":"3333333333",
    "name":"JOHN|DAVID",
    "last_name":"DOE|SMITH",
    "nationality":"CHILEAN",
    "sex":"M",
    "mrz":"P<<<<JOHN<DAVID<<<<<<<\n2062838650GTM9107212M2708296F8181129<<<<<<12\n",
    "issuing_authority":"MIGRATION DIRECTOR",
    "place_of_birth":"SANTIAGO",
    "personal_id_number":"2062838651801"
}