Navigation
View as Markdown

KYC verification

Some accounts need a real person behind them: a seller before their first payout, an account that keeps tripping the multi-accounting checks, or anyone about to take a sensitive action. This guide puts a KYC challenge in front of them and lets everyone else through.

Step 1: Set up login and signup protection

Before anything else here, set up Signup protection and Login protection. They're the basis this builds on, and without them the policies below can be bypassed. With those in place, the rest of this guide covers the policies that ask for an identity check only when it is worth the friction.

Step 2: Create the KYC challenge

In your challenge configs, create a config of type KYC and pick a level:

  • Selfie liveness when you want proof of a live person and nothing more.
  • ID document and selfie when the person has to match a government ID.

Review the consent text on the start screen. It names you as the party the check is for, and your users must accept it before the camera opens.

Step 3: Add the policies

A policy has a trigger (the event it runs on) and a verdict. Add these in your policies dashboard:

PolicyTriggerConditionsVerdict
Verify before payoutyour payout eventis_identity_verified is falseChallenge (KYC config)
Verify repeat offenderssignupfingerprint_user_count is over your limit and is_identity_verified is falseChallenge (KYC config)

The first policy runs on a custom event you evaluate right before the sensitive action. The second reuses the linked accounts signal from Multi-accounting prevention, so a person who has already opened several accounts on one device has to prove who they are before opening another.

Both policies include is_identity_verified is false, so a user who passed once is not asked again. Keep KYC out of the plain login and signup paths for everyone else: it is the strongest step-up Rupt has and the most friction.

Step 4: Honor the result

Hold the action until the challenge status is completed, the same way you would for any challenge. Read it with Retrieve a challenge or wait for the challenge completed webhook. A challenge.failed webhook means the user ran out of attempts, and the kyc.reasons on it says why.

At the document level, a completed challenge proves that a real person matched a real ID. It does not prove that the ID belongs to the person the account claims to be. Someone can sign up with another person's name and photo, then pass KYC with their own ID. Close that gap by comparing what the ID says with what the account says.

The simplest way is to let Rupt compare. As soon as an evaluation comes back with a KYC challenge, and before the user finishes it, enrich it with the name you have on file:

JavaScript
const evaluation = await rupt.getEvaluation(evaluation_id);

if (evaluation.challenge?.type === "kyc") {
  await rupt.enrichEvaluation(evaluation_id, {
    reference_fields: { first_name: account.firstName, last_name: account.lastName },
  });
}

A name that does not match fails the challenge with the reason reference_name_mismatch, and the failed challenge still returns the ID's fields as kyc.document, so you can see whose ID was used. kyc.reference_field_matches says how each field matched. You can also send city_in_address, state_in_address and middle_name, and a reference_image the selfie must match.

To check anything else, such as the date of birth, compare it yourself. The fields Rupt read off the ID come back as kyc.document on the challenge, and on challenge.kyc.document of the evaluation you consume on your success page:

JavaScript
const evaluation = await rupt.consumeEvaluation(evaluation_id);
const idDocument = evaluation.challenge?.kyc?.document;

if (evaluation.challenge?.status !== "completed" || !idDocument) {
  return reject("Identity not verified");
}
if (
  idDocument.last_name?.toLowerCase() !== account.lastName.toLowerCase() ||
  idDocument.date_of_birth?.slice(0, 10) !== account.dateOfBirth
) {
  return reject("The ID does not match this account");
}

Names on IDs are often upper case and can include middle names or suffixes, so normalize both sides before comparing.

The same response lists kyc.linked_users: the other users in your project who passed KYC with this ID. An empty list means the ID is new to you. Anything else means one person is behind several accounts, which you can block, send to review, or allow if your product permits it. Webhook payloads never include the document, so fetch the challenge or the evaluation to read it. See the challenge object for every field.