Shopify API: Get Orders In Shopify by Date

≯℡__Kan透↙ 提交于 2019-12-11 14:51:55

问题


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).


回答1:


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.




回答2:


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




回答3:


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

shopify order api




回答4:


for bettween two dates

/admin/orders.json?created_at_min=2012-08-01 12:00&limit=2012-08-01 12:00


来源:https://stackoverflow.com/questions/12318899/shopify-api-get-orders-in-shopify-by-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!