Shopify API get total sales of each product for date

ecomtrack122
New Member
1 0 0

Hello Shopify Community,

 

I have created an third party analytics tool and I would like to access the entire sales of each product in the shop of a specific date.

So I would like to receive a list of a structure like this where I can the read the sales of each product of a specific date.

 

Like:

[{

 'ProductId': ...,

 'Price': ...,

  'Quantity': ...

},

{

 'ProductId': ...,

 'Price': ...,

  'Quantity': ...

}]

 

But I would like to receive only the products which had any sales at this date.

Right now I tried to get all orders of the day, but the api is returning only 50 orders per request and if the shop has thousands of orders each day it would be quit painful to make so many requests to get all the information to calculate the turnover of each product on this specific day.

 

 

Thank you for your help guys.

 

 

 

 

0 Likes
Jayvin
Shopify Partner
132 17 30

Hi,

 

You can use the bulk api for this.

  1. Submit the query (get all orders for a particular date)
  2. Wait for the operation to finish
  3. Download the data, filter and structure the data as you want and that's it.

You could also save some of the data to your database for example, the product id, product_title, sales_count and the date.

0 Likes