A Graphql query that fails for a specific merchant only

Hey everyone,

Hey guys, So as title says, I’ve got this error popping out when I run my app on one merchants store. “Access denied for productsCount field. Required access: read_products access scope.”

I’ve verified that this access scope is on my app, which it is, and I verified the details of the app on the merchants app settings and I can find the access scope there as shown by screenshot.

I tried the same api route where the error happens on both of my dev stores and also another merchants that I still have access to their store and everything works perfectly with no problems. But for this merchant the error happens.

I verified my database, I have session data about the merchant so the content is there. I use shopify api version of “2025-07” below is the query where the error happens

    );
    const productsCount = await client.request(/* GraphQL */
    `
      query {
        productsCount(limit: null) {
          count
        }
        productVariantsCount(limit: null) {
          count
        }
      }
    `);

I would appreciate any advice.

thanks these are my scopes SHOPIFY_API_SCOPES=read_products,write_products,write_pixels,read_customer_events,write_files,write_app_proxy (edited)

1 Like

Hey @bontalexel31, since this is happening on a single store, can you share the x-request-id that is returned in the API response headers?

I’d also suggest the following query to confirm that your access to this specific store has the required scopes. The issue could be that this particular shop hasn’t approved some of the permissions:

{
    currentAppInstallation {
        accessScopes {
            handle
        }
    }
}

Hey thank you for replying,

The first screenshot I shared is the details of the app from inside the merchant store.

On the other hand, I was able to solve this by using offline session tokens instead of online session tokens.

I believe the issue is probably linked to the fact that offline tokens access scope is defined by the app. while the online token access scope is defined by the user.

So I (as the user) had only access to the app and the theme through the collaborator access. I didn’t have access to edit products.

Was this clear?

Thanks for clarifying that. Yes, online access tokens sound like the issue. Glad you were able to pin point the issue.

Documentation here on online access tokens for anyone else who may be running in to similar limitations:

1 Like