Subject matching
Check the verified result against details you already hold for the user.
Subject matching compares the verified result against details you already hold for the user, and returns a score.
Use this when you have an existing customer record and need to confirm the person verifying is that same customer.
Before you start
Two requirements:
- Your client must have subject matching enabled. It's configured during onboarding.
- You must use PAR. Subject matching only works with
POST /auth/par, never withGET /auth. See Step 2.
The reason is privacy: you're sending personal details to Hub, so they go over a back-channel server-to-server request, never through the user's browser.
Sending the subject
The subject goes in the signed request object: the JWT you build in Step 1 of Starting a verification.
- Build the request object payload as usual, and add a
subjectobject to it. - Sign it with your private key.
- Send it to Hub as the
requestparameter ofPOST /auth/par.
The first tab shows the subject object on its own. The second shows it in the full request object payload.
"subject": {
"given_name": "John",
"family_name": "Doe",
"birthdate": "1965-03-03",
"address": {
"postal_code": "M2P 1N6"
}
}{
"iss": "3f6c1a2e-8b47-4d19-9e52-7a0c4b6d1f83",
"aud": "{hub_base_url}/",
"client_id": "3f6c1a2e-8b47-4d19-9e52-7a0c4b6d1f83",
"response_type": "code",
"scope": "openid onlyVme_scope",
"redirect_uri": "https://acme-widgets.example.com/callback",
"state": "5de789881cc944a78e9c1c9d947f7867",
"nonce": "abdd5eed89834b62aee2de7a6ed4d92e",
"ui_locales": "en-CA",
"subject": {
"given_name": "John",
"family_name": "Doe",
"birthdate": "1965-03-03",
"address": {
"postal_code": "M2P 1N6"
}
}
}What gets matched
The default ruleset, default_KYC, matches four attributes:
| Attribute | Path |
|---|---|
| Given name | given_name |
| Family name | family_name |
| Birthdate | birthdate |
| Postal code | address.postal_code |
Other fields in yoursubjectare ignored bydefault_KYCand don't change the score. Check which ruleset your client uses before relying on any other field.
When you don't hold a value
Always include all four fields. If you don't hold a value, send an empty string rather than leaving the field out.
| What you send | Result |
|---|---|
| The value | Scored normally |
An empty string ("") for given_name, family_name or address.postal_code | That attribute scores 0. The other three can still carry the match. |
| A field left out | Matching fails with a system error. There's no score. |
birthdate empty, or not a valid YYYY-MM-DD date | Matching fails with a system error. There's no score. |
An empty value counts as a non-match, so the other three must all match. See What it takes to pass.
Never leave a field out, and always send a validbirthdate. Either one makes matching fail with a system error rather than score 0.
If you send nosubjectat all, nothing is matched. The verification completes as normal, and the response has nocom.securekey.matching.
Formats
| Field | Format |
|---|---|
birthdate | YYYY-MM-DD |
address.postal_code | A1A 1A1 |
How scoring works
Each attribute is scored from 0 to 100. Hub tries progressively more forgiving comparisons and stops at the first that succeeds.
Taking given name as the example:
| Comparison | Score | Catches |
|---|---|---|
| Exact match | 100 | Identical strings |
| Cleaned | 99 | Different capitalisation, accents, extra spaces |
| Legal name | 95 | Documents listing several given names |
| First word only | 85 | One source includes a middle name |
| Known alias | 80 | "Jim" vs "James" |
| No match | 0 |
Family name and postal code use similar ladders. Birthdate scores 100 for an identical value, 95 for the same date written without leading zeros (such as 1965-3-3), and 0 otherwise. Swapped day and month score 0.
The overall score is the average of the four attribute scores, and the match passes if it's 65 or more. See Rulesets for worked examples.
What it takes to pass
| Attributes that match | Result |
|---|---|
| All four | Always passes |
| Three, with one scoring 0 | Passes if the three average about 87 or more, which most real matches do. It can fail if two of them only match on a nickname or a reordered surname (80 each). |
| Two or fewer | Always fails |
In practice:
- All four available: at least three of the four must match.
- One can never match: the other three must all match. This happens with a passport, which has no postal code, or when you send
""for a value you don't hold.
What you get back
With subject matching, the userinfo response is shaped differently from a plain bank or document verification. Instead of a single flat object, the results are grouped under separate keys. The tabs show a bank verification and a document verification, both matched against the subject above:
{
"sub": "Q7FkdchyKdU80-7A51gPlVDiyN5dGAfZvsacq7AlaJA",
"given_name": "John",
"family_name": "Doe",
"birthdate": "1965-03-03",
"com.securekey.verified.me": {
"sub": "Q7FkdchyKdU80-7A51gPlVDiyN5dGAfZvsacq7AlaJA",
"source": "bank",
"given_name": "John",
"middle_name": "M",
"family_name": "Doe",
"birthdate": "1965-03-03",
"address": {
"street_address": "4101 Yonge Street",
"locality": "Toronto",
"region": "ON",
"postal_code": "M2P 1N6",
"country": "CA"
},
"email": "[email protected]",
"phone_number": "14169378708",
"dacPseudonym": "Q7FkdchyKdU80-7A51gPlVDiyN5dGAfZvsacq7AlaJA",
"ui_locale": "en-CA",
"license_id": "cB-Gqc0zPrIWh2JAN2r9eZ9HM3-U1HAwR9o7HFmz-SE"
},
"com.securekey.matching": {
"matchStatus": "CLEAR",
"matchData": {
"matchScore": 100,
"matchThreshold": 65,
"given_name_score": 100,
"family_name_score": 100,
"birthdate_score": 100,
"postal_code_score": 100
},
"identityData": {
"leftDigitalIdentity": "com.securekey.verified.me",
"rightDigitalIdentity": "request.subject"
}
}
}{
"sub": "d306f935-cb23-4a39-8acc-232eed539e1e",
"given_name": "JOHN",
"family_name": "DOE",
"birthdate": "1965-03-03",
"com.securekey.vids": {
"sub": "d306f935-cb23-4a39-8acc-232eed539e1e",
"jobId": "d306f935-cb23-4a39-8acc-232eed539e1e",
"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.matching": {
"matchStatus": "CLEAR",
"matchData": {
"matchScore": 99.5,
"matchThreshold": 65,
"given_name_score": 99,
"family_name_score": 99,
"birthdate_score": 100,
"postal_code_score": 100
},
"identityData": {
"leftDigitalIdentity": "com.securekey.vids",
"rightDigitalIdentity": "request.subject"
}
}
}The bank example has the Stable user identifier option set to true, so sub is the user's dacPseudonym. In the document example, the names score 99 rather than 100 because the document has them in capitals.
| Key | What it holds |
|---|---|
sub, given_name, family_name, birthdate | A summary of the verified person |
com.securekey.verified.me | The full bank result. Present when the user verified with their bank. |
com.securekey.vids | The full document result, including scan_result. Present when the user scanned a document. |
com.securekey.matching | The match result |
You get either the bank result or the document result, never both. In Select mode it depends on which the user chose.
Read fields from the nested object. The address, the fraud flags andscan_resultare insidecom.securekey.verified.meorcom.securekey.vids, not at the top level as they are in Step 5. Inside the bank result,ui_localeandlicense_idalso lose theircom.securekey.verified.me.prefix.dacPseudonym, if enabled, also appears inside the nested object, as does the credit bureau check result (efxWaterfallKYC) if your client has it.
The match result
The match result from the bank example:
"com.securekey.matching": {
"matchStatus": "CLEAR",
"matchData": {
"matchScore": 100,
"matchThreshold": 65,
"given_name_score": 100,
"family_name_score": 100,
"birthdate_score": 100,
"postal_code_score": 100
},
"identityData": {
"leftDigitalIdentity": "com.securekey.verified.me",
"rightDigitalIdentity": "request.subject"
}
}| Field | What it is |
|---|---|
matchStatus | CLEAR if the score met the threshold, otherwise REJECTED |
matchData.matchScore | The overall score, 0–100 |
matchData.matchThreshold | The threshold it was compared against — 65 for default_KYC |
matchData.given_name_score, family_name_score, birthdate_score, postal_code_score | The score for each attribute, 0–100. An attribute may be missing. |
identityData.leftDigitalIdentity | Which result was compared: com.securekey.verified.me or com.securekey.vids |
identityData.rightDigitalIdentity | Always request.subject — the subject you sent |
fail_reason, fail_description | Present only when the match didn't pass. See below. |
ParsematchScoredefensively. It's an average, so it can have decimals such as71.25, and it can arrive as a quoted string.
When the match doesn't pass
You only see a failed match result if Partial results (acceptPartialResult) is true — otherwise you get an error instead. See When the score is below the threshold.
The tabs show a failed match and a skipped one:
{
"matchStatus": "REJECTED",
"matchData": {
"matchScore": 50,
"matchThreshold": 65,
"given_name_score": 100,
"family_name_score": 100,
"birthdate_score": 0,
"postal_code_score": 0
},
"identityData": {
"leftDigitalIdentity": "com.securekey.verified.me",
"rightDigitalIdentity": "request.subject"
},
"fail_reason": "MATCH_FAILED",
"fail_description": "Match Failed"
}{
"matchStatus": "REJECTED",
"matchData": {
"matchScore": 0,
"matchThreshold": 0,
"given_name_score": 0,
"family_name_score": 0,
"birthdate_score": 0
},
"identityData": {
"leftDigitalIdentity": "com.securekey.vids",
"rightDigitalIdentity": "request.subject"
},
"fail_reason": "DOCUMENT_WITH_RESULT_NOT_CLEAR",
"fail_description": "Error during data matching processing. Err: Rejected/suspicious input - cannot match"
}These are all the fail_reason and fail_description values you can receive:
fail_reason | fail_description | What happened | matchData |
|---|---|---|---|
MATCH_FAILED | Match Failed | The details were compared and scored below the threshold | Real scores |
DOCUMENT_WITH_RESULT_NOT_CLEAR | Error during data matching processing. Err: Rejected/suspicious input - cannot match | Skipped — the document or selfie wasn't CLEAR. Document verification only. See When matching doesn't run. | Every score 0, including matchThreshold |
SYSTEM_ERROR | Starts with Error during data matching processing. | Matching couldn't be completed — for example, a field was left out of your subject, or birthdate wasn't a valid date | Absent. The object has only fail_reason and fail_description. |
The bank or document result never carries a fail_reason here. If the verification itself fails, you get an error instead.
Branch onfail_reason, notfail_description.
fail_reasonis a fixed code.fail_descriptionis free text that can change, so use it for logging only.
When the score is below the threshold
Controlled by the Partial results option (acceptPartialResult), which your Interac representative sets.
| Value | What happens |
|---|---|
false (default) | The verification fails. You get an error, not a score. |
true | You receive the result and the score, even though it's below threshold. You decide what to do. |
Set it to true if you want to make your own decision — for example, auto-approving high scores and sending borderline ones for manual review.
It isn't limited to low scores. With true, you get the result whenever the verification itself succeeded, even if matching couldn't run at all. Check fail_reason to tell them apart — see When the match doesn't pass.
When matching doesn't run
Matching only runs after the verification itself has passed. If it didn't, your subject is never compared.
| What happened | Does matching run? | What you get |
|---|---|---|
| Bank verification failed or was cancelled | No | The bank error. See Bank verification. |
| Document verification failed or was cancelled | No | The document error. See Document verification. |
Document or selfie wasn't CLEAR, and Partial document results (allowPartialResults) is false | No | Document R or Document S |
Document or selfie wasn't CLEAR, and Partial document results is true | No — skipped | A failed match with a score of 0. See below. |
A skipped match looks like a failed one
The last row is the one to watch. When Partial document results lets a SUSPECTED or REJECTED document through, Hub refuses to compare it against your subject — matching against a document that may not be genuine would be meaningless. But it reports this as a failed match, with every score set to 0:
| Your configuration | What you see |
|---|---|
Partial results false | Document completed but data could not be matched — the same error as a genuine mismatch |
Partial results true | A code, and a result with a match score of 0 |
| Detailed error reporting | err:document_rejected or err:document_suspected — the only error form that tells you directly |
Checkfail_reasonbefore you read the match score.DOCUMENT_WITH_RESULT_NOT_CLEARmeans the details were never compared — not that this is a different person. Handle it as a document problem, using the flags incom.securekey.vidsand Fraud flags. AmatchThresholdof 0 is another sign: a real comparison never has one.
The selfie counts too. A face_match or spoofing_detection flag can cause the skip even when the document itself was fine.
Hiding the user's details
If the Match result only option (hidePII) is true for your client, you receive only sub and the match result. The summary fields and the whole bank or document result are left out — including scan_result.
{
"sub": "9ea5e610-d51f-4f7f-80a0-85041fa3bee9",
"com.securekey.matching": {
"matchStatus": "CLEAR",
"matchData": {
"matchScore": 100,
"matchThreshold": 65,
"given_name_score": 100,
"family_name_score": 100,
"birthdate_score": 100,
"postal_code_score": 100
},
"identityData": {
"leftDigitalIdentity": "com.securekey.vids",
"rightDigitalIdentity": "request.subject"
}
}
}Useful when you only need to confirm "is this the same person?" and have no need to store or see their data. With Match result only, fail_reason is the only way to tell a skipped match from a real one.
A note on passports
A passport carries no postal code, so postal code always scores 0 for a passport scan. That caps the overall score at 75, so the other three attributes need to average about 87 to pass. See Rulesets.
Errors
Errors arrive at your redirect_uri as the error and error_description query parameters, instead of a code. error is access_denied for every failure except a timeout, which is session_expired. error_description tells you why.
These are all the values subject matching returns:
error | error_description | When |
|---|---|---|
access_denied | User cancelled | The user cancelled at any point, including declining the consent screen |
access_denied | Service error | Bank verification failed, the credit bureau check failed, or another system error |
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 | Verified.Me completed but data could not be matched | Bank verification succeeded, but the match didn't pass. Only with Partial results false. |
access_denied | Document completed but data could not be matched | Document verification succeeded, but the match didn't pass or was skipped. Only with Partial results false. |
session_expired | The session has expired | The session timed out before the user finished |
"The match didn't pass" covers every fail_reason above: a low score, a skipped match, or a system error in matching. The error doesn't say which.
These strings containVerified.Me, the former name for the Interac Verification Service. Match them exactly as returned.
With detailed error reporting
Clients configured for detailed error reporting receive error=access_denied and a structured error_description instead, including for timeouts. These values have no stage. If more than one thing failed, you get the first match in this table.
error_description | When |
|---|---|
err:system_error$details:ivs_error | A system error in bank verification |
err:user_cancelled$details:ivs_cancelled | The user cancelled bank verification |
err:user_cancelled$details:document_idv_cancelled | The user cancelled the document step |
err:user_cancelled$details:cancelled_on_idv_guidance_page | The user cancelled on the document instructions screen, or on the Select mode choice screen |
err:document_rejected | The document was rejected. This includes a match skipped because the document wasn't CLEAR. |
err:document_suspected | The document was suspected. This includes a match skipped because the document wasn't CLEAR. |
err:idv_data_matching_failed$details:mismatch | The 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 true. |
err:system_error$details:matching_error | Matching failed with a system error, for example a field left out of your subject |
err:user_cancelled | The user cancelled elsewhere, such as declining the consent screen |
err:system_error | Another system error, including a scan error or expired scanning session with Partial results false, or a failed credit bureau check |
err:session_timeout | The session timed out |
The error alone doesn't tell you how close the match was. If you need the score, ask for Partial results (acceptPartialResult) to be set totrueso the result comes back through the userinfo endpoint instead of becoming an error.
See Error reference for every value, and Detailed error reference if your client has detailed error reporting.
Limitations
- Not supported in dual mode or with verified credentials. Works with bank-only, document-only and select scopes.
- PAR is mandatory.
default_KYCmatches four attributes only. Custom rulesets are available by arrangement.
AvailabilityCustom matching rulesets are enabled per client and subject to contractual agreement. Contact your Interac representative to confirm availability for your integration.
Updated 3 days ago