Refresh Token

Good afternoon,
I am implementing an App in Shopify Partners to allow stores to integrate and automate some processes. The issue we are facing is that we successfully authorize the store with the application, but then the token expires, showing the following message:

“Invalid API key or access token (unrecognized login or wrong password).”

How can we refresh the token, or what would be the correct way to handle this in order to retrieve the store’s information?

Thank you very much.

You have to go through the token exchange again if the session has expired. Or, if there’s no request, you possibly want to use offline tokens for that, as they don’t expire.

https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/guides/oauth.md
https://github.com/Shopify/shopify-api-js/blob/main/packages/shopify-api/docs/reference/auth/tokenExchange.md

1 Like