what is the Admin (REST/GraphQL) API to get the list of 'Sales by product' report?

Shopify Partner
2 0 0

url: https://admin.shopify.com/store/{store}/reports/sales_by_product_name?since=-30d&until=today


1 thing I can find is that we need to use the ShopifyQL which needs a merchant to be subscribed as Shopify Plus. I already tried the Order REST API and map the line_items to get the Gross Sales but the data is not the same

Replies 2 (2)

Shopify Staff
2731 293 744

Hi Yuriih1,


There's no direct API access to get the report data that is available in the admin. To replicate these kinds of reports you you could either use ShopifyQL to create your own reports (but this is available for Plus stores only), or use data received from the order API, but the reports may not match up 100%. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Shopify Partner
2 0 0

is there any reference/code snippet how to get the total sales of each product from the data received from the Order API?