Cannot get orders from graphql with storefront token access

Hi guys,

I am becoming crazy about this one.

I am writing some Python code with my Visual Studio Code and trying to fetch my first 50 orders.

When I run it in the Shopify Graphql Explorer, it works. But if I run it from Visual Studio Code it returns me an error like I don’t have access.

Fetching the products of the store works, but not the orders… Any idea?

Thanks

If you’re using the Storefront API (assuming so based on the forum category) there is no general query for orders, only specific orders via node id. The Shopify Graphql Explorer you’re looking at might be for the Admin API?

Otherwise if you are using the Admin API make sure your access token has read_orders permissions.

yes actually I needed to use the admin api not the storefront. Then it worked :slightly_smiling_face: