# Verification checks

Learn about the different verification checks supported by Stripe Identity.

Stripe Identity supports six types of verification checks: document, selfie, ID number, address, phone, and email.

Each verification check requires different information from your user, has different coverage, and has a different verification flow. After you integrate one check, you can add another with minimal changes to your integration.

## Before you begin

- [Activate Stripe Identity](https://dashboard.stripe.com/identity/application) in the Dashboard.
- Set up a [server-side Stripe SDK](https://docs.stripe.com/sdks/server-side.md).

# Selfie


While document checks provide a defense against the use of fraudulent identity documents, fraudulent actors can still get access to legitimate stolen documents. To prevent this, Stripe Identity can perform selfie checks on your users.

Selfie checks look for distinguishing biological traits, such as face geometry, from a government-issued photo ID and a picture of your user’s face. Stripe uses machine learning algorithms to confirm that the face pictures belong to the same person.

In some places, such as the EU, there are privacy laws that require you to justify your use of biometric technology or offer an alternative, non-biometric means of verification. We recommend you offer an alternative verification option or consult with your legal counsel.

## Availability 

Selfie checks are available for government-issued photo IDs from the following countries:

- AE
- AL
- AM
- AR
- AT
- AU
- AZ
- BD
- BE
- BG
- BH
- BJ
- BO
- BR
- BS
- BY
- CA
- CH
- CI
- CL
- CM
- CN
- CO
- CR
- CY
- CZ
- DE
- DK
- DO
- DZ
- EC
- EE
- EG
- ES
- FI
- FR
- GB
- GE
- GH
- GR
- GT
- HK
- HN
- HR
- HT
- HU
- ID
- IE
- IL
- IN
- IQ
- IT
- JE
- JM
- JO
- JP
- KE
- KR
- KW
- KZ
- LB
- LI
- LK
- LT
- LU
- LV
- MA
- MD
- MK
- MM
- MN
- MT
- MU
- MX
- MY
- NG
- NL
- NO
- NP
- NZ
- PA
- PE
- PH
- PK
- PL
- PR
- PS
- PT
- PY
- RO
- RS
- RU
- SA
- SE
- SG
- SI
- SK
- SV
- TH
- TN
- TR
- TW
- UA
- UG
- US
- UY
- UZ
- VE
- VN
- ZA

## Add selfie checks 

To add selfie checks to your application, first follow the guide to [collect and verify identity documents](https://docs.stripe.com/identity/verify-identity-documents.md).

When [creating a VerificationSession](https://docs.stripe.com/api/identity/verification_sessions/create.md), use the [options.document.require_matching_selfie](https://docs.stripe.com/api/identity/verification_sessions/create.md#create_identity_verification_session-options-document-require_matching_selfie) parameter to enable selfie checks.

```curl
curl https://api.stripe.com/v1/identity/verification_sessions \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d type=document \
  -d "options[document][require_matching_selfie]=true"
```

This configures the verification flow to require a government-issued photo ID and a selfie from your user.

## Access selfie check results 

After Stripe processes the submitted `VerificationSession`, the session status changes depending on the result of the checks:

- `verified`: Both the document and selfie checks were successful. The session [verified_outputs](https://docs.stripe.com/api/identity/verification_sessions/object.md#identity_verification_session_object-verified_outputs) contains extracted information from the document.
- `requires_input`: At least one of the document or the selfie checks failed.

To get the captured selfie and document images, retrieve the associated [VerificationReport](https://docs.stripe.com/api/identity/verification_reports.md) by [expanding](https://docs.stripe.com/api/expanding_objects.md) the [last_verification_report](https://docs.stripe.com/api/identity/verification_sessions/object.md#identity_verification_session_object-last_verification_report) field in the session. The report contains the file IDs of the images:

#### Node.js

```javascript

// Don't put any keys in code. See https://docs.stripe.com/keys-best-practices.
// Find your keys at https://dashboard.stripe.com/apikeys.
const stripe = require('stripe')('<<YOUR_SECRET_KEY>>');
const verificationSession = await stripe.identity.verificationSessions.retrieve(
  '{{SESSION_ID}}',
  {
    expand: ['last_verification_report'],
  }
);
const verificationReport = verificationSession.last_verification_report;
```

The `VerificationReport` has [document](https://docs.stripe.com/api/identity/verification_reports/object.md#identity_verification_report_object-document) and [selfie](https://docs.stripe.com/api/identity/verification_reports/object.md#identity_verification_report_object-selfie) fields holding the results of the document and selfie checks. This example `VerificationReport` has successful document and selfie checks:

```json
{
  "id": "vr_orWziM4j7CiRL8J4vQmXgW2w",
  "object": "identity.verification_report",
  "type": "document",
  "verification_session": "vs_orWziM4j7CiRL8J4vQmXgW2w",
  "created": 1611776872,
  "livemode": true,
  "options": {
    "document": {
      "require_matching_selfie": true
    }
  },
  "document": {
    "status": "verified",
    "error": null,
    "first_name": "Jenny",
    "last_name": "Rosen",
    "address": {
      "line1": "1234 Main St.",
      "city": "San Francisco",
      "state": "CA",
      "postal_code": "94111",
      "country": "US"
    },
    "type": "id_card",
    "expiration_date": {
      "day": 17,
      "month": 7,
      "year": 2030
    },
    "files": ["file_orWziM4j7CiRL8J4vQmXgW2w", "file_orWziM4j7CiRL8J4vQmXgW2w"],
    "issued_date": {
      "day": 27,
      "month": 4,
      "year": 2021
    },
    "issuing_country": "US"
  },
  "selfie": {
    "status": "verified",
    "error": null,
    "document": "file_orWziM4j7CiRL8J4vQmXgW2w",
    "selfie": "file_orWziM4j7CiRL8J4vQmXgW2w"
  }
}
```

To access the collected document and face images, see [Accessing verification results](https://docs.stripe.com/identity/access-verification-results.md).

## Handle selfie check failures 

The [document](https://docs.stripe.com/api/identity/verification_reports/object.md#identity_verification_report_object-document) and [selfie](https://docs.stripe.com/api/identity/verification_reports/object.md#identity_verification_report_object-selfie) VerificationReport fields contain the collected data, as well as `status` and `error` fields that tell you whether the check succeeded.

The `status` field tells you whether each check succeeded. The possible values are:

- `verified`: The verification check is successful and the collected data is verified.
- `unverified`: The verification check failed. Review the `error` hash for more information.

When the verification check fails, the `error` field contains `code` and `reason` values that explain the failure. Use `error.code` to handle verification failures programmatically. The `reason` field contains a descriptive message that explains the failure, which you can show to your user.

### Document check failures 

Failure details are available in the report [document.error](https://docs.stripe.com/api/identity/verification_reports/object.md#identity_verification_report_object-document-error) field.

| Error code                    | Description                                                                                                                                                                                                                          |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `document_expired`            | The provided identity document has expired.                                                                                                                                                                                          |
| `document_unverified_other`   | Stripe couldn’t verify the provided identity document. [See list of supported document types](https://docs.stripe.com/identity/verification-checks.md?type=document).                                                                |
| `document_type_not_supported` | The provided identity document isn’t one of the session’s [allowed document types](https://docs.stripe.com/api/identity/verification_sessions/create.md#create_identity_verification_session-options-document-allow_document_types). |

### Selfie check failures 

Failure details are available in the report [selfie.error](https://docs.stripe.com/api/identity/verification_reports/object.md#identity_verification_report_object-selfie-error) field.

| Error code                      | Description                                                         |
| ------------------------------- | ------------------------------------------------------------------- |
| `selfie_document_missing_photo` | The provided identity document did not contain a picture of a face. |
| `selfie_face_mismatch`          | The captured face image didn’t match with the document’s face.      |
| `selfie_unverified_other`       | Stripe couldn’t verify the provided selfie.                         |
| `selfie_manipulated`            | The captured face image was manipulated.                            |


## See also

- [Verify your users’ identity documents](https://docs.stripe.com/identity/verify-identity-documents.md)
- [The Verification Sessions API](https://docs.stripe.com/identity/verification-sessions.md#create)
