Description
Mark products or whole categories as age-restricted. When a cart contains one, the buyer confirms their age with secuveri in a window on your shop: with a selfie and an age estimate, or with their ID document. Your shop only lets the order through once it has received and verified a signed, approved result. Carts without restricted products are not affected.
Since 1 October 2024 the Swiss Tobacco Products Act (TabPG) forbids selling tobacco and nicotine products to people under 18, online too. This plugin was written with that case in mind. It is a tool, not legal advice: check which rules apply to your shop.
Features
- Age restriction per product (with an optional minimum age) or per product category. Default minimum age 18.
- Before checkout (the order can only be placed after the check) or after checkout (the order goes through and stays on hold until the buyer confirms their age from the thank-you page, their account or the order email).
- Age estimate first (a selfie; the ID only when the estimate is not clear) or always the ID document.
- Logged-in customers confirm their age once; later orders up to that age need no new check.
- Classic checkout (shortcode) and the Cart and Checkout blocks.
- The order is refused on the server without a passed check, whatever the browser sends.
- Apple Pay and Google Pay express buttons of WooPayments and WooCommerce Stripe are hidden for restricted products, so buyers go through the check.
- Guest checkout works; the check is tied to the cart session, not to an account.
- Retries are safe: the same cart gets the same secuveri session back, and closing the window lets the buyer continue later.
- On the order only the verification id, the outcome, the method and the time are saved. No ID data is stored in WordPress.
- Webhook: if a reviewer later rejects a verification an order was placed with, the order goes on hold with a note.
- Sandbox mode with test scenarios, so you can try every outcome without a document.
- High-Performance Order Storage (HPOS) compatible.
- Personal data export and erase (Tools > Export / Erase Personal Data).
- Translatable on translate.wordpress.org.
How it works
- The buyer clicks “Verify your age” (or “Place order”), or, with the check after checkout, “Confirm my age” after ordering.
- Your shop asks secuveri for a verification session for this cart.
- The secuveri flow opens in a window on the checkout page. On a computer it shows a QR code so the buyer can continue on their phone.
- When the buyer has finished, your shop reads the signed result from secuveri, checks its ES256 signature against secuveri’s published keys, and checks that it is for this cart and your workflow, that it was approved, and that the age check covers the products in the cart.
- The buyer places the order. The pass is valid for 30 minutes and only for this cart. With the check after checkout, the shop releases the order’s hold instead.
Uses an external service
This plugin relies on secuveri, an identity verification service run by secuveri in Switzerland. You need a secuveri account and API key. Verifications in live mode are charged by secuveri; sandbox sessions are free.
What is sent, and when:
- When a buyer with a restricted product starts the age check, your shop sends the secuveri API (api-verify.secuveri.com) your workflow id, a random reference for the cart or order, the language of your site and, in sandbox mode, the chosen test scenario. Each request also names your site’s address (in the User-Agent). No names, addresses, email addresses or order contents are sent.
- The buyer’s browser loads the verification flow from verify.secuveri.com. There the buyer takes a selfie and, depending on your settings, photos of their ID document. These go straight from the buyer’s device to secuveri and never pass through your shop. You can see the verifications in your secuveri dashboard.
- Your shop then fetches the signed result from the secuveri API and secuveri’s public signing keys (/.well-known/jwks.json). The result carries identifiers and the outcome, not the buyer’s personal data.
- secuveri sends webhooks to your shop with identifiers and the outcome.
secuveri stores verification data in the EU and deletes personal data and media on its retention schedule.
- Terms: https://secuveri.com/terms
- Privacy policy: https://secuveri.com/privacy
- Privacy notice for people being verified: https://secuveri.com/verification-privacy
Installation
- Install and activate the plugin. WooCommerce must be active.
- In the secuveri dashboard, create a published workflow for the age check, for example Liveness check, Age estimation, Identity document and Face match (the ID is only asked when the estimate is not clear), and set its minimum age (for example 18). For “Always check the ID”, add a second workflow with Identity document, Liveness check and Face match.
- Under Settings > Branding > Websites that may embed the flow, add your shop’s address (for example https://shop.example.com). WooCommerce > Settings > secuveri shows the exact value.
- Create an API key under Settings > API keys that can create sessions and read results. Use a sk_test_ key for the sandbox.
- Go to WooCommerce > Settings > secuveri and enter the environment, API key, organization id, workflow id(s) and default minimum age, and choose when and how buyers confirm their age.
- Under Settings > Webhooks in the secuveri dashboard, add the webhook URL shown on the settings page and paste its signing secret into the plugin settings.
- Mark products (Product data > General > Age restricted) or categories (Products > Categories) as age-restricted.
If your site sends a Permissions-Policy header, it must allow the camera for https://verify.secuveri.com and https://*.verify.secuveri.com, for example camera=(self "https://verify.secuveri.com" "https://*.verify.secuveri.com"). With a Content Security Policy, allow https://verify.secuveri.com in frame-src.
The API key and webhook secret can also be defined in wp-config.php instead of the settings: define( 'SECUVERI_API_KEY', 'sk_live_...' ); and define( 'SECUVERI_WEBHOOK_SECRET', 'whsec_...' );.
FAQ
What data does my shop store?
On each order with restricted products: the secuveri verification id, the outcome, the method (for example ID document or age estimation) and the time of the verification. Nothing from the ID document. For logged-in customers the same values and the confirmed age are kept on their account, so they are not asked again; you can remove them on the user’s profile, and they are part of WordPress’s personal data export and erase. During checkout the WooCommerce session holds the cart reference, the verification id and a signed pass that expires after 30 minutes.
What data does secuveri receive and where is it stored?
secuveri receives the selfie and, when needed, the ID document photos directly from the buyer’s device, plus the workflow id and a random cart or order reference from your shop. secuveri stores verification data in the EU. See https://secuveri.com/privacy and https://secuveri.com/verification-privacy.
Do I need to mention secuveri in my privacy policy?
Yes. Tell your buyers that age-restricted purchases are verified by secuveri, what is collected and where it goes. The plugin adds nothing to your privacy policy by itself.
Is this legal advice? Does it make my shop compliant?
No. The plugin enforces an age check before an order can be placed or shipped. Whether that meets the rules for your products and countries is for you to decide.
What happens when the buyer closes the window?
Nothing is lost. The order is not placed (or, with the check after checkout, stays on hold), and the buyer can open the check again to continue the same session.
Before or after checkout?
Before checkout is the safer choice: nothing is sold without a passed check. After checkout lets every order through at once and holds it until the buyer has confirmed their age; the thank-you page, the order in My account and the order emails link to the check. If you set up the webhook, a check the buyer finished after closing the page still releases the order.
What if the verification needs a manual review?
The buyer sees that the verification is being reviewed, and the cart stays as it is. Once a reviewer has approved it in the secuveri dashboard, the buyer clicks “Check again” and can place the order.
What if the buyer removes the restricted products?
Then the cart no longer needs a check and the checkout works as usual.
Several products have different minimum ages.
The highest minimum age in the cart applies. If the workflow uses age estimation, the plugin checks that the result covers that age. For a document-only workflow secuveri checks the workflow’s own minimum age, so set it to the highest age you sell to.
How do I test without an ID document?
Use a sk_test_ key, set the environment to Sandbox and pick a sandbox scenario such as approved, declined_face_mismatch or review_liveness. Every session then finishes at once with that outcome. Orders placed this way get a note saying they were sandbox tests.
Does it work with express payment buttons?
With the check before checkout, the express buttons of WooPayments and WooCommerce Stripe are hidden on the pages of restricted products and on the cart page when the cart needs a check. Express buttons that go through the WooCommerce checkout or the Store API are checked like any other order. A button that creates orders some other way would bypass the check, so try your payment methods in sandbox mode with a restricted product.
Screenshots
Changelog
0.2.0
- Check after checkout: the order goes through and stays on hold until the buyer confirms their age.
- Age estimate first or always the ID document.
- Logged-in customers confirm their age once.
- Express buttons of WooPayments and WooCommerce Stripe are hidden for restricted products.
- Fix: signed results are issued by https://api-verify.secuveri.com.
- Personal data export and erase.
0.1.0
- First release.



