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
- You start a verification as described in Step 2.
- The user sees the documents your client accepts and photographs their ID. The document type is detected automatically.
- The user takes a selfie.
- Hub checks the document is genuine and the selfie matches it.
- You collect the results from the userinfo endpoint.
Supported documents
| Document | doc_type |
|---|---|
| Passport | passport |
| Driver's licence | drivers_license |
| Provincial photo card | national_card |
| Permanent resident card | resident_permit |
| Secure Certificate of Indian Status | indigenous_card |
| Health card | health_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
doc_type and source are not the same thingThe userinfo response contains both. Here's how they differ:
| Field | What it is |
|---|---|
doc_type | Hub's document type. Use this one. |
source | The document type from the document-scanning provider. Informational. |
They map like this:
doc_type | source |
|---|---|
passport | passport |
drivers_license | driving_licence |
national_card | national_identity_card |
resident_permit | residence_permit |
indigenous_card | indigenous_card |
health_card | national_health_insurance_card |
The result: scan_result
scan_resultEvery document verification returns a scan_result.
| Value | Meaning |
|---|---|
CLEAR | The document passed. |
SUSPECTED | Something looks wrong — possible tampering or a failed selfie match. |
REJECTED | The 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
addresssub-field is the literal string"N/A"— notnull, 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.
| Field | What it is |
|---|---|
dcn | Document control number: a secondary number on the front of the document |
acn | Audit 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.
| Option | Reference name | Default | What it does |
|---|---|---|---|
| Partial document results | allowPartialResults | false | Whether you receive results for failed scans. See below. |
| Expired documents | allowExpiredDocs | false | true: an expired document still passes as CLEAR. false: it's REJECTED with the document_expiration flag. |
| Document images | collectDocImages | false | Returns doc_image_front and doc_image_back as base64 images. |
| Selfie image | collectSelfie | false | Returns selfie_image as a base64 image. |
AvailabilityDocument 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)
allowPartialResults)This decides what you get when a scan comes back SUSPECTED or REJECTED.
| Setting | What happens |
|---|---|
true | You get scan_result, the fraud flags, and the user's details from the userinfo endpoint. You decide what to do next. |
false | The 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 totrue, a scan that isn'tCLEARstill 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.
| Field | Contains | Notes |
|---|---|---|
doc_image_front | The front of the document | |
doc_image_back | The back of the document | Not included for passports |
selfie_image | The 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:
| Image | Typical dimensions | Typical size | Size in the response (base64) |
|---|---|---|---|
| Document front or back | 1024 × 644 px | ~450–500 KB each | ~600–650 KB each |
| Selfie | 1080 × 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 Trueimport { 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:
error | error_description | When |
|---|---|---|
access_denied | Document R | The document was rejected, and Partial document results (allowPartialResults) is false |
access_denied | Document S | The document was suspected, and Partial document results (allowPartialResults) is false |
access_denied | Document error | A system error while processing the scan |
access_denied | Document idv_expired | The scanning session expired before the user finished |
access_denied | User cancelled | The user cancelled, declined the terms, or declined camera access |
access_denied | Service error | An internal error outside the scan itself |
session_expired | The session has expired | The session timed out before the user finished |
access_denied | Document completed but data could not be matched | Subject 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_description | When |
|---|---|
err:document_rejected | The document was rejected. The flags are in the Auth Report API. |
err:document_suspected | The document was suspected. The flags are in the Auth Report API. |
err:user_cancelled$details:cancelled_on_idv_guidance_page | The user cancelled on the instructions screen, before scanning |
err:user_cancelled$details:document_idv_cancelled | The user cancelled during scanning, declined the terms, or declined camera access |
err:system_error | A system error while processing the scan, the scanning session expired, or another internal error |
err:session_timeout | The session timed out |
With subject matching:
error_description | When |
|---|---|
err:idv_data_matching_failed$details:mismatch | The document details didn't match your subject. The score is in the Auth Report API. |
err:idv_data_matching_failed$details:no_document_claims | A system error while processing the scan, or the scanning session expired. Only with Partial results (acceptPartialResult) true. |
err:system_error$details:matching_error | The 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
- Document types
- Fraud flags
- Claims dictionary
- Verified credentials — a reusable identity users create once and share in a few taps
Updated 3 days ago