Test Your Apps Early: Opt‑In to Admin API Token Expiry from the Dev Dashboard

Learn how to enable the new Admin API token expiry setting in the Shopify Dev Dashboard, why it matters for public apps, and step‑by‑step actions to test and validate your migration before the April 1, 2027 enforcement deadline.

Test Your Apps Early: Opt‑In to Admin API Token Expiry from the Dev Dashboard
6 sections

Shopify is preparing public apps for a major security change: Admin API tokens will start expiring on April 1, 2027. To give developers a safe runway, the Dev Dashboard now lets you opt‑in to token expiry today. This post walks you through what changed, who needs to care, and exactly how to enable the setting and verify your app’s behavior before the enforcement deadline.

What Changed

When you toggle the *Admin API token expiry* switch on an app’s Settings page, the following rules are applied to every store where that app is installed:

  • Offline access tokens that are marked *non‑expiring* are rejected.
  • Delegate (online) tokens that have more than 24 hours left before their natural expiry are also rejected.
  • Both GraphQL and REST Admin API calls will receive a 401 error if they use a disallowed token.
  • Enforcement propagates within ~30 minutes; existing tokens are not revoked automatically.
  • You can turn the setting off at any time, but the 2027 deadline for public apps remains unchanged.
  • Who’s Affected

  • Public apps (the majority of apps listed in the Shopify App Store) must meet the April 1, 2027 deadline. Opt‑in lets them test their migration early.
  • Custom apps and merchant‑created private apps are exempt from the enforcement date, but they can still use the toggle to validate their token handling.
  • The setting is available for all app types in the Dev Dashboard, but it only takes effect for an app after you enable it.
  • How to Opt‑In and Validate Your Migration

  • Complete the migration guide – Follow Shopify’s Admin API token expiry migration guide to update your OAuth flow, token storage, and refresh logic.
  • Enable the toggle – In the Dev Dashboard, open your app, go to Settings → Admin API token expiry, and click Turn on. Confirm the warning that non‑compliant requests will fail.
  • Wait for enforcement – Give the system up to 30 minutes to apply the rule across all installations.
  • Monitor logs – Check the GraphQL and REST logs in the Dev Dashboard. Shopify highlights potential token‑expiry issues detected in the last 14 days (note: detection can lag by a day).
  • Test background jobs – Many apps have cron‑style processes that use offline tokens. Run them manually or wait for the next scheduled run to ensure they now use expiring tokens or refreshed delegate tokens.
  • Iterate – If you see 401 errors, adjust your token refresh strategy, then re‑test. You can temporarily turn the toggle off while troubleshooting, but remember to turn it back on before the final deadline.
  • Code Example: Updating Your OAuth Flow

    Below is a minimal Node.js/Express snippet that requests an online token (which expires automatically) and stores the refresh token for later use. Notice the grant_options[]=per-user flag, which is required for expiring tokens.

    javascript

    app.get('/auth', (req, res) => {

    const shop = req.query.shop;

    const redirectUri = ${process.env.HOST}/auth/callback;

    const authUrl = https://${shop}/admin/oauth/authorize? +

    client_id=${process.env.API_KEY} +

    &scope=${process.env.SCOPES} +

    &redirect_uri=${encodeURIComponent(redirectUri)} +

    &state=${nonce()} +

    &grant_options[]=per-user;

    res.redirect(authUrl);

    });

    app.get('/auth/callback', async (req, res) => {

    const { shop, code, state } = req.query;

    // Verify state, exchange code for token

    const tokenResponse = await fetch(https://${shop}/admin/oauth/access_token, {

    method: 'POST',

    headers: { 'Content-Type': 'application/json' },

    body: JSON.stringify({

    client_id: process.env.API_KEY,

    client_secret: process.env.API_SECRET,

    code,

    grant_options: ['per-user']

    })

    });

    const data = await tokenResponse.json();

    // data.access_token is now an expiring token (max 24h)

    // data.refresh_token can be used to obtain a new access token

    // Store both securely for the shop

    await storeTokens(shop, data);

    res.redirect('/');

    });

    Best Practices Before the 2027 Deadline

  • Run automated tests that simulate token expiry by forcing a 401 response and confirming your retry logic works.
  • Log rejected requests with clear identifiers (shop, endpoint, token type) so you can quickly locate failing flows.
  • Update documentation for any partner developers or internal teams that rely on your app’s API calls.
  • Communicate with merchants if you anticipate temporary downtime while you finish the migration.
  • Keep the toggle on after testing; turning it off repeatedly can mask lingering issues.
  • Plan for the deadline – Even if you’ve tested early, schedule a final validation window a few weeks before April 1, 2027 to catch any edge cases that only appear at scale.
  • Conclusion & Next Steps

    Enabling Admin API token expiry in the Dev Dashboard is a low‑risk way to future‑proof your Shopify app. By opting in now, you can catch token‑related errors early, update your authentication flows, and ensure a smooth experience for merchants when the April 1, 2027 enforcement kicks in.

    Ready to test? Open your app’s Settings in the Dev Dashboard, turn on the token‑expiry toggle, and start monitoring. If you hit any snags, revisit the migration guide or drop a comment below – we’re here to help you stay compliant and secure.

    Tags
    Sources

    Related Articles

    How Shopify’s New Bot Detection Improves Cart & Checkout Analytics

    How Shopify’s New Bot Detection Improves Cart & Checkout Analytics

    Shopify’s latest update enhances bot detection for cart and checkout activity, giving merchants clearer insights and developers new data handling considerations. Learn what changed, who’s impacted, and how to adapt your reports and integrations.

    November 16, 20264 min
    App Security Update: Mandatory IP Allowlist, Bulk Ops Changes, and Upcoming MFA for Shopify Partners

    App Security Update: Mandatory IP Allowlist, Bulk Ops Changes, and Upcoming MFA for Shopify Partners

    Shopify now requires all public apps that call the Admin API to enable an IP allowlist by Nov 20 2026, tightens bulk‑operations rules, and will enforce MFA for partner accounts. Learn who’s impacted and how to comply today.

    November 14, 20264 min
    Unlock Transparency: The New Store Activity Log Lets You Track Every Change

    Unlock Transparency: The New Store Activity Log Lets You Track Every Change

    Shopify’s rebuilt Store activity log centralizes every modification—from products to payments—into one searchable timeline. Learn what’s new, who can see it, and how merchants and developers can act today.

    November 13, 20264 min
    Custom Draft Order Discounts Now Respect Presentment Currency

    Custom Draft Order Discounts Now Respect Presentment Currency

    Shopify now calculates custom draft‑order discounts in the draft’s presentment currency instead of the shop’s default. Learn what this means for merchants, developers, and how to update your workflow today.

    November 13, 20264 min