Re-creating 'Sales over time' through the API

dancooke
Tourist
7 0 1

Hey everyone, 

I'm trying to recreate the sales over time report which is available in the front end, via the API. I can do either through REST or GraphQL (not sure if there's much difference in terms of output), but really struggling to piece together the logic of how Shopify classifies each transaction. 

Ideally the solution to this would be either the specific requests, SQL transformations, or the logic by which Shopify classifies this report in the front end, so I can write the requests and transformations myself. 

Thanks so much

Dan

Reply 1 (1)
Juuhhiii
New Member
2 0 0

I am working on the same thing. I am trying to get sales over time ( yesterday and month to date). I get all data with the API call for the specific date time range. I am using total_price to sum all data which according to the documentation does not refunds into consideration. Hence refunds of orders placed before the date but processed on current date will be added to total. You will notice weekend data would not give discrepancies or days without refunds. I am trying to solve this but I am not getting a way through because fetching all refunds will be a lot of data.