Enhanced Document Verification
Only available where we are integrated into the document's issuing authorities' database
Overview
Enhanced Document Verification is a powerful extension of our Document Verification product, providing an additional layer of security and validation for identity documents. This check verifies that a document is authentic and cross-references the information on the document with a government database in a single call.
This dual check makes it extremely difficult for fraudsters to onboard and allows you to comply with document storage requirements.
To run an Enhanced Document Verification job, we require:
A selfie of the user
An image of the document
The country of issuance
The ID type of the document (this must be one of our supported documents)
The Three Components of an Enhanced Document Verification
Document Authentication: Like Document Verification, Enhanced Document Verification allows you to verify the authenticity of identity documents by checking security features, MRZ and barcodes.
User Authentication: Next, it confirms that the submitted ID document belongs to the user by comparing their submitted selfie with the photo on the document. This step ensures that the person presenting the document is its rightful owner.
Issuer Data Cross-Check: Enhanced Document Verification cross-references the document data with official government database records. This step double-checks the document's legitimacy by comparing the OCR information extracted from the document to a record on a government ID registry.
Supported Documents
These are only the documents supported by Enhanced Document Verification. Please refer to the supported regions in our documentation for the complete list of documents supported on our Document Verification product.
Country | Country Code | ID Type | Details |
---|---|---|---|
Ghana | GH | PASSPORT | Passport |
Ghana | GH | SOCIAL_ID | SSNIT |
Ghana | GH | VOTER_ID* | New Voter's ID |
Kenya | KE | RESIDENT_ID | Alien Card |
Kenya | KE | IDENTITY_CARD | National ID |
Kenya | KE | PASSPORT | Passport |
Nigeria | NG | VOTER_ID | Voter's ID |
South Africa | ZA | IDENTITY_CARD | National ID and Greenbook |
*Only supports Ghana Voter IDs issued from 2020
Integration Options
Available via the Rest API
Image Specifications
Please ensure that the orientation of your document images matches the way information is printed on the document. For example, if the document is meant to be read vertically(portrait) like a passport, do not rotate the image to a horizontal (landscape) orientation.
To check the authenticity of the document, we require high-resolution images. The image should be cropped to include the entire document with minimal background.
The following are the minimum specifications we require for the document image:
The minimum resolution on the horizontal (longer) side of credit card-sized ID cards should be 1500 pixels.
Minimum resolution on the horizontal (longer) side of passports should be 2200 pixels.
The total Image size should be at least 600KB but no more than 10MB.
To get the best results on document verification, we recommend the document image meets the following criteria:
Ensure the image is not tightly cropped. All edges of the ID document should be visible.
The face in the ID photo should be visible.
The document should be placed on a flat, non-white surface for the capture.
If the document contains an MRZ code, ensure no part of the code is covered by a finger or is cut off in the image.
Avoid fingers covering any part of the document.
Ensure no glare or bright light (flash) obstructs information on the document.
All text on the document must be readable after capture.
Request Values
You need to perform two steps to use this product:
Make a request to Smile ID for a job to be performed
Upload the job payload
NOTE: The value of the job_type
for this product is 11
Making a Job Request
Request Type: POST
Environment | URL |
---|---|
Sandbox | |
Production |
Keys | Type | Required | Description |
source_sdk | string | Yes | The integration option you are using. For rest api send the value as "rest_api" |
source_sdk_version | string | Yes | The version of the integration option you are using |
signature | string | Yes | Your calculated access signature |
timestamp | string | Yes | The timestamp that was used to calculate the signature (in ISO date/time format) |
smile_client_id | string | Yes | This is your partner id which can be found on the side navigation panel of the Smile ID partner portal |
partner_params | object | Yes | A JSON object containing the partner parameters below as well as any additional key value pairs you wish to include for tracking which will be returned in the response |
partner_params.job_type | string | Yes | The type of job you want to perform. This should be set to |
partner_params.job_id | string | Yes | A value generated by you, so you can track jobs on your end. This value must be unique, can be any string and can follow your identifier convention |
partner_params.user_id | string | Yes | A value generated by you, so you can track users on your end. This value must be unique, can be any string and can follow your identifier convention |
model_parameters | string | No | This parameter is specific to mobile SDK, can be left as an empty JSON object |
callback_url | string | Yes | A publicly available endpoint on your system where Smile ID will send the results of a job to in the form of a POST request (with no authorisation headers) |
At the end of the request, you will receive a job number for tracking and a url where you will be uploading your images.
Example Request
In the response body to the prep upload request, you will receive an AWS s3 bucket link. You will upload the images for face and identity document verification to this link. The URL is structured like:
"https://smile-uploads-test.s3.us-west-2.amazonaws.com/videos/
<partner_id>/<partner_id>-<smile_job_id>-<random hash>/attachments.zip
?AWSAccessKeyId=<>
&Content-Type=application%2Fzip
&Expires=1598449184&Signature=<>
&x-amz-security-token=<>&x-amz-server-side-encryption=AES256"
Example Response
200: OK
A record has now been created waiting for the job to be processed once the required data has been uploaded
400: Bad Request
Trying to use a job_id in partner_params that has already been used
Uploading the Job Payload
To perform a job, Smile ID requires a Zip file that contains the following information:
images - images are ID document photos (bearer's face must be visible), selfie and liveness images (optional)
Info.json file - the structure of the info.json file is detailed below
The Zip file must have the same name as the file_name specified while making a job request (prep upload). In the case of the example request above, the filename will be attachments.zip.
Request Type: PUT
Environment | URL |
---|---|
Sandbox | Upload URL you were supplied while making a Job Request |
Production | Upload URL you were supplied while making a Job Request |
The request body will be of type binary (the zip file)
Info.json file
The info.json file contains the selfie and ID card images required to process the document verification job. The images can either be parsed inline as a base64 encoded string, or the image files themselves can be zipped with the info.json file. Only .jpg file type is supported.
The structure of the info.json file is detailed below
Parameter | Description |
---|---|
package_information | This contains information about the rest api you’re calling. We recommend you use the following as the package_information: "package_information": { "apiVersion": { "buildNumber": 0, "majorVersion": 2, "minorVersion": 0 } } |
id_info | The country and id type you want to verify. The uploaded ID card image must match the country and id type you specify in this json object. To view the list of supported documents check the supported documents section on this page. "id_info": { "country":"<country code e.g. KE>", "id_type":"<smile ID type keyword e.g. NATIONAL_ID>" } |
images | The images required for the document verification job. There are 3 image types that can be uploaded:
The images can be added as base64 encoded strings or the image files themselves can be added to the zip and the filename specified in the info.json. { "image_type_id": “varies based on image type and type of upload either base64 string or filename. Read more on image types in FAQs”, "image": "<base64 string of image>", "file_name": "<name of file in the zip that will be uploaded>" } Depending on the image_type_id one of the other parameters (image or file_name) will be an empty string (“”) |
Info.json Example
The zip file contains the info.json file only (if images are inline i.e. supplied as base64 encoded strings) or both an info.json file and image files (if the image files themselves are uploaded).
Example zip file and info.json when images are inline (i.e. base64 encoded strings)
The content of the info.json file below:
Example zip file and info.json when images are uploaded as files
The content of the info.json file below:
How Smile ID Processes the Job
Action | Description |
Proof of life & spoof detection | Performed on user submitted selfie |
Selfie compares | Selfie comparison to user submitted document image |
Document Verification | To verify the document we confirm the following:
|
Return Values
The full list of keys and possible return values are highlighted below:
Name | Type | Description | Value |
PartnerParams.job_id | String | A unique reference defined by you to keep track of the job | |
PartnerParams.job_type | String | The type of job you performed. | 11 |
PartnerParams.user_id | String | A unique reference defined by you to keep track of the user | |
ResultCode | String | Numeric value of the job outcome. | For a list of potential error codes see here. |
ResultText | String | Textual value of the job outcome. Human readable value for the result. | List of all result text is listed here. |
SmileJobID | String | The Smile internal reference number for the job | |
Country | String | The country of issuance of the ID type | |
IDType | String | The ID type of the document ID | |
IDNumber* | String | The ID number extracted from the document ID either by OCR or decoding the MRZ | |
FullName* | String | The full names as retrieved from the ID authority database | |
DOB* | String | The date of birth retrieved from the ID authority database | |
Gender* | String | The gender retrieved from the ID authority database | |
IssuanceDate | string | The issuance date of the document ID retrieved from the ID authority database | |
ExpirationDate* | String | The expiration date of the document ID retrieved from the ID authority database | |
Document | String | The cropped and upright document image returned as a base64 string | |
PhoneNumber* | String | The phone number retrieved from the ID authority database | |
PhoneNumber2* | String | The second phone number retrieved from the ID authority database | |
Address* | String | The address retrieved from the ID authority database | |
signature | String | The outgoing signature, you can use this to verify that the response is from Smile ID | |
timestamp | String | The outgoing timestamp in ISO date/time format, use this to calculate the outgoing Signature | |
Actions | Object | The JSON object contains the results of checks Smile ID performed on the job | |
Actions.Human_Review_Compare | String | If the Smile ID system can not automatically decide on the face compares it will be reviewed by humans and the result will be displayed here | “Passed” “Failed” “Unable to Determine” “Not Applicable” |
Actions.Human_Review_Liveness_Check | String | If the Smile ID system can not automatically decide on the liveness of the user submitted selfie, it will reviewed by humans. The result is displayed here.
NOTE: the machine liveness check result | “Passed” “Failed” “Unable To Determine” “Not Applicable” |
Actions.Liveness_Check** | String | Liveness check on user provided selfie | “Passed” “Failed” “Under Review” “Not Applicable” |
Actions.Register_Selfie | String | Register selfie of user | “Approved” “Rejected” “Not Applicable” |
Actions.Verify_Document | String | Verify the document ID submitted by the user | “Passed” “Failed” “Under Review” “Not Applicable” |
Actions.Return_Personal_Info | String | Return user’s PII from id authority | “Returned” “Not Returned” “Not Applicable” |
Actions.Selfie_To_ID_Card_Compare | String | Compare user-submitted selfie to photo on user-submitted ID card | “Completed” “Under Review” “Not Applicable” |
*Only returned if information is on the physical ID card
** If a single selfie image is provided, the system will only perform a photo of photo check
Example JSON Response
Evaluating the Results
Actions performed on the product are not completed at the same time, so we send results to your callback endpoint when they are ready. Also, if the Smile ID system can not automatically make a decision on an action, it is passed to our human reviewers, and the system decision is sent via callback once the reviewers make a final decision.
The Document Verification can fail for multiple reasons:
A spoof was detected on the submitted selfie - if we believe the selfie has been tampered with or is a picture of a picture, the document verification will fail.
The submitted selfie does not match the face on the document - if the selfie and face on the document do not match, the document verification job will fail.
The OCR extracted information, and the decoded MRZ information do not match, e.g., the name encoded in the MRZ does not match the name that can be seen on the document.
The document image or selfie is blurry.
Some known visible security features on the document are missing, e.g. the coat of arms on a Nigerian driver’s license.
The ID type specified by the user does not match our system’s classification of the document type.
The data on the document does not match the issuer's records
The ID number on the document was not found in the issuer's database
Result Codes and Result Texts
Result codes detail what the current (or final) result of a job is. Result Codes for all jobs fall into one of two categories:
Approved (or Pass) This means that all applicable Actions passed and the overall job was approved.
Rejected (or Fail) This means that one or more of the applicable Actions for the job failed, and thus, the overall job was rejected according to Smile ID standards.
General Failures Result Codes and Texts
This means no further processing is possible on the job. General failures occur when a job cannot be submitted due to a logical/technical issue. These jobs do not appear in the portal or have a Smile Job ID.
Code | Text | Description | Category |
0001 | Data Invalid | Uploaded zip is corrupted | Rejected |
0001 | Data Invalid - Images corrupt or not present | info.json lists an image file that was not included in the zip | Rejected |
0001 | ID Card image not provided | There was no ID card image submitted with the job | Rejected |
0001 | System Error | A system error occurred | Rejected |
0903 | Zip Corrupt | The uploaded Zip file is corrupted. | Rejected |
2405 | Error - "You are not authorised to do that" * | An invalid signature was used to sign the request. | - |
2314 | Error - No Zip File Received | No Zip files was uploaded. | - |
2203 | Error - Invalid JSON | The info.json file in the Zip is not properly structured. Ensure all keys are present and properly named. | - |
2213 | Error - A required parameter is missing | Not all the required keys were submitted in the info.json or request payload. Please check request values for this product. | - |
2204 | Error - A parameter is of the wrong data type | The format of one of the request values was wrong. Please check request values for this product. | - |
2205 | Error - You are not authorised to do that. * | An invalid signature was used to sign the request. Please ensure you are using the correct signature for the environment (ie: sandbox vs production) | - |
2220 | Error - Production is not enabled for this account. Please complete your KYC with Smile ID. | You have not completed your KYC. | - |
2212 | Error - Invalid job type | An invalid value was inputted in the job_type key. Change the value to 6. | - |
2209 | Error - Wrong user id. This user is already enrolled with user_id | An existing user_id was inputted. Enter a unique user id. | |
2215 | Error - Job already exists for | An existing job_id was inputted. Enter a unique job id. | - |
* Read more on how to troubleshoot this error here
Product-Specific Result Codes and Texts
Code | Text | Description | Category |
---|---|---|---|
0810 | Document Verified | Images matched, no spoof was detected on Selfie and the document is valid. | Approved |
0811 | Unable to Verify Document - reason | Document image was usable but document verification failed due to any of the following reasons: - Document is expired - The selfie did not match the photo on document - Selfie failed liveness checks - Some security features were missing on the document - The information on document is inconsistent i.e. the MRZ information did not match the OCR'ed information - A wrong document type was uploaded - The document data does not match the issuer's records - The id number on the document was not found in the issuer's database | Rejected |
0812 | Unable to verify Document - reason | Document verification failed because the document image is unusable or an invalid document image was uploaded e.g. work ID card | Rejected |
0816 | Unable to verify Document - Unsupported Document | Provided document is not supported for KYC i.e. document is one of the following: - Minor's Passport - Carry Permit - Hunting Permit - Sex Offender ID - SIM Card | Rejected |
1014 | Unsupported ID Type | The country_code and or the id_type in the info.json file is not supported, please use any of the supported country_codes and id_types in the documentation | Rejected |
Running in Sandbox
Document verification can be tested in our sandbox environment. However, you will get a simulated response. In the sandbox, the document verification job is processed as described below:
The selfie is compared to the photo on the identity document, if both images do not match, the document verification job fails
The authenticity of the document is not confirmed, and we will always return the document as being valid
The values you parse in
id_type
andcountry
are not checked with the supported countries and IDs
Last updated