What’s the best way to get a list of sku’s with the number of sales for each from the last year.
At the moment I’m getting the list of order id’s, and then for each order, getting it’s details and reading through the lineitems. But it’s taking a while to run as there’s a query per order.
Then I think you’ll have to use the Order API. Not sure the precise correct usage in your case, but consider the BulkOperation, if you did not already.