[API] Invalid API Key Or Access Token (Unrecognized Login Or Wrong Password)

[API] Invalid API Key Or Access Token (Unrecognized Login Or Wrong Password)

nemmy
Shopify Partner
6 0 0

I have a public app and it generated an access token for a store "A".

I called order count API with the token as follows:

 

curl -X GET "https://storeA.myshopify.com/admin/api/2023-07/orders/count.json?status=any" -H "X-Shopify-Access-Token: ****"

 

Then I got the following error.


[API] Invalid API key or access token (unrecognized login or wrong password)

 

Actually I have another store "B" and its token works well with the same API and the same scope.

What is the problem of the token for store A? How can I remove this error and get the order count of the store?

Replies 2 (2)

lizk
Shopify Staff
246 58 79

Hi there 👋

That error means that the access token for store A is not correct. 

Some things you may want to verify to help you debug

  • Is your app currently installed on Store A? 
  • Is the access token an online or offline access token?
  • Are there any copy paste errors with your access token when creating your curl request?

To learn more visit the Shopify Help Center or the Community Blog.

ECKizuna
Shopify Partner
1 0 1

Hi Lizk,

 

We encountered a similar issue. In our case, after successful authorization, the AccessToken can be used normally. However, after a period of time, attempting to use it again results in the error message "Invalid API key or access token (unrecognized login or wrong password)," even though the store has not been logged into nor used the Shopify API during this period. After re-authorizing, we found that the AccessToken is the same as before, but it becomes usable again. We are using an offline mode AccessToken.