【问题标题】:Shopify API: is there a way to retrieve a list of orders for specific Order numbers?Shopify API:有没有办法检索特定订单号的订单列表?
【发布时间】:2012-08-01 18:08:32
【问题描述】:

我正在使用 ShopifyAPI gem 来查找商店的订单 - 我知道我可以使用它来查找商店的所有订单:

ShopifyAPI::Order.find(:all)

这是查找 1 月 1 日之后创建的所有订单:

ShopifyAPI::Order.find(:all, :params => {:created_at_min => "2012-01-01"}

但是,如果我有一个订单 ID 列表,例如 [1009, 1006] - 有没有办法检索具有这些 ID 的商店的订单,还是我需要单独查找它们?

【问题讨论】:

    标签: ruby shopify


    【解决方案1】:

    您必须单独查找它们。

    orders = [1009, 1006].collect {|order_id| Shopify::Order.find(order_id)}
    

    【讨论】:

      【解决方案2】:

      您可以通过以下方式一次性获得它们:

      ShopifyAPI::Order.find(:all, :params => { :ids => "1009,1006" })
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-04-02
        • 1970-01-01
        • 2017-08-10
        • 2019-07-23
        • 1970-01-01
        相关资源
        最近更新 更多