When I do graphql query to get orders for a customer, orders older than 60 days are not returned, even though I have access to the scope all orders:
[access]
admin_api_access = [“read_all_orders”]
This is the graphql query: GraphQL Query:
In a “dev” app, i.e. something not published on the app store but public —or similar, forget current terminology— you should be able to select it from the “Read all orders scope” section and get access immediately.
Other than that, what’s in the result’s warnings property?
Yes, I have approval by Shopify to access all order.
This is on the app that is published.
The query is not returning orders that are older than 60 days.
Hey @Shiva_Godi! That 60-day cutoff is expected default behavior. Orders older than 60 days are hidden unless your app actually has the read_all_orders scope granted on the token making the call, and it tends to fail silently with no error, which lines up with what you’re seeing.
Approval at the app level is necessary but not sufficient. After you’re approved, you still have to add read_all_orders to the app’s scopes and then reinstall or reauthorize so the new scope lands on the live token. If the token predates the scope change, you’ll keep hitting the 60-day window. You can confirm what’s actually granted by querying currentAppInstallation { accessScopes { handle } } on the Admin API (or GET /admin/oauth/access_scopes.json on the legacy REST API) and checking whether read_all_orders is in the list.
The query you posted uses customer(customerAccessToken: ...) with fields like orderNumber and fulfillmentStatus, which is the Storefront API customer shape, but read_all_orders is an Admin API scope. So it’d help to know which API you’re actually calling here (Storefront, Customer Account API, or Admin), the app type and API version, and what comes back in the response warnings/errors that was asked about above. If you can also grab the X-Request-Id response header from one of the calls that’s missing the older orders, that lets me line it up against the logs and confirm what’s happening definitively. With that I can point you at the exact fix - thanks!