LogoLogo
  • Welcome!
  • GETTING STARTED
    • Signing Up
    • Choose a Product
    • Choose an Integration Option
    • Run Your First Test Job
    • Complete Your KYC
    • Fund Your Wallet
    • Go Live!
    • Pricing
  • SUPPORTED ID TYPES & DOCUMENTS
    • For Individuals (KYC)
      • Using ID Number
        • Supported Countries
          • Côte d'Ivoire
            • National ID (without Photo)
            • Resident ID (without Photo)
          • Ghana
            • Ghana Card
            • Passport
            • Voter's ID
          • Kenya
            • Alien Card
            • KRA Pin
            • National ID
            • National ID (without Photo)
            • Passport
            • Tax Information
          • Nigeria
            • Bank Account
            • BVN
            • NIN V2
            • NIN Slip Verification
            • V_NIN (Virtual NIN)
            • Phone Number
            • Voter's ID
          • South Africa
            • National ID
            • National ID (without Photo)
            • Phone Number
          • Uganda
            • National ID (without Photo)
            • Basic KYC in Uganda
          • Zambia
            • Bank Account
            • TPIN
          • Zimbabwe
            • National ID (without Photo)
        • Test Data
          • Customising Sandbox Test Data
        • ID Number Regex
        • Visual Samples of Supported ID Types
      • Using Document Image
        • Continents
          • Africa
          • Asia and the Middle East
          • Europe
          • North America
          • Oceania
          • South America
    • For Businesses (KYB)
      • Supported Countries
        • Nigeria
          • Business Registration
          • Tax Information
        • Kenya
          • Business Registration
        • South Africa
          • Business Registration
      • ID Number Regex
  • PRODUCTS
    • For Individuals (KYC)
      • AML Check
        • AML News Media
      • Basic KYC
      • Biometric KYC
      • Digital Address Verification
      • Document Verification
        • Document Verification
        • Enhanced Document Verification
      • Electronic Signature
      • Enhanced KYC
      • Phone Number Verification
      • SmartSelfie™ Authentication
      • SmartSelfie™ Compare
      • Smile Secure
    • For Businesses (KYB)
      • Business Verification
  • Integration Options
    • Mobile
      • Getting Started
      • Products
        • Biometric KYC
        • BVN Consent
        • Document Verification
        • Enhanced Document Verification
        • Enhanced KYC
        • SmartSelfie™ Enrollment and Authentication
        • Enhanced SmartSelfie™ Enrollment And Authentication
      • Customization
        • UI Components
      • Offline Mode
      • Release Notes
        • Android Release Notes
        • iOS Release Notes
        • Flutter Release Notes
        • React Native Release Notes
    • No-Code
      • Smile Links
        • Link FAQs
        • Rest API
    • Server to Server
      • Ruby
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
          • KYB - Business Verification
          • AML Check
        • Generate Token for Web Integration
        • Utilities
      • Python
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
          • Business Verification
        • Generate Token for Web Integration
        • Utilities
      • Java
        • Release Notes
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
        • Generate Token for Web Integration
        • Utilities
      • Node.js
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • Enhanced Document Verification
          • SmartSelfie™ Authentication
          • Business Verification
        • Generate Token for Web Integration
        • Utilities
      • PHP
        • Installation
        • Signature
        • Products
          • Basic KYC
          • Enhanced KYC
          • Biometric KYC
          • Document Verification
          • SmartSelfie™ Authentication
        • Generate Token for Web Integration
        • Utilities
    • Rest API
      • Signing your API Request
        • Using Signature
      • Products
      • Postman Collection
      • Utilities
    • Web / Mobile Web
      • Web Integration
        • Installation
        • Usage
        • End User Consent
        • Support
      • Javascript SDK
        • Installation
        • Usage
        • Migration
        • Deprecated Version
          • Installation
          • Usage
          • Notes
          • Support
  • FURTHER READING
    • FAQs
      • What are your support hours?
      • How do I set up a callback?
      • How to re-enroll, deactivate or delete a user?
      • Add or remove team members
      • What are top-level keys?
      • What are partner_params?
      • How do job types map to the new product names?
      • Is there an API I can use to monitor my wallet balance?
      • Is there an API I can query to check the availability status of an ID type?
      • How do I integrate Smile ID in other countries or query other ID types?
      • What are the image types I can upload to Smile ID?
      • Why aren't Kenyan IDs returning images for some IDs queried?
      • Why are some of my bank verification requests returning 'ID authority unavailable'?
      • How can I look up a specific user's data?
      • Selfie best-practices
      • Document capture best-practices
      • What happens under the hood?
      • Guide to the user consent screen
      • What is code 2302?
      • Using the Demo App and Scanning QR codes
    • Job status
    • KYC receipts
    • Result codes
      • Error codes
    • Securing your account with two-factor authentication (2FA)
    • Security Overview
    • Troubleshooting
      • Troubleshooting error 2204 & 2205 - "You're not authorized to do that"
      • Why is my Web API job taking so long?
      • Image capture issues on web client
Powered by GitBook
On this page
  • Running Document Verification on Java
  • Get your Partner ID
  • Get your API Key
  • Create a Callback Endpoint
  • Get the User's Selfie
  • Get the ID Document Image from your User
  • Submit the Job to Smile ID

Was this helpful?

  1. Integration Options
  2. Server to Server
  3. Java
  4. Products

Document Verification

PreviousBiometric KYCNextSmartSelfie™ Authentication

Last updated 11 months ago

Was this helpful?

Required Class: WebApi Class

Running Document Verification on Java

  1. Get your Smile ID Partner ID

  2. Get your API Key

  3. Create a Endpoint

  4. Get your user's Selfie images

  5. Get the user's ID document image

  6. Submit the Job to Smile ID

  7. Interpret your results

Get your Partner ID

You can find your Partner ID in the menu list when logged into .

Get your API Key

  • Click on the Generate New API Key button

  • Copy your api key (ensure you are in the right environment)

Create a Callback Endpoint

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

Submit the Job to Smile ID

You can copy the sample code below and edit with your partner and job details.

String partnerId = "<Put your partner ID here>";
String defaultCallback = "<Put your default callback url here>";
String apiKey = "<Put your API key here>";
String sidServer = "< 0 || 1 >";  // Use '0' for the sandbox server and '1' for production

WebApi connection = new WebApi(partnerId, apiKey, defaultCallback, sidServer);
// Create required tracking parameters
Map<String, Object> optionalInfo = new HashMap(); // map of optional parameters partner uses to track jobs. can be left empty
PartnerParams params = new PartnerParams(JobType.DOCUMENT_VERIFICATION, "<unique ID for user>", "< unique job ID >", optionalInfo);

// Create image list
// ImageType - This infers to either a file or a base64 encoded image, but not both.
// If using base 64 encoded image, pass in the encoded string as the second parameter and set fileName to null.
// If using file, set image parameter to null and filename to path to file
// ImageType.SELFIE - Selfie image jpg (if you have the full path of the selfie)
// ImageType.SELFIE_BASE64 - Selfie image jpg base64 encoded (if you have the base64image string of the selfie)
// ImageType.LIVENESS - Liveness image jpg (if you have the full path of the liveness image)
// ImageType.LIVENESS_BASE64 - Liveness image jpg base64 encoded (if you have the base64image string of the liveness image)
// ImageType.ID_CARD - Front of ID document image jpg (if you have the full path of the selfie)
// ImageType.ID_CARD_BASE64 - Front of ID document image jpg base64 encoded (if you have the base64image string of the selfie)
// ImageType.ID_CARD_BACK - Back of ID document image jpg (if you have the full path of the selfie)
// ImageType.ID_CARD_BACK_BASE64 - Back of ID document image jpg base64 encoded (if you have the base64image string of the selfie)

List<ImageDetail> imageDetails = new ArrayList<>();

ImageDetail selfie = new ImageDetail(ImageType.SELFIE, null, "< path to file >");
ImageDetail liveness = new ImageDetail(ImageType.LIVENESS_BASE64, "< base 64 encoded liveness >", null);
ImageDetail idDocument = new ImageDetail(ImageType.ID_CARD, null, "< path to file >");
ImageDetail backOfIdDocument = new ImageDetail(ImageType.ID_CARD_BACK_BASE64, "< base 64 encoded image >", null);

imageDetails.add(selfie);
imageDetails.add(liveness); // not required if you dont require proof of life. photo check will still be performed on selfie
imageDetails.add(idDocument);
imageDetails.add(backOfIdDocument); // Optional, only use if you're uploading the back of the id document image

IdInfo idInfo = new IdInfo("< 2 letter country code >", "< id type >");

// Options for the job
boolean returnJobStatus = false; // Set to true if you want to get
// the job result in sync (in addition to the result been sent to
// your callback). If set to false, result is sent to callback url only
boolean returnHistory = false; // Set to true to receive all of the
// updates you would otherwise have received in your callback as
// opposed to only the final result. You must set return_job_status
// to true to use this flag.
boolean returnImageLinks = false; // Set to true to receive links to
// the selfie and the photo it was compared to. You must set
// return_job_status to true to use this flag.
String callBackUrl = "< optional callback url to use for this job only >";
Options options = new Options(returnHistory, returnImageLinks, returnJobStatus, callBackUrl);

connection.submitJob(params, imageDetails, idInfo, options);

Your API Key is also in the developer section of

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 .

We recommend that you use our to capture both of these types of images

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 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 .

the portal.
here
Web SDK
Callback
the portal
Supported Documents
document verification product page
Generate a new API Key
Copy your API Key