A Shopify app may need to access a merchant’s store long after the merchant has closed its browser or signed out of the app. Inventory synchronisation, scheduled reports and webhook processing are common examples. These tasks depend on server-side authentication that can continue working without an active merchant session.
Shopify is changing how newly created apps handle that access.
From December 1, 2026, newly created custom apps and merchant-created apps must use expiring offline access tokens when communicating with the Admin API. Developers can no longer design these new integrations around the assumption that an offline token will remain valid indefinitely.
The updated approach uses two credentials: a short-lived access token for API requests and a refresh token that lets the backend obtain replacement credentials. Because Shopify rotates the refresh token during a successful renewal, your application must also update its stored credentials correctly.
This guide looks at the practical consequences of the change, including OAuth configuration, token renewal, background processing, secure storage and migration planning.
Quick Summary
- The December 1, 2026 requirement applies to newly created custom apps and merchant-created apps.
- Public apps have already been subject to expiring offline token requirements since April 1, 2026.
- Add
expiring=1when requesting an expiring offline token through the supported OAuth flows.- An expiring access token lasts one hour.
- Its accompanying refresh token initially has a 90-day lifetime.
- Shopify returns replacement credentials during a successful refresh.
- Store the new access token and refresh token together.
- Background workers and webhook handlers need a way to renew credentials without a merchant being signed in.
- Recent Shopify app templates can manage much of the refresh process automatically.
- Custom apps created before December 1 can retain their existing non-expiring offline tokens under this requirement.
Why Shopify Is Changing Offline Token Authentication
Offline authentication is designed for work that happens outside an active merchant session.
Imagine an app that imports a store’s orders into an external reporting system every night. The merchant does not need to open the app whenever the scheduled job runs. The server uses its stored credentials to request the required information from Shopify.
The same arrangement is useful for:
- Updating inventory records.
- Synchronising product information.
- Processing incoming webhooks.
- Generating scheduled sales reports.
- Running automated fulfilment tasks.
- Maintaining information in external business systems.
The problem with a credential that remains valid indefinitely is the amount of time it may remain useful if it is exposed.
Shopify’s expiring-token approach introduces a renewal cycle. An access token has a limited lifetime, and the application must use its refresh token to obtain another one. This gives developers a defined credential lifecycle instead of relying on a single long-lived access token.
For developers, that means authentication needs to become an ongoing backend process rather than something handled only when a merchant first installs an app.
Which Shopify Apps Must Use Expiring Offline Tokens?
The December 1 change does not apply identically to every Shopify application.
The requirement depends on the app category and when the app was created.
| App category | Applicable requirement |
|---|---|
| Public apps created from April 1, 2026 | Expiring offline tokens required |
| Custom apps created from December 1, 2026 | Expiring offline tokens required |
| Merchant-created apps from December 1, 2026 | Expiring offline tokens required |
| Custom apps created before December 1, 2026 | Existing non-expiring tokens may remain under this requirement |
What About an App That Already Exists?
If you created a custom app before December 1, you do not have to replace its existing non-expiring offline token simply because today’s requirement has taken effect.
This is an important distinction for developers maintaining older integrations. The new-app requirement should not be interpreted as an immediate migration deadline for every existing custom app.
Public apps have a separate enforcement schedule. Developers maintaining public apps that still use non-expiring offline tokens should plan for these dates:
- January 1, 2027: Affected public apps are delisted from the Shopify App Store and blocked from new installations.
- January 15, 2027: Merchants using affected public apps receive warnings in Shopify admin.
- April 1, 2027: Shopify rejects affected Admin API requests that use non-expiring offline tokens.
These dates relate to the public-app migration requirement. They are not additional December 1 deadlines for older custom apps.
The Two Credentials Behind Expiring Offline Access
The new approach separates API authentication from the ability to renew authentication.
Your application receives two credentials when it obtains an expiring offline token:
Access token
This is the credential your backend sends when making authenticated requests to Shopify’s Admin API. Its lifetime is one hour.
Refresh token
This credential is used to request a replacement access token. Its initial lifetime is 90 days.
The response from Shopify also provides expiration information:
| Response field | Meaning |
|---|---|
expires_in | Remaining lifetime of the access token, expressed in seconds |
refresh_token_expires_in | Remaining lifetime of the refresh token, expressed in seconds |
Use the actual values returned by Shopify when calculating expiration. Avoid assuming that a credential will always have a particular remaining lifetime when your application receives it.
Why the Refresh Token Must Be Replaced Too
A refresh operation is not simply a request for another access token.
When Shopify successfully renews an expiring offline token, it returns a replacement access token and a replacement refresh token.
Consider a store that has just installed your app:
- Shopify issues Access Token A and Refresh Token A.
- Your backend uses Access Token A for Admin API requests.
- When renewal is needed, your backend submits Refresh Token A.
- Shopify returns Access Token B and Refresh Token B.
- Your application saves both new credentials.
- The next renewal uses Refresh Token B.
The original refresh token must not remain your application’s permanent renewal credential.
This is the central detail developers need to account for when implementing token rotation.
Requesting an Expiring Offline Token
The exact implementation depends on the OAuth method used by your application.
For the authorization code grant and token exchange, Shopify supports requesting an expiring offline token with the expiring=1 parameter.
If you use a Shopify app template, check whether its authentication configuration already enables the feature before adding custom token-handling code.
Using Shopify’s App Templates
Recent Shopify Remix and React Router app templates support expiring offline access tokens through the expiringOfflineAccessTokens configuration option.
A configuration can look like this:
// shopify.server.ts
const shopify = shopifyApp({
// Keep your existing Shopify configuration.
future: {
expiringOfflineAccessTokens: true,
},
});
The example shows the relevant option, not a complete application configuration. Keep your existing API credentials, scopes, host configuration and other settings.
If your template already enables this behaviour, do not add a second or conflicting configuration. Check the version and settings of the Shopify packages installed in your project.
When configuration changes require a new app deployment, use the normal Shopify CLI deployment process:
shopify app deploy
One advantage of using a supported template is that the authentication framework can take responsibility for obtaining and renewing tokens. This avoids building a separate refresh system when the framework already provides one.
Implementing Token Exchange Directly
Developers who manage token exchange themselves need to request the expiring offline token explicitly.
The following example illustrates the request structure:
curl -X POST \
"https://{shop}.myshopify.com/admin/oauth/access_token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=urn:ietf:params:oauth:grant-type:token-exchange" \
--data-urlencode "subject_token={id_token}" \
--data-urlencode "subject_token_type=urn:ietf:params:oauth:token-type:id_token" \
--data-urlencode "client_id={client_id}" \
--data-urlencode "client_secret={client_secret}" \
--data-urlencode "expiring=1"
Replace the example values with the actual store hostname, application credentials and valid ID token.
The parameter to pay particular attention to is:
expiring=1
Without the intended expiring-token configuration, your request may not follow the authentication model required for the new application.
After Shopify responds, your server should process the returned credential information and save it against the relevant store installation.
Using the Authorization Code Grant
Applications that use the authorization code grant must also request an expiring offline token during the code exchange.
For example:
curl -X POST \
"https://{shop}.myshopify.com/admin/oauth/access_token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "client_id={client_id}" \
--data-urlencode "client_secret={client_secret}" \
--data-urlencode "code={authorization_code}" \
--data-urlencode "expiring=1"
This is the token exchange request after the merchant’s authorization flow has produced a valid authorization code.
The server should handle the response. Do not move the client secret or returned token credentials into browser-side code.
Building the Refresh Process
After obtaining an expiring token pair, your backend needs a renewal operation.
Shopify uses the refresh_token grant type for this request. It is sent to the store’s token endpoint.
Refresh Request Example
curl -X POST \
"https://{shop}.myshopify.com/admin/oauth/access_token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=refresh_token" \
--data-urlencode "client_id={client_id}" \
--data-urlencode "client_secret={client_secret}" \
--data-urlencode "refresh_token={refresh_token}"
The important request values are:
| Parameter | Value to provide |
|---|---|
grant_type | refresh_token |
client_id | Your application’s client ID |
client_secret | Your application’s client secret |
refresh_token | The latest refresh token saved for that shop |
A successful response contains a new credential pair. Your backend should update its stored values before another process attempts to use them.
Node.js Example: Renewing a Store’s Token
Here is a basic implementation using the built-in fetch API:
async function refreshShopifyToken(shop, currentRefreshToken) {
const response = await fetch(
`https://${shop}/admin/oauth/access_token`,
{
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({
grant_type: "refresh_token",
client_id: process.env.SHOPIFY_CLIENT_ID,
client_secret: process.env.SHOPIFY_CLIENT_SECRET,
refresh_token: currentRefreshToken,
}),
}
);
if (response.status === 401) {
throw new Error("Shopify rejected the refresh token.");
}
if (response.status === 429 || response.status >= 500) {
throw new Error("Temporary Shopify authentication failure.");
}
if (!response.ok) {
throw new Error(`Token request failed: ${response.status}`);
}
const result = await response.json();
return {
accessToken: result.access_token,
refreshToken: result.refresh_token,
accessTokenExpiresAt:
Date.now() + result.expires_in * 1000,
refreshTokenExpiresAt:
Date.now() + result.refresh_token_expires_in * 1000,
};
}
This function performs the renewal request and returns the new credentials with calculated expiry timestamps.
It does not write to a database. Your application should pass the result to a persistence layer and save the replacement pair together.
For a production application, also implement:
- Per-shop refresh locking.
- Atomic credential updates.
- Retry handling for temporary failures.
- Safe logging that excludes secret values.
- Monitoring for expired or rejected refresh credentials.
A successful HTTP response should not be treated as a completed renewal until the replacement credentials have been saved successfully.
Designing Secure Token Storage
The refresh token is particularly sensitive because it can be exchanged for another access token.
Protect it as carefully as the access token, and do not treat it as an ordinary configuration value.
A practical storage design should account for each shop separately. For example, a database record could contain:
| Field | Purpose |
|---|---|
shop_domain | Identifies the Shopify store |
access_token_encrypted | Stores the protected access token |
refresh_token_encrypted | Stores the protected refresh token |
access_token_expires_at | Records when the access token expires |
refresh_token_expires_at | Records when the refresh token expires |
updated_at | Tracks the most recent credential update |
The names above are an illustrative database design, not Shopify-mandated field names.
Follow these security practices when implementing it:
Encrypt credentials before persistence. Use an appropriate encryption-at-rest mechanism or secrets-management service. Limit which application components can decrypt the values.
Separate installations. A store’s token pair must never be used to authenticate requests for another shop.
Keep credentials on the server. Never return refresh tokens or client secrets through frontend endpoints or browser storage.
Update both tokens in one transaction. Do not save the new access token while leaving the old refresh token in place.
Keep secrets out of logs. Record useful metadata such as the shop, renewal result and error category without printing complete credentials.
Restrict access to the token store. Background workers and API services should receive only the permissions they need.
These practices help prevent a token-management issue from becoming a wider store-access problem.
Background Jobs and Webhooks Need Their Own Authentication Strategy
An app’s normal user interface is not the only place where Shopify API requests happen.
A scheduled worker might run at night. A webhook handler might receive an event while no merchant is using the application. Both still need valid credentials to access the Admin API.
This is why token renewal must be available to server-side processes.
Consider a webhook that requires an API request to retrieve additional order information. A reliable handler should follow a sequence like this:
- Verify the incoming webhook before processing it.
- Identify the store associated with the event.
- Load that store’s credential record.
- Check the access token’s expiration information.
- Renew the token if necessary.
- Save the replacement credential pair.
- Perform the required Admin API operation.
Scheduled tasks can use the same token-management service.
Avoid implementing a different refresh mechanism in every worker. A shared server-side authentication service makes it easier to enforce consistent expiry checks, credential storage and retry behaviour.
Should the Backend Refresh Every Token Every Hour?
Not automatically.
An access token has a one-hour lifetime, but that does not mean every installed store needs a refresh request every hour even when the application has nothing to do.
A demand-based approach can renew credentials when an operation needs them. A scheduled strategy can also be appropriate for active installations, provided it accounts for the refresh token’s own expiry.
For example, an app with frequent inventory updates might check token validity before each batch of work. An application that receives occasional webhook events might renew only when a request needs a fresh access token.
Whichever strategy you choose, do not wait until an API operation repeatedly fails before building renewal handling.
Preventing Problems During Refresh-Token Rotation
Token rotation introduces a failure scenario that developers should test.
Suppose Shopify completes a refresh operation and returns a replacement token pair. Before your server can save the response, the connection fails.
Your database still contains the previous refresh token, while Shopify has already issued a replacement.
Shopify provides a recovery window for this situation. The previously issued refresh token remains usable until the replacement token is used, subject to a maximum of 30 days from its first use and the original 90-day expiry.
This behaviour gives an application an opportunity to recover from certain interrupted refresh operations.
However, it is not a substitute for correct persistence.
A robust implementation should:
- Keep the existing stored token until a replacement response has been received.
- Save the new access token and refresh token together.
- Use a transaction or equivalent atomic persistence mechanism.
- Prevent multiple workers from refreshing the same shop at the same time.
- Retry temporary network failures and server errors carefully.
- Treat an invalid or rejected refresh token as a different condition from a temporary outage.
A 401 response should not be handled with an endless retry loop. If Shopify rejects the refresh credential, investigate whether it has expired, been revoked or become invalid. The installation may need to go through authorization again.
Authentication Methods That Already Use Expiring Credentials
The new requirement does not mean every Shopify app must implement the same refresh-token workflow.
Some authentication methods already use expiring credentials.
| Authentication approach | Token behaviour |
|---|---|
Authorization code grant with expiring=1 | Returns an expiring offline token pair |
Token exchange with expiring=1 | Returns an expiring offline token pair |
| Supported Shopify app templates | Can manage the expiring-token lifecycle |
| Client credentials grant | Uses expiring access tokens |
| Application-only access tokens | Uses expiring credentials without a refresh token |
Client Credentials Grant
The client credentials grant already provides expiring access tokens for its supported use cases.
These tokens have a 24-hour lifetime. Developers using this flow do not need to add the ordinary offline refresh-token mechanism simply to satisfy the December 1 requirement.
The authentication method still needs to be appropriate for the application and the requested API access.
Application-Only Access Tokens
Shopify also supports application-only access tokens for eligible public-app use cases.
Rather than storing a refresh token for each shop, the application creates a signed client assertion using its private key and requests an application-only token through the applicable client credentials flow.
These credentials expire. When the application needs another one, it requests a replacement rather than refreshing an existing token.
This approach can be useful for supported background operations, but it has separate eligibility and implementation requirements. It is not a universal replacement for ordinary offline authentication.
Planning a Migration for Existing Public Apps
If you maintain a public Shopify app that still relies on non-expiring offline tokens, you should plan its migration separately from the December 1 new-app requirement.
Shopify provides more than one migration approach.
Gradual Migration
You can update the normal token acquisition flow to request expiring credentials.
As installations go through the relevant authentication process, they can move to the new token model individually.
This approach spreads the migration work across installations rather than replacing every credential at once.
Migration Across Existing Installations
Another approach is to exchange stored non-expiring tokens for expiring token pairs through the supported token exchange flow.
This requires careful coordination between the token exchange and your database. Make sure each replacement pair is saved correctly before the application starts using it.
Application-Only Authentication
For eligible background operations, you may be able to use application-only access tokens instead of maintaining store-specific offline refresh credentials.
Review the access requirements and supported API operations before choosing this design.
Update the Normal Authentication Flow First
Whichever migration approach you select, update the application’s normal token acquisition process as part of the work.
Otherwise, new installations could continue receiving credentials that your migration process is intended to replace.
Test the complete lifecycle, including initial installation, token renewal, interrupted requests, database persistence and reauthorization.
Shopify Developer Checklist for December 1
Before releasing a newly created custom or merchant-created app, review the following:
- Confirm the app category and creation date.
- Identify the authentication flow used for Admin API requests.
- Check whether your Shopify app template already supports expiring offline tokens.
- Enable
expiringOfflineAccessTokenswhere the template requires it. - Include
expiring=1in supported direct offline-token requests. - Store the returned access and refresh credentials separately for each shop.
- Record the expiry information returned by Shopify.
- Implement a server-side refresh operation.
- Save replacement credentials atomically.
- Prevent concurrent refresh requests for the same installation.
- Make scheduled jobs and webhook handlers use the shared authentication service.
- Add retry handling for temporary errors.
- Keep credentials out of frontend code and application logs.
- Test what happens if a refresh succeeds but database persistence fails.
- Test recovery and reauthorization when a refresh credential is rejected.
If you maintain a public app, also review its migration progress against the January and April 2027 enforcement dates.
Final Thoughts
The December 1 update makes token lifecycle management part of the authentication design for newly created Shopify custom and merchant-created apps.
The initial OAuth exchange is only the beginning. Your backend must know when an access token expires, obtain replacements when needed and keep the rotating refresh credential safely stored.
Developers using recent Shopify templates may already have much of this behaviour provided by their authentication framework. Those implementing OAuth directly need to build the renewal and persistence logic themselves.
Existing custom apps created before December 1 can retain their current non-expiring offline tokens under this particular requirement. Public apps have a different migration timeline and should not treat that exception as applying to them.