如何通过Shopify API从Smart Collection中检索所有产品?

Kev*_*vin 6 shopify

通过Shopify API从Smart Collection中检索所有产品的最佳方法是什么?

谢谢!

Ste*_*arp 11

从Shopify API文档中的SmartCollection页面:

Smart Collections还使用集合将产品连接到该智能集合.

在" 收集"页面上:

列表仅收集特定集合

GET /admin/collects.json?collection_id=841564295

HTTP/1.1 200 OK

{
  "collects": [
    {
      "collection_id": 841564295,
      "created_at": "2014-05-23T14:16:47-04:00",
      "featured": false,
      "id": 1071559648,
      "product_id": 921728736,
      "sort_value": "0000000001",
      "updated_at": "2014-05-23T14:16:47-04:00",
      "position": 1
    },
    ...
  ]
}
Run Code Online (Sandbox Code Playgroud)

收集包含product_id指定集合中每个产品的s collection_id.