Shopify API:获取订单Shopify按日期 [英] Shopify API: Get Orders In Shopify by Date
问题描述
为什么取订单从Shopify存储日期和限制始终返回最新日期的订单?
这样的:如果我做一个查询,从2012年8月1日获得5订单
使用此查询: /admin/orders.json?status=open&created_at_min=2012-08-01 12:00安培;限值为5
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
当我2012年8月有5个订单在2012年8月20日和5订单31
但是这将返回5订单最迟日期(2012年8月31日)。
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).
推荐答案
的Shopify API返回订单最新到最旧。
The Shopify API returns orders from Most Recent to Oldest.
当您提交查询Shopify将首先创建10个数量的数组;前五个来自8月31日,最后5是从8月20日。
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.
然后,通过将其限制在五个数量,Shopify给你的第一个五年。
Then, by limiting it to five orders, Shopify gives you the first five.
据我所知,是没有办法指定Shopify API在自己的排序顺序。你需要得到的所有的订单与 created_at_min = 2012-08-01
然后,使用任何语言你正在编写中,得到最后5个项目的数组中的
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.
这篇关于Shopify API:获取订单Shopify按日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!