Get sales report via Admin API

Highlighted
Tourist
4 0 2

How to get a sales report  as shown at screenshots 

Sales report.png

 

According to docs, I have two options to get such report: Rest Admin API and ShopifyQL. I will try to describe problems with both options  

1) Rest Admin API

We able to do such request to Admin API. 

https://zzzzzzzzz:yyyyyyyyyy@xxxxxxx.myshopify.com/admin/orders.json?status=any&created_at_min=2018-...

Here a sample of the report that we can create from the response. https://docs.google.com/spreadsheets/d/1c71Q9MryA8Dzo36RK35De7UGpHAVbc4kVNQdiJv7UYM/edit#gid=0

And there we will get all metric except "Returns" that happened at the specified date range. This endpoint doesn't return orders which were refunded.       

Your API allows getting refunded orders via this endpoint https://zzzzzzzzzzzzzzzzzzz:yyyyyyyy@xxxxxxx.myshopify.com/admin/orders/681609199727/refunds.json           

But this endpoint doesn't allow to specify a date range. So, we don't know which orders were refunded at given day. Due to we have a discrepancy with Shopify UI in the total line. For our customers very important to get precise data. 

2) ShopifyQL is possible to use via Embedded SDK. If we right understand embedded apps don't allow pull data to third-party databases. We have our own UI, where customers want to see data from Shopify. So, that is why ShopifyQL is not suited to our case. 

We considered this feature also https://help.shopify.com/en/api/reference/analytics/report

Such way we able to do create a report that will be published to the Report page in Shopify admin. Meanwhile, we need to pull data to our databases.    

Can somebody please take a look here and help me find a solution. Our final goal to create sales report over time as shown on screenshots. Is the any other easiest way do it?