Shopify API: Get Orders In Shopify by Date

2019-08-24 01:26发布

Why fetching Orders from Shopify Store by date and limits always returns the orders of latest date? like: if I make a query for getting 5 orders from 1 august 2012 using this query: /admin/orders.json?status=open&created_at_min=2012-08-01 12:00&limit=5

As I have 5 orders in 20 August 2012 and 5 orders in 31 August 2012 but this will returns 5 orders of latest date (31 August 2012).

4条回答
贪生不怕死
2楼-- · 2019-08-24 02:03

for bettween two dates

/admin/orders.json?created_at_min=2012-08-01 12:00&limit=2012-08-01 12:00
查看更多
家丑人穷心不美
3楼-- · 2019-08-24 02:15

The Shopify API returns orders from Most Recent to Oldest.

When you submit your query Shopify will first create an array of your ten orders; the first five are from 31 August, the last 5 are from 20 August.

Then, by limiting it to five orders, Shopify gives you the first five.

As far as I'm aware, there is no way to specify your own sort order in the Shopify API. You'll need to get all the orders with created_at_min= 2012-08-01 then, using whatever language you're writing in, get the last 5 items in the array.

查看更多
姐就是有狂的资本
4楼-- · 2019-08-24 02:16

It's not documented, but you can do it by adding: order=processed_at+asc to your query.

查看更多
来,给爷笑一个
5楼-- · 2019-08-24 02:17

&created_at_max=2012-08-01 11:59 does the trick

shopify order api

查看更多
登录 后发表回答