Help!: 'Access denied for order field. Required access: ⁠ read_orders ⁠ access scope or ⁠ read_marketplace_orders ⁠ access scope.',

Hello,

I have been facing a new issue with my app where some shops that use it throw this error.

message: ‘Access denied for order field. Required access: ⁠ read_orders ⁠ access scope or ⁠ read_marketplace_orders ⁠ access scope.’,

We already have (and always have had) the read_orders scope, I think this started happening after Shopify’s rework of roles and permissions.

Does anyone know how to fix this?

Thanks!

Hey @Novoid ,

Can you share an example of the orders query you are making that occasionally returns the scope error? I’d be happy to take a look.

Is the error consistent on the shops where it’s returned?

When you query the access scopes on the shop does it list the read_orders scope?

query AccessScopeList {
  currentAppInstallation {
    accessScopes {
      handle
    }
  }
}

Hey!
Thanks for getting back so promptly.
Yes, we have the read_orders scope and it works on our test stores.
We are having this issue particularly in a store that uses Advanced Shopify and it happens everytime. We haven’t been able to read any of the orders that they have. I tried using GraphiQL with the read_orders scope and it cannot run that query either. I had to enable the read_all_orders scope and then I was finally able do it.

The thing is, I don’t need to read orders that are older than 60 days, since we only read orders that have just come using the order_paid webhook.

That’s interesting. Since it did work with read_all_orders, it does seem scope related in some way.

Are you using any query parameters that could potentially return orders older than 60 days?