Some Persona Inquiry templates are only meant to be finished once per user. For example, you might have an onboarding template where, if the user passes verification, they gain access to your site. If they fail, they should be denied access.
You will want to prevent your users from creating multiple Inquiries on these templates for the following reasons:
Creating Inquiries via API restricts end users from arbitrarily creating Inquiries. See Creating Inquiries via API for more information.
A Reference ID is a string unique to every user that is used to identify a their Persona account in a way that makes sense to your business. Persona recommends using the same user ID that represents the user in your internal system.
Inquiries created with the same Reference ID will all get associated with the same account, which is how you can tell if a user has already gone through the Persona flow.
Ideally, you will have saved the user’s verification status in your internal systems and can route the user accordingly without querying Persona for previous Inquiries.
If you don’t have this implemented, please read on.
You will want to check if there are existing Inquiries with your user’s Reference ID
If there is an existing Inquiry that has already successfully finished (where the status is completed or approved), there may be no need to create a new Inquiry and you can let the user onto your system.
If there is an existing Inquiry that has unsuccessfully finished (where the status is failed, declined, or marked-for-review), you may want to actively prevent the user from creating a new Inquiry, as they have previously failed Persona verification.
If there is an existing Inquiry with a status of expired, you can i. Resume this Inquiry ii. Create a new Inquiry with the same Reference ID
We recommend you first check to see if the existing Inquiry’s template version (a string beginning with itmplv_) is the same as the Inquiry template’s current version, to ensure the Inquiry your user is going through has the most up-to-date configuration. In order to do so, you should first retrieve this inquiry, and then you should resume the Inquiry if the two versions match (which will allow the user to pick up where they left off), and create a new Inquiry if the versions do not match.
To avoid having to look up a user’s Inquiries in this fashion every time they access your site, you can save their Inquiry status in your system and query that status when necessary.