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:

  1. Your client must have subject matching enabled. It's configured during onboarding.
  2. You must use PAR. Subject matching only works with POST /auth/par, never with GET /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.

  1. Build the request object payload as usual, and add a subject object to it.
  2. Sign it with your private key.
  3. Send it to Hub as the request parameter of POST /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:

AttributePath
Given namegiven_name
Family namefamily_name
Birthdatebirthdate
Postal codeaddress.postal_code
🚧

Other fields in your subject are ignored by default_KYC and 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 sendResult
The valueScored normally
An empty string ("") for given_name, family_name or address.postal_codeThat attribute scores 0. The other three can still carry the match.
A field left outMatching fails with a system error. There's no score.
birthdate empty, or not a valid YYYY-MM-DD dateMatching 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 valid birthdate. Either one makes matching fail with a system error rather than score 0.

🚧

If you send no subject at all, nothing is matched. The verification completes as normal, and the response has no com.securekey.matching.

Formats

FieldFormat
birthdateYYYY-MM-DD
address.postal_codeA1A 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:

ComparisonScoreCatches
Exact match100Identical strings
Cleaned99Different capitalisation, accents, extra spaces
Legal name95Documents listing several given names
First word only85One source includes a middle name
Known alias80"Jim" vs "James"
No match0

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 matchResult
All fourAlways passes
Three, with one scoring 0Passes 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 fewerAlways 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.

KeyWhat it holds
sub, given_name, family_name, birthdateA summary of the verified person
com.securekey.verified.meThe full bank result. Present when the user verified with their bank.
com.securekey.vidsThe full document result, including scan_result. Present when the user scanned a document.
com.securekey.matchingThe 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 and scan_result are inside com.securekey.verified.me or com.securekey.vids, not at the top level as they are in Step 5. Inside the bank result, ui_locale and license_id also lose their com.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"
  }
}
FieldWhat it is
matchStatusCLEAR if the score met the threshold, otherwise REJECTED
matchData.matchScoreThe overall score, 0–100
matchData.matchThresholdThe threshold it was compared against — 65 for default_KYC
matchData.given_name_score, family_name_score, birthdate_score, postal_code_scoreThe score for each attribute, 0–100. An attribute may be missing.
identityData.leftDigitalIdentityWhich result was compared: com.securekey.verified.me or com.securekey.vids
identityData.rightDigitalIdentityAlways request.subject — the subject you sent
fail_reason, fail_descriptionPresent only when the match didn't pass. See below.
📘

Parse matchScore defensively. It's an average, so it can have decimals such as 71.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_reasonfail_descriptionWhat happenedmatchData
MATCH_FAILEDMatch FailedThe details were compared and scored below the thresholdReal scores
DOCUMENT_WITH_RESULT_NOT_CLEARError during data matching processing. Err: Rejected/suspicious input - cannot matchSkipped — the document or selfie wasn't CLEAR. Document verification only. See When matching doesn't run.Every score 0, including matchThreshold
SYSTEM_ERRORStarts 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 dateAbsent. 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 on fail_reason, not fail_description.

fail_reason is a fixed code. fail_description is 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.

ValueWhat happens
false (default)The verification fails. You get an error, not a score.
trueYou 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 happenedDoes matching run?What you get
Bank verification failed or was cancelledNoThe bank error. See Bank verification.
Document verification failed or was cancelledNoThe document error. See Document verification.
Document or selfie wasn't CLEAR, and Partial document results (allowPartialResults) is falseNoDocument R or Document S
Document or selfie wasn't CLEAR, and Partial document results is trueNo — skippedA 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 configurationWhat you see
Partial results falseDocument completed but data could not be matched — the same error as a genuine mismatch
Partial results trueA code, and a result with a match score of 0
Detailed error reportingerr:document_rejected or err:document_suspected — the only error form that tells you directly
❗️

Check fail_reason before you read the match score. DOCUMENT_WITH_RESULT_NOT_CLEAR means the details were never compared — not that this is a different person. Handle it as a document problem, using the flags in com.securekey.vids and Fraud flags. A matchThreshold of 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:

errorerror_descriptionWhen
access_deniedUser cancelledThe user cancelled at any point, including declining the consent screen
access_deniedService errorBank verification failed, the credit bureau check failed, or another system error
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_deniedVerified.Me completed but data could not be matchedBank verification succeeded, but the match didn't pass. Only with Partial results false.
access_deniedDocument completed but data could not be matchedDocument verification succeeded, but the match didn't pass or was skipped. Only with Partial results false.
session_expiredThe session has expiredThe 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 contain Verified.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_descriptionWhen
err:system_error$details:ivs_errorA system error in bank verification
err:user_cancelled$details:ivs_cancelledThe user cancelled bank verification
err:user_cancelled$details:document_idv_cancelledThe user cancelled the document step
err:user_cancelled$details:cancelled_on_idv_guidance_pageThe user cancelled on the document instructions screen, or on the Select mode choice screen
err:document_rejectedThe document was rejected. This includes a match skipped because the document wasn't CLEAR.
err:document_suspectedThe document was suspected. This includes a match skipped because the document wasn't CLEAR.
err:idv_data_matching_failed$details:mismatchThe 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 true.
err:system_error$details:matching_errorMatching failed with a system error, for example a field left out of your subject
err:user_cancelledThe user cancelled elsewhere, such as declining the consent screen
err:system_errorAnother system error, including a scan error or expired scanning session with Partial results false, or a failed credit bureau check
err:session_timeoutThe 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 to true so 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_KYC matches four attributes only. Custom rulesets are available by arrangement.
📘

Availability

Custom matching rulesets are enabled per client and subject to contractual agreement. Contact your Interac representative to confirm availability for your integration.