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
- Inventory every Admin API caller: webhook consumers, scheduled syncs, ERP jobs, queues and regional workers. Record which app and token flow each uses.
- For authorization-code or token-exchange flows, include
expiring=1when obtaining an offline token. Storeaccess_token,refresh_token,expires_inandrefresh_token_expires_insecurely per shop. - 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.
- 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.
- 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.
- Create a new development custom app with the intended authentication flow and obtain an offline token; confirm its expiry and refresh fields.
- Perform a harmless GraphQL Admin read, then refresh the token and confirm the next read succeeds with the replacement access token.
- Force a controlled near-expiry condition in your token-store logic; confirm a scheduled job refreshes before making its API request.
- Run two concurrent workers and verify only the current refresh token is persisted; ensure stale workers do not overwrite it.
- Restart the worker and confirm tokens remain available from secure persistent storage, not process memory.
- Test an invalid refresh token and verify recovery is explicit, logged safely, and does not create a retry storm.

