SHOPIFY Uncaught (in promise) Error: GraphQL error: Access denied for orders field

Topic summary

A developer encounters “Access denied for orders field” errors when querying orders via GraphQL in a Shopify public app, despite having configured the necessary scopes including read_orders, read_all_orders, and write_orders.

Key Details:

  • The error occurs inconsistently—only affecting some merchants, not all installations
  • For failing merchants, preceding API calls for products and collections also fail with “Access denied” messages
  • Scope verification queries show all required scopes appear properly granted
  • The app has been approved for read_all_orders access

Troubleshooting Attempts:

  • Updated shopify.app.toml configuration file
  • Verified scopes using AppInstallation GraphQL query
  • Attempted re-authentication and redeployment

Current Status:

  • One user discovered that read_all_orders requires a special access request through Shopify Partner Support
  • The issue remains unresolved while awaiting approval from Shopify Partner Support
  • Shopify support suggested re-authenticating shops after scope changes and using the authorization code grant flow to update granted scopes
Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

I got this error to fetch orders with '@shopify/koa-shopify-auth’from a PUBLIC app.

Uncaught (in promise) Error: GraphQL error: Access denied for orders field.

The query is like this.

orders(first: 10, after: $cursor, query: $query, reverse: true) {
  edges {
    cursor
    node {
      currentTotalPriceSet {
        presentmentMoney {
          amount
          currencyCode
        }
      }
      tags
    }
  }
  pageInfo {
    hasNextPage
  }
}

with $query like this

let query = campaigns
   .map((campaign) => `tag:'FreeGiftCampaignId: ${campaign.id}'`)
   .join(" OR ");

I added reverse: true, and the scopes are correctly set

SCPOPES: read_orders,read_all_orders,write_orders,read_products,read_discounts,write_discounts,write_script_tags

Also the app has been approved for read_all_orders

The strange thing about this issue is that it’s not happening to every merchant only some of them have this issue

if i query the scopes for a failing merchant (just before the failing call) i got this which seems totaly fine

[
  {
    "handle": "read_all_orders"
  },
  {
    "handle": "write_orders",
  },
  {
    "handle": "read_products",
  },
  {
    "handle": "write_discounts",
  },
  {
    "handle": "write_script_tags",
  },
  {
    "handle": "read_orders",
  },
  {
    "handle": "read_discounts",
  },
  {
    "handle": "read_script_tags",
  }
]

also the 2 preceding calls which get a product and a collection fails with thoses errors

message: "Product access denied"
message: "Collection access denied"

So it definitely seems like a scope issue.

but what i am not getting is:

  1. it is not happening to everyone only a few merchant
  2. when checking the scopes for the failing merchant they seems fine
1 Like

Hey, I want to check out did you solved this problem. I’m trying to create an app where I will print orders but I got the error “Access denied for orders field.”
I change the scope of shopify.app.toml file, I don’t know did I miss something?

Hey @TanjaCodi ,

Thanks for sharing that you’ve updated the toml file. After updating the scopes, did you re-authenticate the shop you are testing on?

You can confirm if they were applied properly with a query on the app installation: https://shopify.dev/docs/api/admin-graphql/2024-04/objects/AppInstallation#field-appinstallation-accessscopes

If not, I would try deploying again. If you’re using the CLI, run the app deploy command, and then the next time you run the app, it should direct you to the authorization screen to accept the new scopes.

The guide for above is here: https://shopify.dev/docs/apps/auth/installation

Alternatively, you can use the steps here within the authorized code grant guide: https://shopify.dev/docs/apps/auth/get-access-tokens/authorization-code-grant/getting-started#step-7-change-the-granted-scopes-optional

Hope that helps!

  • Kyle G.

Hello @ShopifyDevSup I try everything bit I can’t deploy it because my app do not have access for read_all_orders. At the end I figured out that for this you need to request access for read orders. I am waiting for access from Shopify partner support so that I can see is it working or not. But thank you for your answer.