Migration tool in early accessGadget is shutting down. Move your Shopify app to Meridian with our automated migration tool.See how it works →
All articles
Guide

Shopify expiring offline access tokens: how to migrate before January 1, 2027

Shopify delists public apps that still use non-expiring offline tokens on January 1, 2027. How expiring tokens and refresh work, and how to migrate every store.

By Bryan Medica, Founding Engineer at Meridian·Updated

Does your public Shopify app have to move to expiring offline access tokens? Yes, if it calls the Admin API, and by January 1, 2027. On that day, an app that still sends non-expiring offline tokens is delisted from the Shopify App Store and blocked from new installs, and from April 1, 2027 its Admin API requests return 403. You migrate the stores that already installed your app in code, by exchanging each stored token, without asking merchants to reinstall.

In short. Request expiring tokens for every new install, then exchange each non-expiring token you have stored for an expiring pair. From then on, refresh one store at a time and save each new pair in a single write. You are done when the Dev Dashboard Logs show no request made with an “Offline, non-expiring” token.

What changes, and when

Shopify is retiring offline tokens that never expire for public apps, in three steps that start on January 1, 2027. The requirement covers GraphQL and REST Admin API requests. Those dates do not apply to custom apps, apps created by merchants, online access tokens or Payments Apps API requests, but custom and merchant-created apps created from December 1, 2026 must use expiring tokens from the start.

DateWhat changes
December 10, 2025Offline access tokens can expire after 60 minutes and come with a refresh token. Optional.
March 20, 2026Shopify announces the requirement for public apps created from April 1, 2026.
April 1, 2026New public apps can no longer use non-expiring offline tokens for the Admin API.
May 20, 2026The requirement extends to every public app, including those created before April 1, 2026, from January 1, 2027.
August 28, 2026A refresh token stays usable until the app uses its replacement, so a lost refresh response can be recovered.
September 29, 2026A lost migration response can be recovered by repeating the exchange within 7 days.
October 27, 2026Enforcement is split into three dates, and application-only access tokens become available to public apps.
November 16, 2026An Admin API token expiry setting in the Dev Dashboard lets you make Shopify reject non-expiring tokens early, to test.
December 1, 2026Custom apps and merchant-created apps created from this day must use expiring offline tokens from the start.
January 1, 2027Public apps still sending non-expiring tokens are delisted from the App Store and blocked from new installs.
January 15, 2027Merchants using those apps see a warning in the Shopify admin.
April 1, 2027Admin API requests that present a non-expiring offline token return 403.

The May announcement said apps would get authentication errors from January 1. The October 27 update replaced that with the three dates above, so existing installs keep working until April 1. Shopify is clear that this is not a grace period:

January 1 is the migration deadline: The later dates give merchants time to prepare, and should not be treated as extra time to migrate.
Shopify changelog, October 27, 2026

What Shopify measures is the token your app presents on Admin API requests. Holding an unused non-expiring token does not make an app non-compliant, while sending one from a forgotten job does. The Dev Dashboard raises a Deprecated offline token alert when your app has made such a request in the past 14 days. The emails Shopify sends count every non-expiring token still active, including ones your app no longer uses, and Shopify said on November 2 that some of those counts were too high.

How do expiring offline access tokens work?

An expiring offline access token lasts 1 hour and comes with a refresh token that lasts 90 days. Your app uses the refresh token to get a new pair before the access token runs out, with no merchant involved.

Non-expiringExpiring
LifetimeNo expiry. Valid until the app is uninstalled or its client secret is revoked.1 hour (expires_in is 3600)
Refresh tokenNone90 days when issued (refresh_token_expires_in is 7776000), replaced on every refresh
How you get oneThe default, when expiring is left out or set to 0expiring=1 on token exchange or the authorization code grant
What you storeThe access tokenThe access token, the refresh token and both expiry times
If it leaksWorks until someone revokes itThe access token stops working within the hour
Public appsDelisting on January 1, 2027, then 403 from April 1, 2027Required

A refresh is a POST to https://{shop}.myshopify.com/admin/oauth/access_token with grant_type=refresh_token, the refresh token and your client credentials. Each refresh returns a new access token and a new refresh token with a fresh 90 days. The previous access token keeps working until its own hour ends, so requests already in flight finish.

The refresh token you presented is not invalidated at once. It stays usable until the first of these:

  • your app uses the newer refresh token,
  • your app acquires a new token through token exchange or the authorization code grant,
  • 30 days pass since its first use,
  • its original 90 days end.

When a refresh token can no longer be used, Shopify answers 401 with {"error": "invalid_request"} and the description “This request requires an active refresh_token”. It sends the same answer for a replaced, expired or unknown token and for an uninstalled app, so your code cannot tell them apart and should not try. Network errors, timeouts, 429 and 5xx answers are different, and safe to retry with the same refresh token.

Token pairs move from current to previous to retired as a refresh returns a new pair.
Each refresh returns a new access token and a new refresh token. Use the newest pair: the previous refresh token stays usable until you use its replacement, and older ones are retired.

A store nobody uses does not need a refresh every hour. Refresh when there is work to do, and at least once before the 90 days end, so the store keeps working without the merchant opening your app.

Moving existing stores without a reinstall

Your server exchanges each stored non-expiring token for an expiring pair, using the token itself and your client credentials, with no merchant session. Shopify documents three ways to stop sending non-expiring tokens, and the first two work together.

OptionWhat your app doesWhat happens to installed stores
1. GraduallyAdd expiring=1 to the token requests your app already makes, and store the refresh token.A store moves the next time your app gets a new token for it. Stores nobody opens never move.
2. All at onceExchange each stored non-expiring token for an expiring pair, with no user session.Each store moves as soon as you exchange its token. Covers background-only apps.
3. Application-only accessSign a client assertion with a private key and request a short-lived token per store when you need one.Nothing to refresh. The stored tokens stay valid until you stop sending them.

Make the option 1 change first, so that tokens your app gets later expire too, then run option 2 for the stores already installed. Option 1 alone is risky in the React Router template, as the next section shows. The exchange is the request below. Both requested_token_type and expiring=1 are required.

The migration request
curl -X POST https://{shop}.myshopify.com/admin/oauth/access_token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=urn:ietf:params:oauth:grant-type:token-exchange' \
  -d 'client_id={client_id}' \
  -d 'client_secret={client_secret}' \
  -d 'subject_token={non_expiring_offline_token}' \
  -d 'subject_token_type=urn:shopify:params:oauth:token-type:offline-access-token' \
  -d 'requested_token_type=urn:shopify:params:oauth:token-type:offline-access-token' \
  -d 'expiring=1'

The exchange permanently invalidates the old token for Admin API requests, so the new pair must be saved before anything else. If the response never reaches you, repeating the same request with the original token within 7 days returns the same pair. That recovery ends early once you refresh the pair or a later token acquisition replaces it.

AnswerWhat to do
200Save the four values in one write, then discard the old token.
Timeout, network error, 429 or 5xxRepeat the same request with the original token, with backoff. Within 7 days, Shopify returns the same pair.
400 invalid_subject_tokenThe token is not an active non-expiring offline token of this app: already migrated, expiring, online or scope-restricted. Check the row by hand.
403, 404 or 423Shopify has made the store unavailable. Skip it and keep the token. It can be exchanged if the store comes back.

Run it as a batch you can stop and start again. Shopify’s staff advise exchanging a small cohort first and checking real API calls and background jobs before you go further. The script below takes the offline sessions that have neither an expiry nor a refresh token, exchanges them one store at a time, retries what is transient and saves each pair only if the row still holds the token it exchanged. Shopify does not publish a rate for this endpoint, so start one store at a time and add concurrency only once the logs stay clean.

scripts/migrate-offline-tokens.ts
// One store to rehearse: npx tsx scripts/migrate-offline-tokens.ts your-dev-store.myshopify.com
// Then 10 more stores: npx tsx scripts/migrate-offline-tokens.ts 10
// Then the rest: npx tsx scripts/migrate-offline-tokens.ts all
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

type TokenPair = {
  access_token: string;
  expires_in: number;
  refresh_token: string;
  refresh_token_expires_in: number;
  scope: string;
};

function log(shop: string, outcome: string, status?: number, requestId?: string | null, detail?: string) {
  // Never log a token.
  console.log(JSON.stringify({ shop, outcome, status, requestId, detail }));
}

function exchange(shop: string, legacyToken: string) {
  return fetch(`https://${shop}/admin/oauth/access_token`, {
    method: "POST",
    headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" },
    body: new URLSearchParams({
      grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
      client_id: process.env.SHOPIFY_API_KEY!,
      client_secret: process.env.SHOPIFY_API_SECRET!,
      subject_token: legacyToken,
      subject_token_type: "urn:shopify:params:oauth:token-type:offline-access-token",
      requested_token_type: "urn:shopify:params:oauth:token-type:offline-access-token",
      expiring: "1",
    }),
    signal: AbortSignal.timeout(15_000),
  });
}

async function migrate(session: { id: string; shop: string; accessToken: string }) {
  for (let attempt = 1; attempt <= 5; attempt++) {
    let response: Response;
    try {
      response = await exchange(session.shop, session.accessToken);
    } catch {
      await sleep(2 ** attempt * 1000); // Timeout or network error: repeat the same request.
      continue;
    }
    const requestId = response.headers.get("x-request-id");

    if (response.ok) {
      let pair: TokenPair;
      try {
        pair = (await response.json()) as TokenPair;
      } catch {
        // The body was lost after Shopify issued the pair: the same request returns it again.
        await sleep(2 ** attempt * 1000);
        continue;
      }
      const now = Date.now();
      // One write for the whole pair, and only if the row still holds the token we exchanged.
      const { count } = await prisma.session.updateMany({
        where: { id: session.id, accessToken: session.accessToken },
        data: {
          accessToken: pair.access_token,
          expires: new Date(now + pair.expires_in * 1000),
          refreshToken: pair.refresh_token,
          refreshTokenExpires: new Date(now + pair.refresh_token_expires_in * 1000),
          scope: pair.scope,
        },
      });
      log(session.shop, count ? "migrated" : "row changed during the exchange, check it", response.status, requestId);
      return count > 0;
    }
    if (response.status === 429 || response.status >= 500) {
      log(session.shop, "retrying", response.status, requestId);
      await sleep(2 ** attempt * 1000);
      continue;
    }
    // 400 invalid_subject_token, or 403, 404 or 423 for a store Shopify made unavailable.
    return log(session.shop, "not migrated", response.status, requestId, (await response.text()).slice(0, 200));
  }
  log(session.shop, "still failing after 5 tries, run the script again later");
}

const arg = process.argv[2];
const oneShop = arg?.endsWith(".myshopify.com") ? arg : undefined;
const limit = oneShop || arg === "all" ? Infinity : Number(arg);
if (limit !== Infinity && !(Number.isSafeInteger(limit) && limit > 0)) {
  throw new Error("Pass a store's myshopify domain, a number of stores to migrate, or all.");
}
const legacy = await prisma.session.findMany({
  where: { isOnline: false, expires: null, refreshToken: null, ...(oneShop ? { shop: oneShop } : {}) },
  select: { id: true, shop: true, accessToken: true },
  orderBy: { shop: "asc" },
});
let migrated = 0;
for (const session of legacy) {
  if (migrated >= limit) break;
  // One store at a time. Stores that can't migrate stay in the list but don't count, so the next run moves on.
  if (await migrate(session)) migrated++;
}
await prisma.$disconnect();

The exchange retires any other refresh token for the store, so a token your app acquires while the script runs (a reinstall, or a merchant opening the app) can be retired by the migration while the row check refuses to save the migration’s pair. A lock shared with your refresh workers does not stop that, because the template’s own token exchange never takes it. Run the batch when merchants are least likely to open the app, and refresh once every store the script logs as changed: a 401 means the migration retired its pair, and the merchant’s next visit, or application-only access, gets a new token.

The migration script exchanges stores in turn, retries a 503 and saves the new pair in the session row.
A run of the script, in the outcomes it logs: each store is exchanged in turn, a 503 is retried until the store migrates, a store Shopify made unavailable is left as it is, and the new pair lands in the store's session row.

Option 3 is a different route. Application-only access tokens come from the client credentials grant with a JWT your server signs with its own private key, whose public key you add in the Dev Dashboard. Each token lasts up to an hour, with no refresh token, and several can be valid at once. It suits apps that would rather not store and rotate a refresh token for each store, and it is also how you get a store back after losing its refresh token, without waiting for the merchant.

Expiring tokens in Shopify’s React Router template

In @shopify/shopify-app-react-router, one future flag turns on expiring offline tokens, and the Prisma session table needs two more columns to hold them. Newly scaffolded apps already have both.

app/shopify.server.ts
const shopify = shopifyApp({
  // ...
  sessionStorage: new PrismaSessionStorage(prisma),
  future: {
    expiringOfflineAccessTokens: true,
  },
});
prisma/schema.prisma
model Session {
  id                  String    @id
  shop                String
  state               String
  isOnline            Boolean   @default(false)
  scope               String?
  expires             DateTime?
  accessToken         String
  // ...the other columns of the template...
  refreshToken        String?
  refreshTokenExpires DateTime?
}

Shopify added refreshToken and refreshTokenExpires to the template in December 2025 by editing its first migration. A migration that has already run never runs again, so an app scaffolded before then has neither column in its database. Add the two fields to the schema, create a migration with npx prisma migrate dev --name session_refresh_token and deploy it before the flag. Without the columns, the app cannot save an expiring session.

After the change, the offline row (offline_{shop}) holds an access token whose expires is an hour away, a refresh token, and a refreshTokenExpires 90 days out. In webhooks, Flow, app proxy, fulfillment service and unauthenticated contexts, the library refreshes it when it has expired or expires within the next 5 minutes, and saves the new pair to the same row. A page of your app loading in the admin never refreshes: when the session has expired, authenticate.admin runs token exchange instead, which is what Shopify’s docs ask for while a merchant session is active.

The flag does not touch the stores you already have. A session stored without an expiry date never counts as expired, so authenticate.admin keeps using its non-expiring token and never exchanges it. Shopify’s staff confirm that changing the configuration “does not convert credentials already stored in your database”.

The Session table contains a new expiring session alongside older non-expiring sessions.
The Session table after the flag is turned on: the store installed since then holds an expiring pair, and the rows saved before keep their non-expiring token until you exchange them.

Background jobs and webhooks

Code that runs without a merchant must ask the library for an admin context instead of reading the token from the database. A token read straight from the Session table lives an hour at most, and is usually expired by the time a nightly job uses it.

unauthenticated.admin(shop) loads the offline session, refreshes it when needed and returns a GraphQL client. authenticate.webhook, authenticate.flow, the fulfillment service and app proxy contexts do the same. None of them takes a lock, though: two jobs for the same store that start together both see an expired token and both refresh it.

Two jobs share one store lock so only the first refreshes and the second reuses its token pair.
Two jobs for the same store, one lock: the first refreshes and saves the new pair, the second waits, reads the row again and uses that pair. One refresh request instead of two.

Within one process, share one call per store:

app/admin-for-shop.server.ts
import { unauthenticated } from "./shopify.server";

type AdminContext = Awaited<ReturnType<typeof unauthenticated.admin>>;
const pending = new Map<string, Promise<AdminContext>>();

// Every caller in this process shares one load, and at most one refresh, per store.
export function adminForShop(shop: string): Promise<AdminContext> {
  let context = pending.get(shop);
  if (!context) {
    context = unauthenticated.admin(shop).finally(() => pending.delete(shop));
    pending.set(shop, context);
  }
  return context;
}

// In a job:
const { admin } = await adminForShop(shop);
const response = await admin.graphql(`#graphql
  query { shop { name } }`);

Across several workers or instances, wrap the same call in a lock all of them share, such as GET_LOCK in MySQL, an advisory lock in PostgreSQL or a key set with NX in Redis. The second worker then reads the row the first one saved, finds a valid token and does not refresh. The library’s own paths do not take your lock, though. When a merchant opens the app as a job refreshes, the page’s token exchange retires every other refresh token for the store, so one of the two pairs is dead on arrival. Shopify’s docs say not to acquire and refresh at the same time for the same store. Services that need tokens on their own schedule are a good fit for application-only access, whose tokens never replace each other.

Webhooks need one more change. With the flag on, authenticate.webhook refreshes the store’s token before your handler runs. When a store uninstalls, its tokens are revoked, so for any store idle for more than an hour that refresh fails. Up to version 4.0.2 the library then answered 500 instead of calling your handler, and app/uninstalled and the compliance topics failed on every retry. Version 4.0.3, released on November 12, 2026, calls your handler without a session instead, so upgrade to it or later.

The template’s app/uninstalled route deletes the sessions only inside if (session), so once a session can be missing it must delete them by store. The compliance routes must likewise do their work before they answer 200. Deleting by store has one catch, as in the template: an app/uninstalled retry that arrives after a quick reinstall also deletes the new install’s session. The merchant’s next visit runs token exchange again, but background jobs for that store fail until then.

app/routes/webhooks.app.uninstalled.tsx
import type { ActionFunctionArgs } from "react-router";
import { authenticate } from "../shopify.server";
import db from "../db.server";

export const action = async ({ request }: ActionFunctionArgs) => {
  const { shop } = await authenticate.webhook(request);
  // From 4.0.3 the session is missing when the refresh failed, so delete by store.
  // Deleting nothing is fine on a retry.
  await db.session.deleteMany({ where: { shop } });
  return new Response();
};

Races, lost responses and other edge cases

Overlapping refreshes and responses that never arrive are what break token renewal most visibly. The table covers what each case does and the fix.

CaseWhat happensWhat to do
Two workers refresh the same storeOne of them ends up holding a token the other has already replaced, and may save it last.One refresh per store at a time. Read the row again after taking the lock.
A refresh response is lostA timeout or a 5xx arrives after Shopify issued the new pair.Retry with the same refresh token. It stays usable until you use its replacement, for up to 30 days from its first use.
A store sits idle for monthsNothing refreshes it, and the refresh token reaches its 90 days.Refresh once before then, from a scheduled job that looks at refreshTokenExpires.
A frozen storeRefreshing still works, but Admin API requests return 402.Pause the store's data jobs, keep refreshing its token.
The merchant uninstallsEvery token is revoked, and the next refresh returns 401.Delete the store's sessions in your app/uninstalled handler.
The merchant reinstallsThe new install's token exchange retires every other refresh token for the store.Let the install overwrite the row, and never write back a pair a job read before it.
You restore a database backupA refresh token in the backup still works if nothing has retired it since. One retired by later refreshes or a new acquisition does not come back.Try each stored refresh token. On a 401, application-only access, or the merchant opens the app again.
Several services use the same storeShopify gives one app and store a single refresh chain, not one per service.One owner refreshes and the others ask it for a token, or each uses application-only access.
You rotate the client secretAccess tokens tied to the old secret stop working, and every store's token must be refreshed.Refresh every store afterwards, and keep the rotation out of the migration window.

The lost-response case is the one the August 28 change fixed. In June, a developer reported two 520 errors on refresh requests, after which every retry with the stored refresh token returned 401 and the merchant was locked out for about two hours. Shopify first added a short retry window, then the rule that a refresh token stays usable until you use its replacement. It does not bring back a refresh token that later refreshes or a new token acquisition have already retired, so a backup restored from days ago, or a chain that two workers keep rotating at the same time, can still end in a 401.

Developers also reported refresh tokens that came back expiring about a second after they were issued, instead of 90 days later. The developer who reported it says Shopify’s support confirmed a fix at the end of July. Read refresh_token_expires_in from every response rather than assuming 90 days, and alert when it is far shorter.

A migration checklist

The list follows the order that keeps every store working during the change. Copy it into your issue tracker and tick each line off.

expiring-tokens-checklist.md
- [ ] Find every place that reads an offline token: routes, jobs, queues, webhooks, scripts, other services
- [ ] Add refreshToken and refreshTokenExpires to the Session table, with a migration
- [ ] Update @shopify/shopify-app-react-router (4.0.3 or later), @shopify/shopify-api and the Prisma session storage
- [ ] Replace every direct read of session.accessToken with unauthenticated.admin(shop)
- [ ] Serialize refreshes per store: one process, then every worker and instance
- [ ] Delete sessions by store in app/uninstalled, since the session can be missing
- [ ] Deploy those changes, then turn on future.expiringOfflineAccessTokens and deploy
- [ ] Log every token request: shop, grant, status, Shopify error, x-request-id, never the token
- [ ] Exchange the stored non-expiring tokens on a dev store, then on a few stores, then on all
- [ ] Skip stores answering 403, 404 or 423, and check every 400 by hand
- [ ] Schedule a refresh for stores whose refresh token expires within a few weeks
- [ ] Filter the Dev Dashboard Logs by token type until "Offline, non-expiring" is empty
- [ ] Watch the Deprecated offline token alert clear, 14 days after the last old request
- [ ] Turn on Admin API token expiry in the Dev Dashboard to confirm nothing breaks

How to test the migration on a dev store

Install the current version of your app on a dev store first, so the store holds a non-expiring token like your real installs, then reproduce each failure on purpose.

  1. Check the offline row: expires and refreshToken are empty.
  2. Deploy the flag and the new columns, then open the app. The row does not change, which shows why the migration script is needed.
  3. Run the script with the dev store’s myshopify domain, so it exchanges that store only. The row now has an expires an hour away and a refreshTokenExpires 90 days out, and an Admin API call through the app works.
  4. Force an expiry by setting expires to a minute ago in the database, then run a background job. The row gets a new pair, and your logs show one refresh.
  5. Force an expiry again and start two jobs for the store at the same moment. Your logs should still show one refresh.
  6. Refresh once by hand with the stored refresh token and do not save the answer. The app’s next refresh, with the same token, must still succeed.
  7. Force an expiry, then uninstall the app. app/uninstalled must answer 2xx and delete the store’s sessions.
  8. In the Dev Dashboard Logs, set Type to GraphQL request and Token type to “Offline, non-expiring”, with a time range that starts after the migration. Use the app and run a job, then check that nothing appears for the dev store. Repeat with REST request if your app uses REST.
  9. Turn on Admin API token expiry in the app’s Settings in the Dev Dashboard. From then on, every store rejects Admin API requests that use a non-expiring token, within about 30 minutes. Run your jobs and webhooks again and watch for rejected requests. The setting migrates nothing and you can turn it off, but it applies to every store with the app installed, so try it once your real installs are migrated.

What to monitor once you’ve switched

Watch the Dev Dashboard for leftover non-expiring requests, and your own logs for refreshes that fail. The first tells you whether Shopify sees you as migrated, and the second whether stores are about to lose access.

  • The Deprecated offline token alert clears 14 days after your app’s last request with a non-expiring token. If it stays, filter the Logs by token type to find the requests. Logs keep 30 days, a search covers at most 7, and a wide range can show a sample.
  • Count refresh answers by status. Each 401 invalid_request is a store that needs a new token, while a run of 5xx is a Shopify incident to retry through, as on October 29, 2026, when token requests returned 504 for a while.
  • Look for any 403 whose message contains “Non-expiring access tokens are no longer accepted”. A missing access scope also returns 403, so match on that phrase.
  • Track stores whose refreshTokenExpires is getting close, and the 2xx rate of app/uninstalled and the compliance webhooks.

Log each token request with the store, the grant type, the status, Shopify’s error code, the new expiry times and the x-request-id header, which Shopify needs to look into a failed request. Never log the tokens themselves.

For apps that bill through Meridian. To create a Shopify subscription for a store, Meridian’s Plan Builder reads that store’s offline access token from your app’s own session table, the one this migration changes. The hosting docs explain how.

Sources: Shopify’s pages on access tokens, migrating to expiring offline access tokens, refreshing an expiring offline token, application-only access tokens and monitoring and logs, the October 27 and November 19 changelog entries, the staff Token Expiry FAQ in the developer community, and the source code of @shopify/shopify-app-react-router 4.0.4. All checked on November 19, 2026. For how Shopify delivers the webhooks above, see the guide to Shopify webhooks.

Questions.

When do Shopify's non-expiring offline access tokens stop working?

On April 1, 2027, Admin API requests that present one get a 403. Before that, on January 1, 2027, a public app still sending them is delisted from the Shopify App Store and blocked from new installs, and from January 15 its merchants see a warning in the admin. Shopify treats January 1 as the deadline, not April 1.

Do merchants have to reinstall my Shopify app to move to expiring tokens?

No. Your server exchanges each stored non-expiring token for an expiring pair, with your client ID and secret and no merchant session. The old token stops working for Admin API requests at once, so save the new pair before anything else. A lost response can be recovered by repeating the same request within seven days.

Does turning on expiringOfflineAccessTokens migrate the sessions I already store?

No. The flag makes new token exchanges ask for expiring tokens and refreshes sessions that already expire. A session saved without an expiry date still counts as valid, so the library keeps sending its non-expiring token. Exchange those rows yourself, once the Session table has its refreshToken and refreshTokenExpires columns.

Why does my Shopify refresh token return 401 invalid_request?

The refresh token can no longer be used: it was replaced by one you have since used, it expired, or the app was uninstalled. Shopify sends the same answer in every case, so stop retrying. Get a new token when the merchant next opens the app, or with application-only access. Timeouts, 429 and 5xx answers are different: retry those.

Do I need to refresh expiring offline tokens every hour?

No. Refresh when your app has API work to do and the access token is about to expire. A store with no activity can stay idle, as long as you refresh once before its refresh token's 90 days run out. Frozen stores can still refresh, although their Admin API requests return 402 until the merchant pays.

Why does the Dev Dashboard still warn about non-expiring tokens after we migrated?

The alert counts Admin API requests made with a non-expiring token in the past 14 days, so it clears 14 days after the last one. If it stays, some code still sends an old token: look for workers, queued jobs and rare tasks. Filter the Logs by token type to find the requests and the stores behind them.

Ready to ship your next Shopify app?

Try Meridian free, or book a personal walkthrough.

14 days, no card needed.