Using Admin API to query product sales with or without ShopifyQL

Shopify Partner
1 0 0

Hello Community,


ShopifyQL, which can be used with GraphQL to query sales data for products, itself is not depreciated, but the response object is. This seems kind of weird. I understand that this means while ShopifyQL is not depreciated, it essentially is because the response is. There just doesn't seem to be an alternative to using it. 


Is there an alternative for getting sales data via GraphQL admin API? 


The only other solution I can think of, is querying all orders and filtering the line items for the target product and summing up the sales.

Reply 1 (1)

Shopify Staff
1415 231 484

Hi @alban03,


At this time there's no way to query direct sales data via the Admin API query, though I do know this is a commonly requested feature and I will be sending up feedback on your behalf that you would like to see this added in the near future!

That said, one workaround you can use is querying Orders with a specific product SKU to get a list of all orders that contained that SKU. However it is important to know this does include orders that have refunded or returned the sku in question as well so you will need to keep that in mind when crafting your queries. Here's an example of a query that can retrieve all orders with a specific SKU.

   orders(first: 10, query: "sku:ABC123"){

I hope this helps, and I hope you have a great day 🙂


Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit or the Shopify Web Design and Development Blog