Document types
Which documents Hub accepts, and how doc_type maps to source.
The documents Hub can verify, and the two fields that identify them.
Supported documents
doc_type | Document |
|---|---|
passport | Passport |
drivers_license | Driver's licence |
national_card | Provincial photo card |
resident_permit | Permanent resident card |
indigenous_card | Secure Certificate of Indian Status |
health_card | Health card |
Which of these your users can choose is set per client during onboarding. Availability can be further restricted by issuing country and province — health cards in particular are commonly limited to specific provinces.
national_cardis a provincial photo card, not a national identity card. The value name is misleading.
Forindigenous_card, only the Secure Certificate of Indian Status is accepted.
doc_type and source
doc_type and sourceThe userinfo response contains both fields. Here's how they differ:
| Field | What it is | Use it? |
|---|---|---|
doc_type | Hub's own document type | Yes |
source | The document type from the document-scanning provider | Informational only |
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 |
source is also how you tell a document result from a bank result in Select mode: bank verification returns source: "bank".
What each document returns
Not every document carries every field. This matters most for address.
doc_type | Address | Nationality |
|---|---|---|
drivers_license | Yes | N/A |
national_card | Yes | N/A |
passport | N/A | Yes |
resident_permit | N/A | Yes |
indigenous_card | N/A | N/A |
health_card | N/A | N/A |
Fields not available for a document type
Plan for fields a document doesn't carryIf your process relies on a field such as
addressornationality, check which documents carry it in the table above. When a document doesn't carry a field, Hub returns the literal string"N/A", notnull, an empty string or an absent key.
Here are some of the claims from a passport response. The full response is in Full examples by document type.
{
"doc_type": "passport",
"address": {
"country": "N/A",
"locality": "N/A",
"postal_code": "N/A",
"region": "N/A",
"street_address": "N/A"
},
"nationality": "CAN",
"dcn": "N/A",
"acn": "N/A"
}So this check does not work:
if claims.get("address", {}).get("postal_code"):
# Passes for a passport - postal_code is the string "N/A"
save_postal_code(...)if (claims.address?.postal_code) {
// Passes for a passport - postal_code is the string "N/A"
savePostalCode(...);
}if (!claims.path("address").path("postal_code").asText().isEmpty()) {
// Passes for a passport - postal_code is the string "N/A"
savePostalCode(...);
}if (!string.IsNullOrEmpty(claims["address"]?["postal_code"]?.GetValue<string>()))
{
// Passes for a passport - postal_code is the string "N/A"
SavePostalCode(...);
}"N/A" means the field isn't available for that document type. Check for it explicitly, the same way you'd check for an empty value:
def value_or_none(v):
return None if v in (None, "", "N/A") else v
postal_code = value_or_none(
claims.get("address", {}).get("postal_code")
)const valueOrNull = (v) => ([undefined, null, "", "N/A"].includes(v) ? null : v);
const postalCode = valueOrNull(claims.address?.postal_code);static String valueOrNull(JsonNode v) {
String s = v.asText("");
return s.isEmpty() || s.equals("N/A") ? null : s;
}
String postalCode = valueOrNull(claims.path("address").path("postal_code"));static string? ValueOrNull(string? v) => v is null or "" or "N/A" ? null : v;
var postalCode = ValueOrNull(claims["address"]?["postal_code"]?.GetValue<string>());This also affects subject matching: a passport can't be matched on postal code, so that attribute scores 0.
Full examples by document type
The same person, verified with each supported document. Compare the tabs to see which fields carry real values and which come back as "N/A".
{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "drivers_license",
"source": "driving_licence",
"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",
"doc_type": "passport",
"source": "passport",
"scan_result": "CLEAR",
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"address": {
"street_address": "N/A",
"locality": "N/A",
"region": "N/A",
"postal_code": "N/A",
"country": "N/A"
},
"doc_number": "GM123456",
"issue_date": "2021-03-15",
"expiry_date": "2031-03-15",
"issuing_country": "CA",
"issuing_authority": "CA",
"nationality": "CAN",
"dcn": "N/A",
"acn": "N/A",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "national_card",
"source": "national_identity_card",
"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": "123AA4567890",
"issue_date": "2021-03-15",
"expiry_date": "2031-03-15",
"issuing_country": "CA",
"issuing_authority": "ON",
"nationality": "N/A",
"dcn": "PC7654321",
"acn": "0087654321",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "resident_permit",
"source": "residence_permit",
"scan_result": "CLEAR",
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"address": {
"street_address": "N/A",
"locality": "N/A",
"region": "N/A",
"postal_code": "N/A",
"country": "N/A"
},
"doc_number": "AA1234567",
"issue_date": "N/A",
"expiry_date": "2031-03-15",
"issuing_country": "CA",
"issuing_authority": "CA",
"nationality": "USA",
"dcn": "N/A",
"acn": "N/A",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "indigenous_card",
"source": "indigenous_card",
"scan_result": "CLEAR",
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"address": {
"street_address": "N/A",
"locality": "N/A",
"region": "N/A",
"postal_code": "N/A",
"country": "N/A"
},
"doc_number": "110566685",
"issue_date": "2021-03-15",
"expiry_date": "2031-03-15",
"issuing_country": "CA",
"issuing_authority": "CA",
"nationality": "N/A",
"dcn": "N/A",
"acn": "N/A",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}{
"sub": "4aa2e0dc889045edb251e584d1d3b7f8",
"doc_type": "health_card",
"source": "national_health_insurance_card",
"scan_result": "CLEAR",
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"address": {
"street_address": "N/A",
"locality": "N/A",
"region": "N/A",
"postal_code": "N/A",
"country": "N/A"
},
"doc_number": "ZE000509",
"issue_date": "2021-03-15",
"expiry_date": "2031-03-15",
"issuing_country": "CA",
"issuing_authority": "ON",
"nationality": "N/A",
"dcn": "N/A",
"acn": "N/A",
"com.securekey.verified.me.ui_locale": "en-CA",
"com.securekey.vids.job_id": "d306f935-cb23-4a39-8acc-232eed539e1e"
}
Names come back in uppercase. They're read off the document, so expectDOErather thanDoe. Normalise before displaying or comparing.
These are all CLEAR results. For what a SUSPECTED or REJECTED response looks like, see Document verification and Fraud flags.
Issuing fields
| Field | Example | Notes |
|---|---|---|
issuing_country | CA | ISO 3166 alpha-2 |
issuing_authority | ON, CA | Province for provincially issued documents, country otherwise |
nationality | CAN, N/A | ISO 3166 alpha-3 where present |
issuing_countryuses two-letter codes (CA) whilenationalityuses three (CAN). Addresscountrymay also appear asCANin some document responses. Don't assume one format across fields — normalise before comparing.
Related
Updated 3 days ago