ID Document to Selfie Matching

Verify the identity of a person using a Selfie Photo and an ID Document

Appruve makes it easy to implement a selfie photo verification flow using an ID Document. There are three steps involved.

1. Perform OCR

The first step is to perform an OCR on the ID Document using one of the OCR For Sequential Verification endpoints. The PII details on the document is extracted. Once the extraction is successful, Appruve will do a lookup of the ID record from the Government database. If a valid Government ID record is found, Appruve will use the photo returned (unless there is no photo associated with the record in which case Appruve will crop the photo on the ID document) to match against the face in the Selfie that is uploaded subsequently. You can pass an optional custom_params object to store custom information. This information will be returned alongside the verification result object. A unique transaction_reference id will be returned. Use this in the next steps where transaction_reference is requested.

Example request:

curl --location --request POST 'https://api.appruve.co/v1/verifications/selfie_image/ocr/gh/passport' \
--header 'Authorization: Bearer <token>' \
--form 'id_image=@/Users/path/p1.jpg' \
--form 'custom_params[userId]=323323' \
--form 'custom_params[firstName]=John' \
--form 'custom_params[lastName]=Doe'

Example response:

{
    "id_details": {
        "first_name": "John",
        "last_name": "Bruce",
        "passport_number": "G0000000",
        "date_of_birth": "1976-10-07",
        "date_of_issue": "2019-07-29",
        "date_of_expiry": "2029-07-30",
        "place_of_issue": "Accra",
        "id_photo": "url"
    },
    "transaction_reference": "f6ae7736-e9ba-43a4-b80f-afbca4eb47e0",
    "face_sharpness": 99.55,
    "face_brightness": 76.81
}

2. Perform Face Liveness Check (Optional)

See the Face Liveness Check section on how to do this.

3. Upload the selfie photo

Upload the selfie photo taken by the user using the Upload Selfie Photo endpoint. Appruve will match the face on the selfie photo against the face on the matched Government ID record (or the face cropped from the ID document).

Example request:

curl --location --request POST 'https://api.appruve.co/v1/verifications/selfie_image/upload' \
--header 'Authorization: Bearer ' \
--form 'selfie_image=@/Users/img.jpg' \
--form 'transaction_reference=93ca2d74-e11e-4044-82d9-da7db4225045'

Example response:

{
  "success": true,
  "id": "93ca2d74-e11e-4044-82d9-da7db4225045",
  "confidence_score": 100,
  "id_type": "passport",
  "country_code": "gh",
  "status": "success",
  "face_on_id_document": "url",
  "face_match_percent": 100,
  "id_match_percent": 100,
  "selfie_face_url": "url",
  "selfie_image_submitted": "url",
  "id_face_sharpness": 87,
  "id_face_brightness": 96,
  "selfie_face_sharpness": 88,
  "selfie_face_brightness": 90,
  "id_details": {},
  "created_at": "2020-05-10",
  "custom_params": {}
}

Use Webhooks if you want to receive the verification result within your server side application.

Last updated