Document Verification

Running Document Verification on Flutter

  1. Create a Callback Endpoint

  2. Get your user's Selfie images

  3. Get the user's ID document image

  4. Submit the Job to Smile ID

  5. Interpret your results

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.Please see SmartSelfie capture as specified here, another option is to capture both selfie and id card in one go as specified here .It is important to recognise that the tag supplied and or returned from this is what will need to be used to submit the Job

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. Please see ID card capture as specified here and another option is to capture both selfie and id card in one go as specified here

Submit the Job to Smile ID

Step 1.Set the User Identity Information to be validated

The Document Verification product does not require the id_number of the user. Please do not include the id_number key in the userIdInfo HashMap.

// Instantiate the metadata which

var userIdInfo = HashMap<String, String>();

//Set country
userIdInfo["country"] = <Country>; //String Alpha-2 country code

//Set id type
userIdInfo["id_type"] = <ID Type>;

userIdInfo["allow_re_enroll"] = <true/false> //==> will allow reuse of user ids
userIdInfo["use_enrolled_image"] = <true/false> // ==> will allow to update enrolled selfie
var partnerParams = HashMap<String, String>();
partnerParams["user_id"] = <User ID>;
partnerParams["job_id"] = <Job ID>;

Step 3: Optional Set Geo Information

var geoInfo = HashMap<String, String>();
geoInfo["altitude"] = <Altitude>;// a string value of a latitude
geoInfo["longitude"] = <Longitude>;// a string value of a longitude

Step 4: Submit the Job

 var submitResult = await SmileFlutter.submitJob( String tag,
      int jobType,
      bool isProduction,
      String callBackUrl,
      Map<String, String>? partnerParams,
      Map<String, String>? idInfo,
      Map<String, String>? geoInfo);
  • jobType should be set to 6 and is required

  • isProduction (required)should be set to true if you intent to run in production and false if you intend to run in sandbox, it is important to note you cannot run real ID Numbers check on sandbox, for test data please see here

  • callBackUrl (Optional)can be null but if not it should be a url which the job data will be posted to depending on the status the job is in

  • partnerParams (Optional)This is the object create in the step above related to partner params

  • idInfo (Required)This is the object create in the step above related to user id information

  • geoInfo (Optional) This is any information that may be necessary to associate the job with any geolocation

Step 5: Interpret your results

SIDResponse object will contain results returned from the api this contains strongly typed method to get the response as individual items or as json object or as a string, for more information on how to interpret results you can read more about result codes and responses in the Document Verification section of the docs.

Last updated