获取商品列表
GET /openapi/2021-08/products
权限:read_products
Query参数:
参数名 | 说明 | 必填 | 类型 | 限制 | 示例 |
page | 页码 | 否 | [string] | 1 | |
page_size | 每页数量 | 否 | [string] | 25 | |
sort | 排序,不填写排序时间默认全部销量 | 否 | [string] | title,stock,created_at,updated_at,price,total_sales(字段前面加上-表示倒叙) | |
sort_range[start] | 排序开始时间 | 否 | [string] | 2023-10-01 | |
sort_range[end] | 排序结束时间 | 否 | [string] | 2023-11-01 | |
filter[id] | 商品ID | 否 | [integer] | 1, | |
filter[exclude_id] | 排除商品ID | 否 | [integer|string] | 1,2,3 | |
filter[include_id] | 指定商品ID | 否 | [integer|string] | 1,2,3 | |
filter[search] | 模糊匹配商品名称、SKU、变种名称、商品SKU | 否 | [string] | bling | |
filter[category_id] | 指定分类ID | 否 | [integer] | 1 | |
filter[tag_id] | 指定标签ID | 否 | [integer] | 1 | |
filter[status] | 指定状态 | 否 | [string] | publish:公开的 private:个人的 | publish |
filter[slug] | 指定商品 slug | 否 | [string] | a-b-c | |
with | 指定返回字段 | 否 | [string] | tags 标签 | |
filter[category_ids] | 支持多个分类id过滤 | 否 | [string] | 1,2,3 | |
filter[tag_ids] | 支持多个标签id过滤 | 否 | [string] | 1,2,3 | |
filter[precise_slug] | 精确匹配 slug | 否 | [string] |
Body参数
参数名 | 类型 | 必填 | 说明 |
fields | [string] | 是 | 获取需要的字段,用逗号隔开 |
示例响应内容
{
"data": [
{
"title": "商品测试12",
"slug": "shang-pin-ce-shi",
"spu": "",
"sku": "WTS84291-PT100S1",
"weight": "0.00",
"weight_unit": "kg",
"weight_local": "0.000",
"price": 110,
"regular_price": 110,
"max_discount": 0,
"min_price": 110,
"max_price": 110,
"manage_stock": "no",
"backorders": "no",
"stock": 0,
"available_map": true,
"available_store_show": true,
"bar_code": "",
"subtitle": "",
"supplier": "",
"total_sales": 0,
"gallery": "",
"seo_title": "",
"seo_description": "",
"source": null,
"store_id": 5837,
"snow_flake_id": "557856087278092288",
"wp_product_id": 168493,
"comment_status": "open",
"product_order": 0,
"published_at_gmt": "2024-03-12 09:20:07",
"type": 1,
"min_purchase_quantity": 1,
"is_overseas_depot": 0,
"ID": 168493,
"post_title": "商品测试12",
"post_date": "2023-10-25 17:29:03",
"post_date_gmt": "2023-10-26 05:29:03",
"post_content": "",
"post_status": "publish",
"review_status": "open",
"post_name": "shang-pin-ce-shi",
"post_modified": "2024-03-11 21:20:07",
"post_modified_gmt": "2024-03-12 09:20:07",
"image": "",
"review_count": 0,
"variant_attrs": [],
"shop_id": 168493,
"published_at": "2024-03-11 21:20:07",
"public_url": "https://shop.com/products/shang-pin-ce-shi",
"path": "/products/shang-pin-ce-shi",
"short_content": "",
"average_rating": 0,
"rating_count": [
0,
0,
0,
0,
0
],
"comment_count": 0,
"specified_sales": 0,
"categories": [
{
"term_taxonomy_id": 842,
"taxonomy": "product_cat",
"description": "<p>This collection is used by the OrderlyEmails app, to make product recommendations in your notification emails, which automatically update over time.</p><ul>\n<li>This service is currenty provided for FREE, with any theme purchase.</li>\n<li>Recommended products shown in your email are <b>automatically</b> updated every 4 hours, to match this collection.</li>\n<li>By default, your Best-Selling products (that are in stock & not already purchased) will be recommended.</li>\n<li>You can modify the rules below to change which products are recommended. Products at the top of the list are more likely to be shown.</li>\n<li>To enable/disable recommendations in your emails, login to the OrderlyEmails app (Shopify Admin -> Apps) and add the \"Recommended products\" section to an email in the editor.</li>\n</ul><p><i>Note: This collection is \"hidden\", it is not be visible on your website.</i></p>",
"parent": 0,
"count": 0,
"id": 842,
"thumbnail": null,
"thumbnail_url": "",
"order": null,
"seo_title": "OrderlyEmails - Recommended Products",
"seo_description": "<p>This collection is used by the OrderlyEmails app, to make product recommendations in your notification emails, which automatically update over time.</p><ul>\n<li>This service is currenty provided for FREE, with any theme purchase.</li>\n<li>Recommended products shown in your email are <b>automatically</b> updated every 4 hours, to match this collection.</li>\n<li>By default, your Best-Selling products (that are in stock & not already purchased) will be recommended.</li>\n<li>You can modify the rules below to change which products are recommended. Products at the top of the list are more likely to be shown.</li>\n<li>To enable/disable recommendations in your emails, login to the OrderlyEmails app (Shopify Admin -> Apps) and add the \"Recommended products\" section to an email in the editor.</li>\n</ul><p><i>Note: This collection is \"hidden\", it is not be visible on your website.</i></p>",
"name": "OrderlyEmails - Recommended Products",
"slug": "orderlyemails-recommended-products",
"public_url": "https://shop.com/collections/orderlyemails-recommended-products",
"base_url": "https://shop.com/collections/",
"source": null,
"path": "/collections/orderlyemails-recommended-products",
"sort_type": "best_selling_descending",
"category_type": "auto_category",
"additional": "fetch_all",
"conditions": [
{
"type": "stock",
"options": {
"operator": "more_than",
"value": "0"
}
}
],
"sticky": null,
"sort_range": "all",
"meta_fields": {
"space": {
"key_cover": {
"type": "image",
"name": "COVER",
"value": null
}
}
},
"pivot": {
"object_id": 168493,
"term_taxonomy_id": 842
},
"term": {
"term_id": 842,
"name": "OrderlyEmails - Recommended Products",
"slug": "orderlyemails-recommended-products",
"term_group": 0
},
"feature_image": null
}
],
"feature_image": null
}
],
"links": {
"first": "https://shop.com.com/openapi/2021-08/products?page=1",
"last": "https://shop.com.com/openapi/2021-08/products?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://shop.com/openapi/2021-08/products",
"per_page": 25,
"to": 1,
"total": 1
}
}
Last updated