Install the Stripe server-side SDK and set your secret key via environment variable STRIPE_SECRET_KEY.
Call the Stripe Identity API to create a VerificationSession, specifying type 'document' or 'id_number' and passing a return_url for redirect after the hosted flow.
Return the client_secret from the VerificationSession to your frontend and use Stripe.js (loadStripe + stripe.verifyIdentity) to launch the hosted verification modal.
Listen for the identity.verification_session.verified or identity.verification_session.requires_input webhook events to determine outcome.
On the verified event, retrieve the VerificationSession server-side to access the verified outputs (name, date of birth, address) and store the result against your user record.
Handle requires_input by inspecting the last_error field and prompting the user to retry or contact support.
Known gotchas
The client_secret is single-use and short-lived; generate it immediately before launching the modal and never cache it.
Verified output fields are only accessible server-side after the webhook fires; do not rely on frontend callbacks alone for compliance decisions.
In test mode, use Stripe-provided test document images; live document uploads are rejected in test mode.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp