**版本：202601**

# 查询商品列表

**GET** `/openapi/2026-01/products`

分页获取商品列表。

## 请求

**Query参数**

- `ids` string[]

  商品 ID 列表。 示例：?ids=1001&ids=1002
- `title` string

  商品名称
- `collection_id` string

  专辑 UUID，例如：`9e79ca1f-9ff2-409b-976f-98be343d38a3`
- `created_at_min` string

  筛选创建时间不早于该时间点的商品，例如：`2018-10-01T16:15:47-04:00`
- `created_at_max` string

  筛选创建时间不晚于该时间点的商品，例如：`2018-10-01T16:15:47-04:00`
- `updated_at_min` string

  筛选最后更新时间不早于该时间点的商品，例如：`2018-10-01T16:15:47-04:00`
- `updated_at_max` string

  筛选最后更新时间不晚于该时间点的商品，例如：`2018-10-01T16:15:47-04:00`
- `published_at_min` string

  筛选上架时间不早于该时间点的商品，例如：`2018-10-01T16:15:47-04:00`
- `published_at_max` string

  筛选上架时间不晚于该时间点的商品，例如：`2018-10-01T16:15:47-04:00`
- `published_status` string

  按上架状态筛选，可选值：`published`（已上架）、`unpublished`（未上架）、`any`（全部）
- `spus` string[]

  商品 SPU 列表，多个值之间使用英文逗号分隔，例如：`spu1,spu2`
- `pre_cursor` string

  上一页游标，参考[基于游标的分页](https://www.shoplazza.dev/reference/API-usage#cursor-pagination)
- `cursor` string

  分页游标，参考[基于游标的分页](https://www.shoplazza.dev/reference/API-usage#cursor-pagination)
- `per_page` int32

  每页记录数，最大 250
- `fields` string[]

  指定响应中需要返回的字段列表。 示例：?fields=id&fields=title
- `sort_direction` string

  排序方向，可选值：`desc`（降序）、`asc`（升序）
- `exclude_ids` string[]

  需要排除的商品 ID 列表，例如：`product_id1,product_id2`
- `product_type` string

  按商品类型筛选，可选值：`all`（全部）、`default`（普通商品）、`gift_card`（礼品卡）；为空时返回所有商品
- `product_behaviour` string

  商品行为筛选，可选值：`hidden`（隐藏商品）；为空时返回所有商品
- `location_id` uint64

  按库存所在位置 ID 筛选
- `vendors` string[]

  按商品供应商筛选（精确匹配）。 示例：?vendors=Nike&vendors=Adidas
- `vendors_match` string[]

  按商品供应商进行模糊匹配筛选。 示例：?vendors\_match=Nik&vendors\_match=Adid
- `handles` string[]

  按商品 handle 列表筛选。 示例：?handles=t-shirt&handles=hoodie

## 响应

**200**

OK

**application/json**

**数据结构 | 示例**

**数据结构**

- `code` string

  错误码
- `message` string

  错误信息
- `data` object

  - `cursor` string

    下一页游标，参考[基于游标的分页](https://www.shoplazza.dev/reference/API-usage#cursor-pagination)
  - `pre_cursor` string

    上一页游标，参考[基于游标的分页](https://www.shoplazza.dev/reference/API-usage#cursor-pagination)
  - `has_more` boolean

    是否还有下一页（游标分页）。
  - `products` object[]

    商品列表

    *   Array \[

    - `id` string

      商品 ID
    - `title` string

      商品名称
    - `description` string

      商品描述
    - `published` boolean

      商品是否已上架
    - `requires_shipping` boolean

      商品是否需要物流
    - `taxable` boolean

      商品是否需要计税
    - `tags` string[]

      商品标签列表
    - `vendor` string

      供应商名称
    - `vendor_url` string

      供应商 URL
    - `note` string

      自定义备注，例如："This is a customizable product"
    - `seo_title` string

      SEO 标题
    - `seo_description` string

      SEO 描述
    - `seo_keywords` string[]

      SEO 关键词列表
    - `handle` string

      商品 handle（用于 URL 的友好别名）
    - `has_only_default_variant` boolean

      是否仅有默认款式（即无多款式）
    - `inventory_tracking` boolean

      是否启用库存追踪
    - `inventory_policy` string

      库存策略，可选值：`continue`（缺货时继续销售）、`deny`（缺货时停止销售）、`auto_unpublished`（缺货时自动下架）；当 `inventory_tracking` 为 `true` 时必填
    - `need_variant_image` boolean

      是否需要为款式设置图片；当 `has_only_default_variant` 为 `false` 时必填
    - `spu` string

      商品 SPU（标准产品单元）
    - `fake_sales` int64

      商品虚拟销量
    - `display_fake_sales` boolean

      是否在前台展示虚拟销量
    - `options` object[]

      商品款式属性列表（如颜色、尺寸等）

      *   Array \[

      - `id` string

        款式属性 ID
      - `name` string

        款式属性名称，例如："color"、"size"
      - `values` string[]

        款式属性的可选值列表，例如：\["red", "black"\]、\["small", "large"\]
      - `position` int64

        款式属性排序位置
      *   \]
    - `images` object[]

      商品图片列表

      *   Array \[

      - `id` string

        图片 ID
      - `src` string

        图片 URL
      - `width` int32

        图片宽度（单位：像素）
      - `height` int32

        图片高度（单位：像素）
      - `alt` string

        图片替代文本（alt）
      - `position` int64

        图片排序位置
      - `path` string

        图片存储路径
      *   \]
    - `variants` object[]

      商品子款式列表

      *   Array \[

      - `id` string

        子款式 ID
      - `product_id` string

        子款式所属商品的 ID
      - `image_id` string

        子款式关联的图片 ID
      - `created_at` string

        子款式创建时间
      - `updated_at` string

        子款式最后更新时间
      - `title` string

        子款式标题
      - `option1` string

        子款式在第 1 个商品款式属性上的取值
      - `option2` string

        子款式在第 2 个商品款式属性上的取值
      - `option3` string

        子款式在第 3 个商品款式属性上的取值
      - `image` object

        子款式图片

        - `src` string

          图片 URL
        - `width` int32

          图片宽度（单位：像素）
        - `height` int32

          图片高度（单位：像素）
        - `alt` string

          图片替代文本（alt）
        - `path` string

          图片存储路径
      - `position` int64

        子款式在商品中的排序位置
      - `compare_at_price` double

        划线价
      - `price` double

        子款式售价
      - `sku` string

        SKU
      - `barcode` string

        条形码
      - `note` string

        款式备注
      - `inventory_quantity` int64

        库存数量
      - `weight` double

        重量
      - `weight_unit` string

        重量单位，可选值：`kg`、`g`、`lb`、`oz`
      - `cost_price` double

        成本价
      - `wholesale_price` object[]

        批发价列表

        *   Array \[

        - `price` double (required)

          批发价
        - `min_quantity` int64 (required)

          起购量（达到该数量才适用此批发价）
        *   \]
      - `whole_prices` object[]

        批发价列表。已废弃，等价于 `wholesale_price`，两者返回相同内容。

        *   Array \[

        - `price` double (required)

          批发价
        - `min_quantity` int64 (required)

          起购量（达到该数量才适用此批发价）
        *   \]
      - `retail_price` double

        零售价
      - `is_discount` boolean

        子款式当前是否处于打折状态
      - `origin_price` double

        原价
      - `extend` object

        子款式扩展信息（包裹尺寸、原产地国别、HS 代码等）

        - `length` double

          包裹长度
        - `width` double

          包裹宽度
        - `height` double

          包裹高度
        - `dimension_unit` string

          尺寸单位，可选值：`cm`、`in`、`mm`
        - `origin_country_code` string

          原产地国别（国家代码，例如 `CN`、`US`）
        - `hs_code` string

          HS（协调制度）代码
      *   \]
    - `mixed_wholesale` boolean

      是否支持混批
    - `product_type` string

      商品类型
    - `brand` string

      品牌
    - `brief` string

      商品简介
    - `inventory_quantity` int64

      库存数量
    - `price_min` double

      各子款式售价中的最低价
    - `price_max` double

      各子款式售价中的最高价
    - `compare_at_price_min` double

      各子款式划线价中的最低价
    - `compare_at_price_max` double

      各子款式划线价中的最高价
    - `published_at` string

      商品上架时间
    - `created_at` string

      商品创建时间
    - `updated_at` string

      商品最后更新时间
    - `sales` int64

      商品实际销量
    - `independent_seo` boolean

      是否启用独立的 SEO 设置
    - `url` string

      商品访问 URL
    - `available` boolean

      商品是否可售
    - `retail_price_min` double

      各子款式零售价中的最低价
    - `retail_price_max` double

      各子款式零售价中的最高价
    - `origin_price_min` double

      各子款式原价中的最低价
    - `origin_price_max` double

      各子款式原价中的最高价
    - `primary_image` object

      商品主图

      - `src` string

        图片 URL
      - `width` int32

        图片宽度（单位：像素）
      - `height` int32

        图片高度（单位：像素）
      - `alt` string

        图片替代文本（alt）
      - `path` string

        图片存储路径
    - `tax_code` string

      商品税码
    - `category_id` string

      商品所属分类 ID
    - `category` object

      商品所属分类信息

      - `id` uint64

        分类 ID
      - `name` string

        分类名称
      - `google_id` int64

        Google 分类 ID
      - `level` int32

        分类层级
      - `path` string

        分类层级路径
    *   \]

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "cursor": "string",
    "pre_cursor": "string",
    "has_more": true,
    "products": [
      {
        "id": "string",
        "title": "string",
        "description": "string",
        "published": true,
        "requires_shipping": true,
        "taxable": true,
        "tags": [
          "string"
        ],
        "vendor": "string",
        "vendor_url": "string",
        "note": "string",
        "seo_title": "string",
        "seo_description": "string",
        "seo_keywords": [
          "string"
        ],
        "handle": "string",
        "has_only_default_variant": true,
        "inventory_tracking": true,
        "inventory_policy": "string",
        "need_variant_image": true,
        "spu": "string",
        "fake_sales": 0,
        "display_fake_sales": true,
        "options": [
          {
            "id": "string",
            "name": "string",
            "values": [
              "string"
            ],
            "position": 0
          }
        ],
        "images": [
          {
            "id": "string",
            "src": "string",
            "width": 0,
            "height": 0,
            "alt": "string",
            "position": 0,
            "path": "string"
          }
        ],
        "variants": [
          {
            "id": "string",
            "product_id": "string",
            "image_id": "string",
            "created_at": "string",
            "updated_at": "string",
            "title": "string",
            "option1": "string",
            "option2": "string",
            "option3": "string",
            "image": {
              "src": "string",
              "width": 0,
              "height": 0,
              "alt": "string",
              "path": "string"
            },
            "position": 0,
            "compare_at_price": 0,
            "price": 0,
            "sku": "string",
            "barcode": "string",
            "note": "string",
            "inventory_quantity": 0,
            "weight": 0,
            "weight_unit": "string",
            "cost_price": 0,
            "wholesale_price": [
              {
                "price": 0,
                "min_quantity": 0
              }
            ],
            "whole_prices": [
              {
                "price": 0,
                "min_quantity": 0
              }
            ],
            "retail_price": 0,
            "is_discount": true,
            "origin_price": 0,
            "extend": {
              "length": 0,
              "width": 0,
              "height": 0,
              "dimension_unit": "string",
              "origin_country_code": "string",
              "hs_code": "string"
            }
          }
        ],
        "mixed_wholesale": true,
        "product_type": "string",
        "brand": "string",
        "brief": "string",
        "inventory_quantity": 0,
        "price_min": 0,
        "price_max": 0,
        "compare_at_price_min": 0,
        "compare_at_price_max": 0,
        "published_at": "string",
        "created_at": "string",
        "updated_at": "string",
        "sales": 0,
        "independent_seo": true,
        "url": "string",
        "available": true,
        "retail_price_min": 0,
        "retail_price_max": 0,
        "origin_price_min": 0,
        "origin_price_max": 0,
        "primary_image": {
          "src": "string",
          "width": 0,
          "height": 0,
          "alt": "string",
          "path": "string"
        },
        "tax_code": "string",
        "category_id": "string",
        "category": {
          "id": 0,
          "name": "string",
          "google_id": 0,
          "level": 0,
          "path": "string"
        }
      }
    ]
  }
}
```
