3
votes

I try to create a Shopify application with koa. I use the koa-shopify-auth official package and the two methods shopifyAuth and verifyRequest to get a token with right scopes from the shop.

After getting fresh and validated token with right scope, I make a request on https://xxx.myshopify.com/admin/api/2019-04/shop.json which is a simple endpoint to get information about the shop using app.

Sometime I get the right answer from the API, but sometime I get an error:

{
    "errors": "[API] API Access has been disabled"
}

The token is good because some shop works well, the token is not invalid for this shop because this is not the same error (Invalid API key etc.)

Do you know this error message and why I get it ?

1
Can you provide some of the token related code? How/where are you saving it and how are you using it? Are you using some kind of an encryption before storing it or are you saving at as a plain text? Do you have the right scopes for the App? We will need to see some code here in order to provide any help. - drip
Thank for your comment, the problem comes from before my own BL so a good example is the official documentation with express help.shopify.com/en/api/tutorials/… I didn't fix the problem but i found an alternative, I will answer to my question and close this topic - Nicolas de C

1 Answers

1
votes

I didn't find a solution to this problem but I found an alternative to move around, the app must be uninstall and reinstall, really painful to say that to clients but it seems to work.

This issue is maybe related with API access mode (online/offline) and the Shopify security might be confused about this.

An API request made using an online mode access token is guaranteed to respect the user's individual permissions. Shopify returns a 403 Forbidden status code when the access token is valid but the user does not have access. Application developers should make sure to handle such a response gracefully.

From API access mode (Shopify doc)