Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Cannot get orders from graphql with storefront token access

Solved

Cannot get orders from graphql with storefront token access

Nathan617
Tourist
4 0 2

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 

Accepted Solution (1)

c10s
Shopify Partner
67 12 27

This is an accepted solution.

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.

View solution in original post

Replies 2 (2)

c10s
Shopify Partner
67 12 27

This is an accepted solution.

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.

Nathan617
Tourist
4 0 2

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