Class VerificationSession

java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.identity.VerificationSession
All Implemented Interfaces:
HasId, MetadataStore<VerificationSession>, StripeActiveObject, StripeObjectInterface

public class VerificationSession extends ApiResource implements HasId, MetadataStore<VerificationSession>
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

  • Constructor Details

    • VerificationSession

      public VerificationSession()
  • Method Details

    • getLastVerificationReport

      public String getLastVerificationReport()
      Get ID of expandable lastVerificationReport object.
    • setLastVerificationReport

      public void setLastVerificationReport(String id)
    • getLastVerificationReportObject

      public VerificationReport getLastVerificationReportObject()
      Get expanded lastVerificationReport.
    • setLastVerificationReportObject

      public void setLastVerificationReportObject(VerificationReport expandableObject)
    • cancel

      public VerificationSession cancel() throws StripeException
      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.

      Throws:
      StripeException
    • cancel

      public VerificationSession cancel(RequestOptions options) throws StripeException
      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.

      Throws:
      StripeException
    • cancel

      public VerificationSession cancel(Map<String,Object> params) throws StripeException
      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.

      Throws:
      StripeException
    • cancel

      public VerificationSession cancel(Map<String,Object> params, RequestOptions options) throws StripeException
      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.

      Throws:
      StripeException
    • cancel

      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.

      Throws:
      StripeException
    • cancel

      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.

      Throws:
      StripeException
    • create

      public static VerificationSession create(Map<String,Object> params) throws StripeException
      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.

      Throws:
      StripeException
    • create

      public static VerificationSession create(Map<String,Object> params, RequestOptions options) throws StripeException
      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.

      Throws:
      StripeException
    • create

      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.

      Throws:
      StripeException
    • create

      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.

      Throws:
      StripeException
    • list

      public static VerificationSessionCollection list(Map<String,Object> params) throws StripeException
      Returns a list of VerificationSessions.
      Throws:
      StripeException
    • list

      public static VerificationSessionCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      Returns a list of VerificationSessions.
      Throws:
      StripeException
    • list

      Returns a list of VerificationSessions.
      Throws:
      StripeException
    • list

      Returns a list of VerificationSessions.
      Throws:
      StripeException
    • redact

      public VerificationSession redact() throws StripeException
      Redact a VerificationSession to remove all collected information from Stripe. This will redact the 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 verified status. 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, the VerificationSession’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 the fields 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.

      Throws:
      StripeException
    • redact

      public VerificationSession redact(RequestOptions options) throws StripeException
      Redact a VerificationSession to remove all collected information from Stripe. This will redact the 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 verified status. 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, the VerificationSession’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 the fields 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.

      Throws:
      StripeException
    • redact

      public VerificationSession redact(Map<String,Object> params) throws StripeException
      Redact a VerificationSession to remove all collected information from Stripe. This will redact the 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 verified status. 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, the VerificationSession’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 the fields 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.

      Throws:
      StripeException
    • redact

      public VerificationSession redact(Map<String,Object> params, RequestOptions options) throws StripeException
      Redact a VerificationSession to remove all collected information from Stripe. This will redact the 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 verified status. 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, the VerificationSession’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 the fields 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.

      Throws:
      StripeException
    • redact

      Redact a VerificationSession to remove all collected information from Stripe. This will redact the 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 verified status. 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, the VerificationSession’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 the fields 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.

      Throws:
      StripeException
    • redact

      Redact a VerificationSession to remove all collected information from Stripe. This will redact the 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 verified status. 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, the VerificationSession’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 the fields 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.

      Throws:
      StripeException
    • retrieve

      public static VerificationSession retrieve(String session) throws StripeException
      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 valid client_secret or url to allow re-submission.

      Throws:
      StripeException
    • retrieve

      public static VerificationSession retrieve(String session, RequestOptions options) throws StripeException
      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 valid client_secret or url to allow re-submission.

      Throws:
      StripeException
    • retrieve

      public static VerificationSession retrieve(String session, Map<String,Object> params, RequestOptions options) throws StripeException
      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 valid client_secret or url to allow re-submission.

      Throws:
      StripeException
    • retrieve

      public static VerificationSession retrieve(String session, VerificationSessionRetrieveParams params, RequestOptions options) throws StripeException
      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 valid client_secret or url to allow re-submission.

      Throws:
      StripeException
    • update

      public VerificationSession update(Map<String,Object> params) throws StripeException
      Updates a VerificationSession object.

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

      Specified by:
      update in interface MetadataStore<VerificationSession>
      Throws:
      StripeException
    • update

      public VerificationSession update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates a VerificationSession object.

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

      Specified by:
      update in interface MetadataStore<VerificationSession>
      Throws:
      StripeException
    • update

      Updates a VerificationSession object.

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

      Throws:
      StripeException
    • update

      Updates a VerificationSession object.

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

      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      The four-digit year.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getClientReferenceId

      public String getClientReferenceId()
      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.
    • getClientSecret

      public String getClientSecret()
      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.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getLastError

      public VerificationSession.LastError getLastError()
      If present, this property tells you the last error encountered when processing the verification.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to identity.verification_session.

    • getOptions

      public VerificationSession.Options getOptions()
      A set of options for the session’s verification checks.
    • getProvidedDetails

      public VerificationSession.ProvidedDetails getProvidedDetails()
      Details provided about the user being verified. These details may be shown to the user.
    • getRedaction

      public VerificationSession.Redaction getRedaction()
      Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
    • getStatus

      public String getStatus()
      Status of this VerificationSession. Learn more about the lifecycle of sessions.

      One of canceled, processing, requires_input, or verified.

    • getType

      public String getType()
      The type of verification check to be performed.

      One of document, id_number, or verification_flow.

    • getUrl

      public String getUrl()
      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.
    • getVerificationFlow

      public String getVerificationFlow()
      The configuration token of a Verification Flow from the dashboard.
    • getVerifiedOutputs

      public VerificationSession.VerifiedOutputs getVerifiedOutputs()
      The user’s verified data.
    • setClientReferenceId

      public void setClientReferenceId(String clientReferenceId)
      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.
    • setClientSecret

      public void setClientSecret(String clientSecret)
      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.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLastError

      public void setLastError(VerificationSession.LastError lastError)
      If present, this property tells you the last error encountered when processing the verification.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMetadata

      public void setMetadata(Map<String,String> 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.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to identity.verification_session.

    • setOptions

      public void setOptions(VerificationSession.Options options)
      A set of options for the session’s verification checks.
    • setProvidedDetails

      public void setProvidedDetails(VerificationSession.ProvidedDetails providedDetails)
      Details provided about the user being verified. These details may be shown to the user.
    • setRedaction

      public void setRedaction(VerificationSession.Redaction redaction)
      Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
    • setStatus

      public void setStatus(String status)
      Status of this VerificationSession. Learn more about the lifecycle of sessions.

      One of canceled, processing, requires_input, or verified.

    • setType

      public void setType(String type)
      The type of verification check to be performed.

      One of document, id_number, or verification_flow.

    • setUrl

      public void setUrl(String 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.
    • setVerificationFlow

      public void setVerificationFlow(String verificationFlow)
      The configuration token of a Verification Flow from the dashboard.
    • setVerifiedOutputs

      public void setVerifiedOutputs(VerificationSession.VerifiedOutputs verifiedOutputs)
      The user’s verified data.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,String> getMetadata()
      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.
      Specified by:
      getMetadata in interface MetadataStore<VerificationSession>