Creates a VerificationSession object.
After the VerificationSession is created, display a verification modal using the session client_
or send your users to the session’s url
.
If your API key is in test mode, verification checks won’t actually process, though everything else will occur as if in live mode.
Related guide: Verify your users’ identity documents
Parameters
- client_
reference_ idstring A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems.
- metadataobject
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to
metadata
. - optionsobject
A set of options for the session’s verification checks.
- options.
documentobject Options that apply to the document check.
- options.
document. allowed_ typesarray of enums Array of strings of allowed identity document types. If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code.
Possible enum valuesdriving_
license Drivers license document type.
id_
card ID card document type.
passport
Passport document type.
- options.
document. require_ id_ numberboolean Collect an ID number and perform an ID number check with the document’s extracted name and date of birth.
- options.
document. require_ live_ captureboolean Disable image uploads, identity document images have to be captured using the device’s camera.
- options.
document. require_ matching_ selfieboolean Capture a face image and perform a selfie check comparing a photo ID and a picture of your user’s face. Learn more.
- provided_
detailsobject Details provided about the user being verified. These details may be shown to the user.
- provided_details.
emailstring Email of user being verified
- provided_details.
phonestring Phone number of user being verified
- string
Customer ID
- object
Tokens referencing a Person resource and it’s associated account.
- related_person.
stringRequired A token representing a connected account. If provided, the person parameter is also required and must be associated with the account.
- related_person.
stringRequired A token referencing a Person resource that this verification is being used to verify.
- return_
urlstring The URL that the user will be redirected to upon completing the verification flow.
- typeenum
The type of verification check to be performed. You must provide a
type
if not passingverification_
.flow Possible enum valuesdocument
id_
number - verification_
flowstring The ID of a verification flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows.
Returns
Returns the created VerificationSession object
{ "id": "vs_1NuN4zLkdIwHu7ixleE6HvkI", "object": "identity.verification_session", "client_secret": "...", "created": 1695680197, "last_error": null, "last_verification_report": null, "livemode": false, "metadata": {}, "options": {}, "redaction": null, "status": "requires_input", "type": "document", "url": "..."}
- Need help? Contact Support.
- Join our early access program.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
- Powered by Markdoc