Third-party integrations

Shopify

Require wallet age verification at checkout for selected Shopify products.

Let shoppers browse your store and require proof of being 18 or over when their checkout contains selected products. Shopify manages the customer account and checkout. Ver.iD verifies the wallet credential; your connector records a temporary permission for that signed-in customer.

This guide uses Yivi and asks for its over-18 attribute. It does not request a birthdate or copy identity documents into Shopify. For wallet login to customer accounts, follow Shopify Plus customer login.

How it works

In this diagram, Client is the connector backend. A theme block starts the journey, and a Cart and Checkout Validation Function checks the result independently on Shopify's servers. A browser flag or a hidden checkout button cannot grant permission. See Shopify's validation API.

  1. A signed-in customer selects Verify I am 18 or over with Yivi in the store.
  2. Shopify forwards a signed request identifying the store and customer to the connector.
  3. The connector starts a Ver.iD disclosure. The customer approves the over-18 attribute in Yivi.
  4. The connector validates the signed result and confirms that the same Shopify customer is still signed in.
  5. It writes an app-owned permission valid until the next midnight in the shop's timezone.
  6. Shopify's Function permits checkout containing restricted products only while that customer's permission is valid.

What you need

RequirementWhere to get it
Shopify Plus, store-owner access and a custom developer appYour Shopify developer organization
A store eligible for your app's Functions distributionShopify Functions availability
The connector backend, age adapter, validation Function and theme extensionDownload the Shopify age-verification example (ZIP)
Node.js 22.12 or later and Corepack/YarnThe connector host
A public HTTPS origin for the connector, with persistent Host headers and cookiesYour hosting administrator
A prepared Studio organization and Yivi activatedPrepare your organization
A dedicated disclosure and attached OAUTH secretCreate a disclosure and OAuth secrets
Yivi with the trusted over-18 credentialYour wallet; see wallet availability and status

The downloadable custom app contains a Shopify Function and requires Shopify Plus. App Store distribution has different plan rules; this guide covers the custom-app route. See Shopify Function availability.

Use these values throughout the guide:

ValueDescription
<connector-origin>Public HTTPS origin without a trailing slash, such as https://age.example.com
<shop>The canonical your-store.myshopify.com hostname
Shopify OAuth callback<connector-origin>/oauth/callback
Ver.iD disclosure callback<connector-origin>/wallet/callback
Shop timezoneThe IANA timezone configured on the store, such as Europe/Amsterdam
Client ID and secretSeparate credentials for the Shopify app and the Studio disclosure

The connector uses Shopify Admin and Function API version 2026-10. Keep the extension manifest, generated schema and deployed app version aligned.

Configuration

This example marks one product as requiring proof of being 18 or over. A signed-in customer completes a wallet disclosure, returns to the cart and can continue checkout until the permission expires.

Download the Shopify age-verification example (ZIP) and extract it. Open examples/integrations in the extracted bundle. It contains the sibling age, shopify and shopify-backend directories used below. Keep that layout: the backend imports the shared disclosure adapter and the Function build imports the shared age policy.

In your Shopify developer dashboard, select the app's distribution method and enable the protected customer data access needed for its customer metafield. See Shopify's customer-data access procedure.

Configure Ver.iD

  1. Create a disclosure for this store and environment. Select Yivi and the trusted pbdf.gemeente.personalData.over18 attribute.
  2. Create a mapping. Set both its input key and output claim to ageOver18, and use:
(attributeData) => attributeData.ageOver18 === 'Yes';

This comparison accepts the exact positive Yivi value Yes. It returns a JSON boolean; the strings "true", "false" and "Yes / No" are not positive proof.

  1. Attach the mapping to the disclosure. Open Settings → Edit and set Token type to ver-id/ssi/disclosure/v1+JWT.
  2. In Ver.iD Studio → Verify → Disclosures → your flow → Redirect URIs, add <connector-origin>/wallet/callback. Attach an OAUTH secret, choose an active brand and activate the flow.
  3. Test the disclosure. The signed result must contain boolean true at mapping.ageOver18.value for a positive credential.

Keep the disclosure client identifier, organization UUID and secret's Key (as base64url) value. Obtain the expected signing issuer from your Ver.iD deployment administrator; it can differ from the HTTPS discovery issuer.

Configure the connector

Install the pinned dependencies with corepack yarn install --immutable in age and then in shopify-backend. In shopify-backend, copy .env.example to a private .env and fill in:

VariableValue
APP_ORIGIN<connector-origin>
SHOPIFY_SHOP<shop>
SHOPIFY_API_KEYYour developer app's Client ID
SHOPIFY_API_SECRETThat app's client secret
SHOP_TIMEZONEThe store's IANA timezone
SESSION_SECRETA separate private random value of at least 32 characters
VERID_ISSUERhttps://ssi.oauth.ver.id/
VERID_DISCLOSURE_CLIENT_IDThe disclosure's client identifier
VERID_CLIENT_SECRETIts attached secret's Key (as base64url) value
VERID_ORGANIZATION_UUIDThe organization that owns the disclosure
VERID_TOKEN_ISSUERThe expected signing issuer from trusted configuration

Supply this environment through your host's private configuration mechanism. Route the HTTPS origin to the backend's configured PORT and preserve Host and cookies. Disable caching and request logging for the OAuth, wallet, proxy and /verify/<ticket> routes: both query strings and ticket-bearing paths contain temporary authorization data. Keep TLS certificate validation enabled.

Build and install the developer app

In shopify-backend, sign in to the Shopify CLI with the account that owns the developer app, then run the configuration and build helpers:

corepack yarn exec shopify auth login
node scripts/shopify.mjs link
node scripts/shopify.mjs configure
node scripts/shopify.mjs schema
node scripts/shopify.mjs build
node scripts/check-function.mjs

The link helper selects the app using SHOPIFY_API_KEY from your private .env; it does not prompt for a different app. configure creates the app manifest from the supplied template. Confirm these settings:

SettingValue
Application URL<connector-origin>
Embedded appfalse
OAuth redirect URL<connector-origin>/oauth/callback
Access scopeswrite_products,write_customers,write_validations,write_app_proxy
App proxy URL<connector-origin>/proxy
App proxy prefix and subpathapps and verid-age
Function API version2026-10
Function handleverid-age-validation
Function targetcart.validations.generate.run

Resolve schema, type-generation, theme and Wasm build errors before deploying. Preserve the Function and theme extension UIDs assigned to your own app; never copy another app's UID. Upload a version for review:

node scripts/shopify.mjs deploy

The command uploads without releasing. In the Dev Dashboard, open Apps → your app → Versions, select the uploaded version and choose Release when its configuration and extensions are correct. App deployment does not host the connector backend or activate the checkout rule. See Shopify's version-release procedure.

Start the backend with the private environment supplied:

node --env-file=.env server.mjs

Open <connector-origin>/install and authorize your development store. The callback returns to Configure Ver.iD age verification. The storefront password alone does not authorize the app.

Activate enforcement and select products

  1. In the connector's configuration page, select Check private app-owned definitions.
  2. Select Activate deployed checkout validation. The connector enables its own deployed Function with blockOnFailure=true.
  3. In Shopify Admin, open Settings → Checkout → Checkout Rules and confirm that the Ver.iD rule is active. Its runtime-failure setting must block checkout; leave Allow all customers to submit checkout disabled. See Shopify's activation procedure.
  4. In the connector, enter the restricted product's Product GID, tick Require age verification and select Save product restriction. Use the product's Admin API identifier, not a variant or customer identifier.
  5. Leave a second product unrestricted. To remove a restriction later, save the same Product GID with the checkbox cleared.
  6. Open the store's theme editor and add the Ver.iD age verification block. Keep its app-proxy route at /apps/verid-age.

To find the Product GID, run this Admin API product query through your app's authenticated GraphQL client and copy the intended product's id:

query ProductsForAgeVerification {
  products(first: 20) {
    nodes {
      id
      title
    }
  }
}

The rule must be enabled as well as deployed. Shopify's blockOnFailure setting also blocks runtime exceptions; returning a validation error already blocks checkout progress.

Complete the customer journey

  1. Open the storefront in a fresh browser session, pass its development-store password page and sign in as a customer. A Shopify administrator session is separate.
  2. Add the restricted product and attempt checkout. It must remain blocked without age permission.
  3. Return to the store and select Verify I am 18 or over with Yivi. On the handoff page, select Continue to age verification to open the connector's HTTPS origin, then select Verify with Yivi.
  4. Scan the request with Yivi and approve the over-18 attribute. Continue in the original browser.
  5. Return to the cart as the same Shopify customer. Checkout should permit a test order until the next midnight in the store's timezone.
  6. Repeat with only the unrestricted product, then a mixed cart. The unrestricted cart needs no age permission; the mixed cart does.

Cancel a new disclosure and confirm it creates no permission. Signed-out checkout, an expired permission and direct checkout of a restricted product must remain blocked. An unrestricted product must still be purchasable without a disclosure.

Restarts and account binding

Run one backend process. Browser sessions use PostgreSQL, but merchant authorization and pending disclosure transactions are process-local. After a backend restart, open /install to authorize the store again, then repeat the definition and checkout-rule activation checks. Restart interrupted wallet requests.

The permission is bound to the signed-in Shopify customer account. It does not establish that the wallet holder is the named owner of that account. Keep the checkout rule's blockOnFailure=true setting.

On this page