Skip to content

Shopify Dude Fix

New Shopify Custom App Tokens Expire After December 1, 2026: Fix Your Background Jobs

New custom and merchant-created Shopify apps must use expiring offline tokens from December 1, 2026. Update token storage and refresh before cron jobs and webhook workers fail.

Quick answer: Starting December 1, 2026, newly created custom apps and merchant-created apps must use expiring offline access tokens for Admin API calls. Do not build a new integration around a permanent token. If you use OAuth code exchange or token exchange, request expiring=1, securely store the refresh token, and rotate it whenever you refresh. Existing custom apps created before December 1 can retain their existing offline tokens.
On this page

Why old custom-app tutorials are now misleading

Older tutorials often describe an offline Admin API token as permanent until uninstall or credential revocation. That can still describe a pre-December custom app, but not a new custom app created on or after December 1, 2026. Shopify announced the expanded requirement November 19, 2026. New public apps already needed expiring offline tokens beginning April 1, 2026; existing public apps have a separate 2027 enforcement timeline.

Offline access is not the same as non-expiring access. Offline means a background worker can call the Admin API without a staff member currently using the app. A one-hour expiring token can still be used by cron jobs if the backend manages refresh properly.

Implement the correct credential lifecycle

  1. Inventory every Admin API caller: webhook consumers, scheduled syncs, ERP jobs, queues and regional workers. Record which app and token flow each uses.
  2. For authorization-code or token-exchange flows, include expiring=1 when obtaining an offline token. Store access_token, refresh_token, expires_in and refresh_token_expires_in securely per shop.
  3. Refresh before access-token expiry. Each successful refresh rotates the refresh token, so update the stored token pair atomically; do not allow concurrent workers to overwrite a newer refresh token.
  4. Use a maintained Shopify app template where possible. Recent templates handle expiring offline tokens and refresh. For a hand-built integration, implement refresh and invalid-token recovery explicitly.
  5. If you use the client-credentials grant, its tokens already expire after 24 hours and satisfy the requirement. Application-only access tokens also satisfy it; those flows have different renewal mechanics from OAuth refresh tokens.

Example: the token request change

POST https://{shop}.myshopify.com/admin/oauth/access_token
Content-Type: application/x-www-form-urlencoded

grant_type=urn:ietf:params:oauth:grant-type:token-exchange
&subject_token={id_token}
&subject_token_type=urn:ietf:params:oauth:token-type:id_token
&client_id={client_id}
&client_secret={client_secret}
&expiring=1

Replace placeholders server-side. Never expose tokens in browser code or logs. For a Shopify app template, use the documented expiringOfflineAccessTokens setting rather than reimplementing the token store. Distinguish a token-expiry error from an IP allowlist denial, missing scope or staff permission; all can look like an authentication problem.

Production rollout

Test token rotation on a development store before creating a new production app. A newly created app must be compatible on day one. Do not rotate a pre-December production integration merely because its app appears in the Dev Dashboard; the existing-app exception is real. Public apps have different requirements and should follow Shopify’s migration guide.

Common misunderstanding: “Offline token” means “never expires.” Offline describes session independence, not token lifetime. Also, changing the app’s IP allowlist does not implement token refresh.
How to test this

  1. Create a new development custom app with the intended authentication flow and obtain an offline token; confirm its expiry and refresh fields.
  2. Perform a harmless GraphQL Admin read, then refresh the token and confirm the next read succeeds with the replacement access token.
  3. Force a controlled near-expiry condition in your token-store logic; confirm a scheduled job refreshes before making its API request.
  4. Run two concurrent workers and verify only the current refresh token is persisted; ensure stale workers do not overwrite it.
  5. Restart the worker and confirm tokens remain available from secure persistent storage, not process memory.
  6. Test an invalid refresh token and verify recovery is explicit, logged safely, and does not create a retry storm.