Document Verification
Required Class: SmileIdentityCore Class
Running Document Verification on PHP
Get your Smile ID
Partner IDGet your API Key
Create a Callback Endpoint
Get your user's Selfie images
Get the user's ID document image
Submit the Job to Smile ID
Interpret your results
Get your Partner ID
You can find your Partner ID in the menu list when logged into the portal.

Get your API Key
Your API Key is also in the developer section of the portal.
Click on the Generate New API Key button
Copy your api key (ensure you are in the right environment)


Create a Callback Endpoint
Responses from this product are asynchronous (based on various actions we carry out on the product) and are sent as soon as they are ready, you will need to setup a callback when submitting a job. You can read about creating a Callback URL here.
Get the User's Selfie
To successfully run document verification jobs you need to submit the user's selfie. There are two types of selfies that can be submitted
Selfie - a single colour-image selfie of user
(optional but required for proof of live) Liveness images - 8 colour images of user
The selfies can either be submitted as files (with the path to the image specified during submission) or as base64 encoded strings.
Get the ID Document Image from your User
In addition to the user's selfie, we also need an image of the ID document to complete a document verification job. We will also need the country of issuance of the ID document and the document type. For the full list of document types we support, you can check the Supported Documents section of the docs. To check the authenticity of the document, we require high resolution images, please read the minimum specification of the document image and best practices in document verification product page.
Submit the Job to Smile ID
You can copy the sample code below and edit with your partner and job details.
Getting the Job Result
By default you always get the result of your job in the callback url you provided, however for some use cases you might want to get the job result in sync after submission. The flag return_job_status can be set to true if you want to get the job result in sync.
Response when return_job_status is set to false
return_job_status is set to falseIf return_job_status is set to false, the response will be a JSON string containing:
The job result will be sent to the callback url you provided, it will look as follows:
Response when return_job_status is set to true
return_job_status is set to trueIf you have use cases that require you to get the result in sync, you can set the return_job_status to true. Please note that it can take up to 1 minute 30 seconds to get an in sync result as there are times when the submitted job requires human review.
If you set return_job_status to true (with image_links and history also set to true) then you will receive the JSON object containing the machine result like below:
Interpret your Results
You can read more about result codes and responses in the Document Verification section of the docs.
Last updated
Was this helpful?

