View Source Stripe.Identity.VerificationSession (stripity_stripe v3.2.0)

A VerificationSession guides you through the process of collecting and verifying the identities of your users. It contains details about the type of verification, such as what verification check to perform. Only create one VerificationSession for each verification in your system.

A VerificationSession transitions through multiple statuses throughout its lifetime as it progresses through the verification flow. The VerificationSession contains the user's verified data after verification checks are complete.

Related guide: The Verification Sessions API

Summary

Types

A set of options for the session’s verification checks.

t()

The identity.verification_session type.

Functions

A VerificationSession object can be canceled when it is in requires_input status.

Creates a VerificationSession object.

Returns a list of VerificationSessions

Redact a VerificationSession to remove all collected information from Stripe. This will redactthe VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc.

Retrieves the details of a VerificationSession that was previously created.

Updates a VerificationSession object.

Types

@type created() :: %{
  optional(:gt) => integer(),
  optional(:gte) => integer(),
  optional(:lt) => integer(),
  optional(:lte) => integer()
}
@type document() :: %{
  optional(:allowed_types) => [:driving_license | :id_card | :passport],
  optional(:require_id_number) => boolean(),
  optional(:require_live_capture) => boolean(),
  optional(:require_matching_selfie) => boolean()
}
@type options() :: %{optional(:document) => document() | binary()}

A set of options for the session’s verification checks.

@type t() :: %Stripe.Identity.VerificationSession{
  client_secret: binary() | nil,
  created: integer(),
  id: binary(),
  last_error: term() | nil,
  last_verification_report:
    (binary() | Stripe.Identity.VerificationReport.t()) | nil,
  livemode: boolean(),
  metadata: term(),
  object: binary(),
  options: term() | nil,
  redaction: term() | nil,
  status: binary(),
  type: binary() | nil,
  url: binary() | nil,
  verified_outputs: term() | nil
}

The identity.verification_session type.

  • client_secret The short-lived client secret used by Stripe.js to show a verification modal inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on passing the client secret to the frontend to learn more.
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • id Unique identifier for the object.
  • last_error If present, this property tells you the last error encountered when processing the verification.
  • last_verification_report ID of the most recent VerificationReport. Learn more about accessing detailed verification results.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • metadata 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.
  • object String representing the object's type. Objects of the same type share the same value.
  • options A set of options for the session’s verification checks.
  • redaction Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
  • status Status of this VerificationSession. Learn more about the lifecycle of sessions.
  • type The type of verification check to be performed.
  • url The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on verifying identity documents to learn how to redirect users to Stripe.
  • verified_outputs The user’s verified data.

Functions

Link to this function

cancel(session, params \\ %{}, opts \\ [])

View Source
@spec cancel(
  session :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

A VerificationSession object can be canceled when it is in requires_input status.

Once canceled, future submission attempts are disabled. This cannot be undone. Learn more.

Details

  • Method: post
  • Path: /v1/identity/verification_sessions/{session}/cancel
Link to this function

create(params \\ %{}, opts \\ [])

View Source
@spec create(
  params :: %{
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:options) => options(),
    optional(:return_url) => binary(),
    optional(:type) => :document | :id_number
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a VerificationSession object.

After the VerificationSession is created, display a verification modal using the session client_secret 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

Details

  • Method: post
  • Path: /v1/identity/verification_sessions
Link to this function

list(params \\ %{}, opts \\ [])

View Source
@spec list(
  params :: %{
    optional(:created) => created() | integer(),
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:limit) => integer(),
    optional(:starting_after) => binary(),
    optional(:status) => :canceled | :processing | :requires_input | :verified
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Returns a list of VerificationSessions

Details

  • Method: get
  • Path: /v1/identity/verification_sessions
Link to this function

redact(session, params \\ %{}, opts \\ [])

View Source
@spec redact(
  session :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Redact a VerificationSession to remove all collected information from Stripe. This will redactthe VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc.

A VerificationSession object can be redacted when it is in requires_input or verifiedstatus. Redacting a VerificationSession in requires_action state will automatically cancel it.

The redaction process may take up to four days. When the redaction process is in progress, theVerificationSession’s redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted.

Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all thefields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose.

Learn more.

#### Details * Method: `post` * Path: `/v1/identity/verification_sessions/{session}/redact`

Link to this function

retrieve(session, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  session :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves the details of a VerificationSession that was previously created.

When the session status is requires_input, you can use this method to retrieve a validclient_secret or url to allow re-submission.

#### Details * Method: `get` * Path: `/v1/identity/verification_sessions/{session}`

Link to this function

update(session, params \\ %{}, opts \\ [])

View Source
@spec update(
  session :: binary(),
  params :: %{
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:options) => options(),
    optional(:type) => :document | :id_number
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Updates a VerificationSession object.

When the session status is requires_input, you can use this method to update theverification check and options.

#### Details * Method: `post` * Path: `/v1/identity/verification_sessions/{session}`