Decisions

An insight into how Decision are handled within ID Analyzer API

For every ID Analyzer API call, a final decision will be returned which contains one of the following values: "accept", "review" or "reject". This document explains how the decision is calculated and how you can customize the decision's threshold.

For every transaction, the API will use two values to calculate the decision, these values are also returned for every API request:

  • Review Score
  • Reject Score

Quick Example

If you upload a random image containing no document, the following warnings will be triggered:

{
  ...
  "warning": [
    {
      "code": "UNRECOGNIZED_DOCUMENT",
      "description": "Document not recognized.",
      "severity": "high",
      "confidence": 1,
      "decision": "reject"
    },
    {
      "code": "PHYSICAL_DOCUMENT_MISSING",
      "description": "Could not detect physical card or passport object.",
      "severity": "high",
      "confidence": 1,
      "decision": "review"
    }
  ],
  "reviewScore": 1,
  "rejectScore": 1,
  "decision":"reject",
  ...
}

What is happening is that the API will sum up the number of warnings in which you should reject the document, in this case we only have one reject warning therefore the rejectScore is 1. The same calculation also applies to reviewScore, counting warnings requiring you to manually review the document.

Now to reach a final decision, the API will first check if the rejectScore reaches the threshold defined in your profile (default 1). If so, a reject decision is returned. If the reject threshold is not met, the API will then check if the review threshold is met. If no thresholds are met, the API will return an accept decision.

Advanced Configuration

Consider a scenario on age check, a service provider wants to verify that all their users are over 18 years of age.

What this essentially means is that the API should return "reject" on any ID cards that is below 18 years of age.

We can achieve this by visiting your profile configurations and tick the "Under 18" validation, and change its decision to "reject".

Weights

In some certain, you might want to have a more complex logic in determining whether you want to reject or review documents that fail certain validations.

For example, reject document if:

  • The document is detected as a fake ID

OR

  • The document is missing both date of birth and expiry date

To achieve this we would turn on the validation for Fake ID, Missing Birth Date and Missing Expiry Date, and change the decisions for these validations to reject.

We then need to change the weight of Fake ID to 2 to give it more weight.

Finally, we will also change the triggering weight for reject to 2, meaning the API will only produce a reject decision when the rejectScore reaches 2.

With the above settings:

  • Whenever a document is detected as Fake ID, the reject score will jump straight to 2, meeting the threshold required to produce a reject decision.
  • If the document is missing only expiry date, the reject score will only be 1, not enough to trigger the reject decision.
  • If the document is missing both expiry and date of birth, the reject score will sums up to 2, triggering the reject decision.