Document verification (DVS)

Verify a user by scanning a government-issued ID and matching a selfie.

Interac Document Verification Service (DVS) verifies a user by scanning a government-issued ID and comparing a live selfie to the photo on it.

Use this when you need to verify someone who may not bank with a participating financial institution.

Scope

openid document_scope

Your exact scope name is set during onboarding and may differ. Check with your Interac representative.

How it works

  1. You start a verification as described in Step 2.
  2. The user sees the documents your client accepts and photographs their ID. The document type is detected automatically.
  3. The user takes a selfie.
  4. Hub checks the document is genuine and the selfie matches it.
  5. You collect the results from the userinfo endpoint.

Supported documents

Documentdoc_type
Passportpassport
Driver's licencedrivers_license
Provincial photo cardnational_card
Permanent resident cardresident_permit
Secure Certificate of Indian Statusindigenous_card
Health cardhealth_card
📘

Which of these your client accepts is set during onboarding. Availability can also be restricted by issuing country and province. Health cards, for example, are commonly limited to specific provinces.

doc_type and source are not the same thing

The userinfo response contains both. Here's how they differ:

FieldWhat it is
doc_typeHub's document type. Use this one.
sourceThe document type from the document-scanning provider. Informational.

They map like this:

doc_typesource
passportpassport
drivers_licensedriving_licence
national_cardnational_identity_card
resident_permitresidence_permit
indigenous_cardindigenous_card
health_cardnational_health_insurance_card

The result: scan_result

Every document verification returns a scan_result.

ValueMeaning
CLEARThe document passed.
SUSPECTEDSomething looks wrong — possible tampering or a failed selfie match.
REJECTEDThe scan failed outright — unreadable image, unsupported document, expired.

When the result is SUSPECTED or REJECTED, Hub also returns flags explaining why. See Fraud flags.

Example userinfo response

A successful driver's licence scan. The second tab shows the same response with document and selfie images set to true, with the image data shortened.

{
  "sub": "4aa2e0dc889045edb251e584d1d3b7f8",
  "source": "driving_licence",
  "doc_type": "drivers_license",
  "scan_result": "CLEAR",
  "given_name": "JOHN",
  "family_name": "DOE",
  "birthdate": "1965-03-03",
  "address": {
    "street_address": "4101 Yonge Street",
    "locality": "Toronto",
    "region": "ON",
    "postal_code": "M2P 1N6",
    "country": "CAN"
  },
  "doc_number": "S12345678901234",
  "issue_date": "2021-03-15",
  "expiry_date": "2031-03-15",
  "issuing_country": "CA",
  "issuing_authority": "ON",
  "nationality": "N/A",
  "dcn": "RG1234567",
  "acn": "0012345678",
  "com.securekey.verified.me.ui_locale": "en-CA",
  "com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}
{
  "sub": "4aa2e0dc889045edb251e584d1d3b7f8",
  "source": "driving_licence",
  "doc_type": "drivers_license",
  "scan_result": "CLEAR",
  "given_name": "JOHN",
  "family_name": "DOE",
  "birthdate": "1965-03-03",
  "address": {
    "street_address": "4101 Yonge Street",
    "locality": "Toronto",
    "region": "ON",
    "postal_code": "M2P 1N6",
    "country": "CAN"
  },
  "doc_number": "S12345678901234",
  "issue_date": "2021-03-15",
  "expiry_date": "2031-03-15",
  "issuing_country": "CA",
  "issuing_authority": "ON",
  "nationality": "N/A",
  "dcn": "RG1234567",
  "acn": "0012345678",
  "com.securekey.verified.me.ui_locale": "en-CA",
  "com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e",
  "doc_image_front": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
  "doc_image_back": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...",
  "selfie_image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD..."
}
📘

Each document returns a different set of fields. A driver's licence carries an address; a passport doesn't. For a worked example of all six, see Document types.

❗️

Fields a document doesn't carry come back as the string "N/A"

A passport carries no address, so every address sub-field is the literal string "N/A" — not null, not absent. A truthiness check will pass. See Document types.

This matters if you also use subject matching, because a passport can't be matched on postal code.

Document control and audit control numbers

Some documents carry secondary numbers in addition to the main document number. Hub returns them so you can run additional checks of your own.

FieldWhat it is
dcnDocument control number: a secondary number on the front of the document
acnAudit control number: a secondary number on the back of the document

Which documents carry these numbers depends on the issuer. When a value isn't available, it's "N/A".

For every field, see the Claims dictionary.

Configuration options

Your Interac representative sets these during onboarding. Quote the reference name when you ask for a change. See Configuration options.

OptionReference nameDefaultWhat it does
Partial document resultsallowPartialResultsfalseWhether you receive results for failed scans. See below.
Expired documentsallowExpiredDocsfalsetrue: an expired document still passes as CLEAR. false: it's REJECTED with the document_expiration flag.
Document imagescollectDocImagesfalseReturns doc_image_front and doc_image_back as base64 images.
Selfie imagecollectSelfiefalseReturns selfie_image as a base64 image.
📘

Availability

Document images (collectDocImages) and Selfie image (collectSelfie) are enabled per client and subject to contractual agreement. Contact your Interac representative to confirm availability for your integration.

Partial document results (allowPartialResults)

This decides what you get when a scan comes back SUSPECTED or REJECTED.

SettingWhat happens
trueYou get scan_result, the fraud flags, and the user's details from the userinfo endpoint. You decide what to do next.
falseThe user is redirected back with error_description=Document+R or Document+S. You get no scan results at all.

Set it to true if you want to handle failures yourself — for example, offering the user a retry or another way to verify.

📘

Using subject matching as well? With Partial document results set to true, a scan that isn't CLEAR still reaches you — but Hub skips the match and reports it as a failed match with a score of 0. See When matching doesn't run.

Document and selfie images

With Document images (collectDocImages) or Selfie image (collectSelfie) set to true, the response includes the images captured during the scan.

FieldContainsNotes
doc_image_frontThe front of the document
doc_image_backThe back of the documentNot included for passports
selfie_imageThe selfie the user took

Each value is a JPEG as a base64 data URI: data:image/jpeg;base64, followed by the image data. In dual mode and subject matching, the images are inside the nested com.securekey.vids object.

Sizes vary by device and document. As a guide:

ImageTypical dimensionsTypical sizeSize in the response (base64)
Document front or back1024 × 644 px~450–500 KB each~600–650 KB each
Selfie1080 × 1920 px~2.2 MB~2.9 MB

With all three images, expect a userinfo response of around 4 MB.

When an image isn't available, the value is "N/A". This also happens when a scan is REJECTED with minimum_accepted_age, supported_document or filtered_document. For those, Hub withholds all personal data from the scan, including the images. See Fraud flags.

To save an image to a file:

import base64

def save_image(value, path):
    if not value or value == "N/A":
        return False
    data = value.split(",", 1)[1]  # drop the "data:image/jpeg;base64," prefix
    with open(path, "wb") as f:
        f.write(base64.b64decode(data))
    return True
import { writeFileSync } from "node:fs";

function saveImage(value, path) {
  if (!value || value === "N/A") return false;
  const data = value.split(",")[1]; // drop the "data:image/jpeg;base64," prefix
  writeFileSync(path, Buffer.from(data, "base64"));
  return true;
}
static boolean saveImage(String value, Path path) throws IOException {
    if (value == null || value.isEmpty() || value.equals("N/A")) return false;
    String data = value.split(",", 2)[1]; // drop the "data:image/jpeg;base64," prefix
    Files.write(path, Base64.getDecoder().decode(data));
    return true;
}
static bool SaveImage(string? value, string path)
{
    if (string.IsNullOrEmpty(value) || value == "N/A") return false;
    var data = value.Split(',', 2)[1]; // drop the "data:image/jpeg;base64," prefix
    File.WriteAllBytes(path, Convert.FromBase64String(data));
    return true;
}
🚧

Treat images as sensitive data. They show the user's face and ID. Don't log them, and keep them only as long as you need to. At several megabytes per response, allow for them in timeouts and payload limits.

Errors

A failed verification arrives at your redirect_uri with error and error_description. Values are URL-encoded in the URL (Document+R means Document R). Most web frameworks decode them for you.

These are all the values document verification returns:

errorerror_descriptionWhen
access_deniedDocument RThe document was rejected, and Partial document results (allowPartialResults) is false
access_deniedDocument SThe document was suspected, and Partial document results (allowPartialResults) is false
access_deniedDocument errorA system error while processing the scan
access_deniedDocument idv_expiredThe scanning session expired before the user finished
access_deniedUser cancelledThe user cancelled, declined the terms, or declined camera access
access_deniedService errorAn internal error outside the scan itself
session_expiredThe session has expiredThe session timed out before the user finished
access_deniedDocument completed but data could not be matchedSubject matching only. The document details didn't match your subject.

Document R includes users below your minimum age (minimum_accepted_age) and documents your client doesn't accept (supported_document, filtered_document). The error doesn't say why. To get the reasons, set Partial document results to true: you then receive a code instead of these two errors, and read scan_result and the fraud flags from userinfo.

With detailed error reporting

Clients configured for detailed error reporting always receive error=access_denied and a structured error_description instead. Document verification values have no stage.

error_descriptionWhen
err:document_rejectedThe document was rejected. The flags are in the Auth Report API.
err:document_suspectedThe document was suspected. The flags are in the Auth Report API.
err:user_cancelled$details:cancelled_on_idv_guidance_pageThe user cancelled on the instructions screen, before scanning
err:user_cancelled$details:document_idv_cancelledThe user cancelled during scanning, declined the terms, or declined camera access
err:system_errorA system error while processing the scan, the scanning session expired, or another internal error
err:session_timeoutThe session timed out

With subject matching:

error_descriptionWhen
err:idv_data_matching_failed$details:mismatchThe document details didn't match your subject. The score is in the Auth Report API.
err:idv_data_matching_failed$details:no_document_claimsA system error while processing the scan, or the scanning session expired. Only with Partial results (acceptPartialResult) true.
err:system_error$details:matching_errorThe comparison failed with a system error, for example a field left out of your subject

See Error reference for every value, and Detailed error reference if your client has detailed error reporting.

Limitations

  • Passports, permanent resident cards, indigenous cards and health cards return "N/A" for address.
  • Available document types are fixed per client at onboarding — users can't pick outside that list.
  • Document availability can be further restricted by issuing country and province.

Related