How to recover from "[API] Invalid API key or access token" error due to using accessMode online

Shopify Partner
4 0 1

At first I was using access mode online then save the access token in DB to later using it for to do some background work.


Then I encounter error "[API] Invalid API key or access token" due access token in DB expired, so I change to using access mode offline to handle this issue, new access token created by shopify after this no longer having this issue but old access token still getting the error.


Is there any way for backend to request new access token for specific store to recover from this error ?

Reply 1 (1)

Shopify Staff
59 6 11

Hi @eias ,

I had a closer look at your question here. There are several approaches to handling this access token process. We have an extensive collection of documentation that covers authentication, OAuth, a guide on rotating access tokens for different types of apps and approaches, among other resources. 

As you mentioned generating access for an apps backend, I would also suggest this resource on Session Tokens. 

Cheers. Hope this helps your search!

KB77 | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit or the Shopify Web Design and Development Blog