Data matching
Entrust IDV can compare the personal data you pass when creating a transaction with the data it reads from the end user's ID document. If the two don't match, the transaction fails. Use this when you already know who the end user should be and want proof that the document belongs to that person.
How it works
You pass firstName, lastName and dateOfBirth in the onfido provider parameters. The end user captures their document as usual. The name and date of birth on the document are then compared with the values you sent.
First name and last name are compared with a fuzzy matching engine. It tolerates common variations such as minor spelling differences, and it takes every name on the document into account, including middle names, spouse names, widow names and aliases. A user registered with you as "Rick Deckard" still matches a passport reading "Rick Joseph Deckard". Date of birth must match the document.
If any compared value doesn't match, eID Hub fails the transaction, even when the document itself is genuine.
Enabling matching
Matching is enabled by default. If you don't want it for your account, contact Scrive support to have it turned off.
:::caution All fields or none The account setting covers first name, last name and date of birth together. You cannot enable name matching without date of birth matching, or the other way around. :::
What you send decides what gets matched in each transaction. firstName, lastName and dateOfBirth are all optional, and only the fields you provide are compared. A field you leave out is ignored and cannot cause a failure. If you send none of them, the transaction is decided on the document check alone.
Creating a transaction with matching data
- curl
- Python
- Node.js
curl -X POST https://testbed-eid.scrive.com/api/v1/transaction/new \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"redirectUrl": "https://your-app.example.com/eid/return",
"callbackUrl": "https://your-app.example.com/eid/callback",
"provider": "onfido",
"method": "auth",
"providerParameters": {
"auth": {
"onfido": {
"report": "document",
"firstName": "Rick",
"lastName": "Deckard",
"dateOfBirth": "1990-04-12"
}
}
}
}'
import requests
response = requests.post(
"https://testbed-eid.scrive.com/api/v1/transaction/new",
headers={"Authorization": "Bearer <API_TOKEN>"},
json={
"redirectUrl": "https://your-app.example.com/eid/return",
"callbackUrl": "https://your-app.example.com/eid/callback",
"provider": "onfido",
"method": "auth",
"providerParameters": {
"auth": {
"onfido": {
"report": "document",
"firstName": "Rick",
"lastName": "Deckard",
"dateOfBirth": "1990-04-12",
}
}
},
},
)
transaction = response.json()
const response = await fetch("https://testbed-eid.scrive.com/api/v1/transaction/new", {
method: "POST",
headers: {
Authorization: "Bearer <API_TOKEN>",
"Content-Type": "application/json",
},
body: JSON.stringify({
redirectUrl: "https://your-app.example.com/eid/return",
callbackUrl: "https://your-app.example.com/eid/callback",
provider: "onfido",
method: "auth",
providerParameters: {
auth: {
onfido: {
report: "document",
firstName: "Rick",
lastName: "Deckard",
dateOfBirth: "1990-04-12",
},
},
},
}),
});
const transaction = await response.json();
dateOfBirth uses the YYYY-MM-DD format. firstName and lastName must be at least two characters long and cannot contain any of these characters: ^!#$%*=<>;{}". A request that breaks these rules is rejected with 400 Bad parameters and no transaction is created.
Clean the values before you send them. Trim leading and trailing spaces and collapse repeated whitespace inside names, since stray whitespace can cause a mismatch.
Outcomes
Every case below assumes matching has not been turned off for your account.
| Scenario | Result | documentErrors |
|---|---|---|
| A field is not sent | That field is not matched and cannot fail the transaction | None for that field |
None of firstName, lastName or dateOfBirth sent | Result depends on the document check only | None from matching |
| Name and date of birth match the document, allowing for fuzzy name variations | Transaction complete | None |
| First name differs beyond what fuzzy matching accepts | Transaction failed | DataComparisonFirstName |
| Last name differs beyond what fuzzy matching accepts | Transaction failed | DataComparisonLastName |
| Date of birth differs from the document | Transaction failed | DataComparisonDateOfBirth |
| A value you sent cannot be read from the document | Transaction failed | The error for that field |
| Request contains a forbidden character or a name shorter than two characters | 400 Bad parameters on create | Not applicable, no transaction is created |
When the transaction fails, the end user is redirected to your redirectUrl with success=false, and your callbackUrl receives "status": "failed". See Result handling.
Reading the failure reason
Retrieve the transaction with Get a transaction. Matching failures are listed in providerInfo.onfidoAuth.errorData.documentErrors, one entry per field that didn't match. A transaction can fail on several fields at once, so treat documentErrors as a list and check for each value you care about.
{
"id": "00000000-0000-0000-0000-000000000000",
"provider": "onfido",
"method": "auth",
"status": "failed",
"providerInfo": {
"onfidoAuth": {
"applicantId": "...",
"sdkToken": "...",
"errorData": {
"documentErrors": ["DataComparisonLastName", "DataComparisonDateOfBirth"]
}
}
}
}
documentErrors also carries reasons unrelated to matching, such as ImageIntegrityImageQuality or VisualAuthenticityFonts. A failed transaction without any DataComparison value failed on the document check, not on matching. The full list is in the Get a transaction API reference.
The enum also contains DataComparisonGender and DataComparisonAddress. Neither is part of name and date of birth matching. Gender is not compared, and address comparison belongs to the Proof of address report.