GraphQL Admin API Testing

Topic summary

A user is encountering authentication errors when attempting to query Shopify’s GraphQL Admin API via Postman to retrieve order data. They tested two URL endpoints with their app’s Admin API access token in the X-Shopify-Access-Token header.

Errors encountered:

  • /admin/api/2025-01/graphql.json: “Invalid API key or access token”
  • /api/2025-01/graphql.json: “This store is unavailable”

Suggested solution:

  • Use the correct endpoint format: https://{store_name}.myshopify.com/admin/api/2025-04/graphql.json
  • Ensure the admin access token is properly generated following Shopify’s authentication documentation
  • Verify the access token has the necessary scopes matching the query requirements (in this case, permissions to read orders)

The issue appears to stem from either incorrect token generation, missing scopes, or potentially using an outdated API version.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

I’m testing a simple API call in PostMan to get a list of orders. I have used both URL endpoints, https://{store_name}.myshopify.com/admin/api/2025-01/graphql.json and https://{store_name}.myshopify.com/api/2025-01/graphql.json, with an error response.

The Header X-Shopify-Access-Token is set to the APP’s Admin API access token.

The query is

{
“query”: “query { orders(first: 10) { edges { node { id } } } }”
}

https://{store_name}.myshopify.com/admin/api/2025-01/graphql.json response:

{
“errors”: “[API] Invalid API key or access token (unrecognized login or wrong password)”
}

https://{store_name}.myshopify.com/api/2025-01/graphql.json response:

{
“errors”: [
{
“message”: “This store is unavailable”,
“extensions”: {
“code”: “NOT_FOUND”
}
}
]
}

Hi @Barbb

To query Shopify Admin Graphql API, you should use url:

https://{store_name}.myshopify.com/admin/api/2025-04/graphql.json

Pay attention that you should add a admin access token for this: https://shopify.dev/docs/apps/build/authentication-authorization/access-tokens/generate-app-access-tokens-admin

Don’t forget that your admin access token need to grant exactly scope of your query.

1 Like