Shopify · api · fg-0333

Shopify offline access token stops working after an hour, or on January 1 2027 if it never expires

If you see [API] Invalid API key or access token about an hour after install, the cause and the fix for Shopify are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
[API] Invalid API key or access token about an hour after installToken exchange returns a non-expiring token because expiring defaults to 0A background job's refresh token stops working after another process refreshed or re-acquired the token for that store
Cause
Public apps must use expiring offline tokens for the GraphQL Admin API: new apps already, existing apps by 2027-01-01. Expiring tokens last one hour with a 90 day refresh token; a newly acquired token retires older ones, which stay valid until they expire, and a presented refresh token stops working once the newer one is used.
Fix
Request expiring=1 in token exchange, store the rotating refresh token, and refresh from one place per shop before expires_in runs out. Apps on the official templates refresh automatically.
Apply
POST https://{shop}.myshopify.com/admin/oauth/access_token grant_type=refresh_token&client_id=...&client_secret=...&refresh_token=STORED_REFRESH_TOKEN # persist the new access_token, expires_in, refresh_token, refresh_token_expires_in # token exchange: add expiring=1
Affected
Public Shopify apps calling the GraphQL Admin API; enforced for existing apps on 2027-01-01; not custom or merchant-created apps
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun