Talk to us

Blog · 1 December 2026 · Rob Sherwood

New Custom Shopify Apps Must Use Expiring Tokens From Today

From today, 1 December 2026, any new custom Shopify app has to use expiring offline access tokens for the Admin API. The token your integration uses now lasts an hour, not forever. If you're about to build a custom app, or have one half built, this changes how it needs to handle its credentials.

It's the latest in a run of Shopify app security changes, after the IP allowlist for custom apps. This one is quieter, but it touches code that tends to get written once and never looked at again.

What changed

Shopify's changelog entry says every new custom app "must request and use expiring offline access tokens" for both the GraphQL and REST Admin APIs. Public apps have had to do this since 1 April. The rule now covers partner-built custom apps and apps that merchants create themselves, where the app is created on or after today.

An offline token is the one your app uses when nobody is sitting in the Shopify admin: the nightly stock sync, the order export to your warehouse, the webhook handler that updates your ERP. Until now that token usually never expired. It stayed valid until the app was uninstalled or its client secret was revoked.

The new version works differently. According to Shopify's access token docs:

  • The access token lasts 1 hour.
  • It comes with a refresh token that lasts 90 days when issued.
  • Every refresh gives you a new access token and a new refresh token. You're meant to store the new pair and use it from then on.

You ask for this by adding expiring=1 to your token exchange or authorisation code request, then storing the refresh token Shopify sends back. If you use Shopify's own app templates, they already request expiring tokens by default.

Who doesn't need to do anything yet

Custom apps and merchant-created apps set up before today can keep using their existing offline tokens. The changelog is clear on that, and the hard deadlines in the migration guide (delisting on 1 January, then rejected API calls from 1 April 2027) are for public apps. The docs say that timeline doesn't apply to custom apps.

If your app gets its token through the client credentials grant, which is common for apps on your own store, those tokens already expire after 24 hours. Shopify says that flow already meets the requirement.

So nothing breaks today for older custom apps. But the direction is obvious, and I'd rather move an app over in a quiet week than against someone else's deadline.

Where this actually bites

Asking for the token is the easy bit. Living with it is where an integration needs proper thought, and Shopify's token exchange docs are worth reading in full. A few things stood out to me.

Your token is now state, not config. A non-expiring token could sit in an environment variable for years. An expiring one changes every hour, and so does the refresh token. It belongs in a database row per store, written back every time you refresh. If the new refresh token gets lost because a process crashed halfway, you've got a problem.

Only one worker should refresh at a time. Shopify says to refresh one store at a time, because two workers refreshing at once can leave one holding a token the other has already replaced. If you've got a queue worker, a cron job and a webhook handler all calling the Admin API, they need a lock around the refresh, or one shared service that hands out tokens.

Know which errors to retry. Timeouts, network errors, 5xx responses and 429s are safe to retry with the same refresh token. A 401 saying the request "requires an active refresh_token" is not. Shopify says to treat that as final, stop retrying, and get a fresh token the next time the merchant opens your app. For a background integration on a client's store, that means someone needs to know about it straight away, not three weeks later when the stock levels are wrong.

Quiet stores still need a refresh. The refresh token is valid for 90 days. Shopify recommends refreshing at least once before then, so a seasonal store that only gets API traffic in the run-up to Christmas still needs a scheduled job keeping its token alive the rest of the year.

None of this is hard. It's just easy to skip when an app is built in a hurry.

Moving an existing app over

When you do decide to move, Shopify's migration guide gives three routes. The gentle one is to add expiring=1 to your token requests so each store moves across the next time the app gets a new token. Template apps do this with the expiringOfflineAccessTokens future flag and a redeploy.

The faster one swaps each stored non-expiring token for an expiring one in a single request. Be careful with that. Shopify says the migration "permanently invalidates the old token", so if anything else is quietly using the same token (a reporting script, a second server, a contractor's spreadsheet), it stops working. Find every caller first. The third route is application-only access tokens, signed with a private key, which suits some server-to-server setups.

The Dev Dashboard can help you check your progress. You can filter the logs to show requests still using non-expiring offline tokens, and there's an opt-in setting to reject requests for non-expiring tokens altogether once you're done.

The point of all this is that tokens leak, into Git history, log files and old laptops. One that expires within the hour is a much smaller problem when that happens. For the wider picture, I've written a plain-English guide to API keys in your code.

If you're not sure how your app handles tokens

Plenty of businesses have a custom Shopify app that works fine and that nobody has opened in a while. If you'd like to know whether yours will cope with expiring tokens, our code audit (£250 + VAT) will tell you how it authenticates, where its tokens live and what else uses them. We also build and look after custom Shopify apps and integrations, and if you'd rather someone just kept on top of changes like this one, Look after it starts from £355 a month + VAT.

Building something new this month? Get the token handling right from day one. It's far cheaper than retrofitting it.

Cheers, Rob

Tell us what you've got

It goes straight to Rob and Jase. You'll hear back from one of us, usually the same day, and we'll tell you honestly whether we're the right people.

Just want it checked? Code audit, from £250 + VAT