---
title: "创建智能分类"
description: "在店铺中创建一个新智能分类。"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/product/collection/create-smart-collection'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/product/collection/create-smart-collection.md'
---
# 创建智能分类

在店铺中创建一个新智能分类。

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_products`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /products/smart_collections.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `write_products`

## Request

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

### Request Body

* `smart_collection`

  object

  智能分类信息。

  * `banner`

    object

    分类的封面图。

    * `alt`

      string

      图片的替代文本描述，通常是具有图片特征或内容的单词或短语。<br/>
      最大长度限制：512

    * `id`

      string

      已有图片的唯一标识 ID。若通过 `src` 新增图片，无需传入此字段。<br/>
      最大长度限制：64

    * `src`

      string

      图片的链接，以 URL 形式展示。<br/>
      最大长度限制：255

  * `body_html`

    string

    分类的描述。<br/>
    最大容量限制：64 KB

  * `disjunctive`

    boolean

    用来设置智能分类中商品筛选条件之间的逻辑关系。
    
    - `true`：商品符合任意一个条件，即可被纳入该智能分类中。
    - `false`：商品必须满足所有条件，才可被纳入该智能分类中。
    
    默认值: `true`

  * `handle`

    string

    分类的语义化的唯一标识，默认基于 `title` 生成。<br/>
    最大长度限制： 255

  * `image`

    object

    分类的图片。

    * `alt`

      string

      分类图的替代文本描述，通常是具有图片特征或内容的单词或短语。<br/>
      最大长度限制：512

    * `id`

      string

      已有图片的唯一标识 ID。若通过 `src` 新增图片，无需传入此字段。<br/>
      最大长度限制：64

    * `src`

      string

      分类图的链接，以 URL 形式展示。<br/>
      最大长度限制：255

  * `path`

    string

    分类的相对路径。<br/>
    最大长度限制：512

  * `published_scope`

    string

    分类的销售渠道发布范围。有效值固定为 `web`，代表在线商城。

  * `rules`

    array<object>

    表示智能分类的筛选规则，是一个规则的数组，每个规则定义商品筛选的条件。

    * `column`

      string

      指定筛选的字段。
      
      - `title`：产品标题 
      - `sale_price`：商品款式售价
      - `compared_at_price`：商品款式原价
      - `tag`：产品标签
      - `inventory`：商品库存
      - `vendor`：品牌或厂商
      - `variant_weight`：商品款式重量
      - `variant_title`：商品款式标题
      - `created_at`：商品创建时间 
      - `sales_last_3_days`：商品近 3 天销量
      - `sales_last_7_days`：商品近 7 天销量
      - `sales_last_15_days`：商品近 15 天销量
      - `sales_last_30_days`：商品近 30 天销量
      - `sales_last_60_days`：商品近 60 天销量
      - `sales`：商品近 90 天销量
      - `view`：商品浏览量
      - `add_to_cart`：商品加购量
      - `type`：自定义商品类型
      - `product_taxonomy_node_id`：标准商品类型
      - `product_taxonomy_node_id_with_descendants`：标准商品类型（包含子类）
      - `product_metafield_definition`：商品元字段的值

    * `condition`

      string

      指定筛选的值，例如 `T shirt` 表示标签匹配的值，`10.00` 表示价格的具体数值。
      
      当 `relation` 为 `is_not_set` 或 `is_set` 时，字段无效。

    * `condition_object_id`

      long

      元字段对象的 ID。

    * `relation`

      string

      字段和取值之间的关系。
      
      - `equals`：表示等于
      - `not_equals`：表示不等于
      - `starts_with`：表示前缀匹配
      - `ends_with`：表示后缀匹配
      - `contains`：表示包含关系
      - `not_contains`：表示不包含关系
      - `greater_than`：表示大于
      - `less_than`：表示小于
      - `is_not_set`：表示全为空
      - `is_set`：表示不为空

  * `sort_order`

    string

    表明分类页商品列表默认排序值的排序方式。
    
    - `alpha-asc`：按产品名称从 A 到 Z 排序
    - `alpha-desc`：按产品名称从 Z 到 A 排序
    - `updated-desc`：按更新时间从新到旧排序
    - `updated-asc`：按更新时间从旧到新排序
    - `manual`：按自定义排序
    - `created-desc`：按创建时间从新到旧排序
    - `created-asc`：按创建时间从旧到新排序
    - `price-asc`：按商品款式最低售价升序排序
    - `price-desc`：按商品款式最低售价降序排序
    - `best-selling-last3days`：按近 3 天销量降序排序
    - `best-selling-last7days`：按近 7 天销量降序排序
    - `best-selling-last15days`：按近 15 天销量降序排序
    - `best-selling-last30days`：按近 30 天销量降序排序
    - `best-selling-last60days`：按近 60 天销量降序排序
    - `best-selling`：按近 90 天销量降序排序
    - `additional-purchase-rate-last3days`：按近 3 天加购率降序排序
    - `additional-purchase-rate-last7days`：按近 7 天加购率降序排序
    - `additional-purchase-rate-last15days`：按近 15 天加购率降序排序
    - `additional-purchase-rate-last30days`：按近 30 天加购率降序排序
    - `additional-purchase-rate-last60days`：按近 60 天加购率降序排序
    - `additional-purchase-rate-last90days`：按近 90 天加购率降序排序
    - `conversion-rate-last3days`：按近 3 天转化率降序排序
    - `conversion-rate-last7days`：按近 7 天转化率降序排序
    - `conversion-rate-last15days`：按近 15 天转化率降序排序
    - `conversion-rate-desc`：按近 30 天转化率降序排序
    - `conversion-rate-last60days`：按近 60 天转化率降序排序
    - `conversion-rate-last90days`：按近 90 天转化率降序排序
    - `additional-purchases-num-last3days`：按近 3 天加购量降序排序
    - `additional-purchases-num-last7days`：按近 7 天加购量降序排序
    - `additional-purchases-num-last15days`：按近 15 天加购量降序排序
    - `additional-purchases-num-last30days`：按近 30 天加购量降序排序
    - `additional-purchases-num-last60days`：按近 60 天加购量降序排序
    - `add-to-cart-desc`：按近 90 天加购量降序排序
    - `views-pv-last3days`：按近 3 天浏览量降序排序
    - `views-pv-last7days`：按近 7 天浏览量降序排序
    - `views-pv-last15days`：按近 15 天浏览量降序排序
    - `views-pv-last30days`：按近 30 天浏览量降序排序
    - `views-pv-last60days`：按近 60 天浏览量降序排序
    - `view-desc`：按近 90 天浏览量降序排序

  * `template_path`

    string

    分类的主题模板。

  * `title`

    string

    分类的标题。<br/>
    最大长度限制：255

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `smart_collection`

  object

  智能分类信息。

  * `banner`

    object

    分类的封面图。

    * `alt`

      string

      图片的替代文本描述，通常是具有图片特征或内容的单词或短语。

    * `id`

      string

      图片的唯一标识 ID。

    * `src`

      string

      图片的链接，以 URL 形式展示。

  * `body_html`

    string

    分类的描述。

  * `created_at`

    string

    分类的创建时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

  * `disjunctive`

    boolean

    用来设置智能分类中商品筛选条件之间的逻辑关系。
    
    - `true`：商品符合任意一个条件，即可被纳入该智能分类中。
    - `false`：商品必须满足所有条件，才可被纳入该智能分类中。

  * `handle`

    string

    分类的语义化的唯一标识，默认基于 `title` 生成。

  * `id`

    string

    分类的唯一标识 ID。

  * `image`

    object

    分类的图片。

    * `alt`

      string

      图片的替代文本描述，通常是具有图片特征或内容的单词或短语。

    * `id`

      string

      图片的唯一标识 ID。

    * `src`

      string

      图片的链接，以 URL 形式展示。

  * `published_at`

    string

    分类发布到在线商店的时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。

  * `published_scope`

    string

    分类的销售渠道发布范围。有效值固定为`web`，代表在线商城。

  * `rules`

    array<object>

    表示智能分类的筛选规则，是一个规则的数组，每个规则定义商品筛选的条件。

    * `column`

      string

      指定筛选的字段。
      
      - `title`：产品标题 
      - `sale_price`：商品款式售价
      - `compared_at_price`：商品款式原价
      - `tag`：产品标签
      - `inventory`：商品库存
      - `vendor`：品牌或厂商
      - `variant_weight`：商品款式重量
      - `variant_title`：商品款式标题
      - `created_at`：商品创建时间 
      - `sales_last_3_days`：商品近 3 天销量
      - `sales_last_7_days`：商品近 7 天销量
      - `sales_last_15_days`：商品近 15 天销量
      - `sales_last_30_days`：商品近 30 天销量
      - `sales_last_60_days`：商品近 60 天销量
      - `sales`：商品近 90 天销量
      - `view`：商品浏览量
      - `add_to_cart`：商品加购量
      - `type`：自定义商品类型
      - `product_taxonomy_node_id`：标准商品类型
      - `product_taxonomy_node_id_with_descendants`：标准商品类型（包含子类）
      - `product_metafield_definition`：商品元字段的值

    * `condition`

      string

      指定筛选的值，例如 `T shirt` 表示标签匹配的值，`10.00` 表示价格的具体数值。
      
      当 `relation` 为 `is_not_set` 或 `is_set` 时，字段无效。

    * `condition_object_id`

      long

      元字段对象的 ID。

    * `relation`

      string

      字段和取值之间的关系。
      
      - `equals`：表示等于
      - `not_equals`：表示不等于
      - `starts_with`：表示前缀匹配
      - `ends_with`：表示后缀匹配
      - `contains`：表示包含关系
      - `not_contains`：表示不包含关系
      - `greater_than`：表示大于
      - `less_than`：表示小于
      - `is_not_set`：表示全为空
      - `is_set`：表示不为空

  * `sort_order`

    string

    表明分类页商品列表默认排序值的排序方式。
    
    - `alpha-asc`：按产品名称从 A 到 Z 排序
    - `alpha-desc`：按产品名称从 Z 到 A 排序
    - `updated-desc`：按更新时间从新到旧排序
    - `updated-asc`：按更新时间从旧到新排序
    - `manual`：按自定义排序
    - `created-desc`：按创建时间从新到旧排序
    - `created-asc`：按创建时间从旧到新排序
    - `price-asc`：按商品款式最低售价升序排序
    - `price-desc`：按商品款式最低售价降序排序
    - `best-selling-last3days`：按近 3 天销量降序排序
    - `best-selling-last7days`：按近 7 天销量降序排序
    - `best-selling-last15days`：按近 15 天销量降序排序
    - `best-selling-last30days`：按近 30 天销量降序排序
    - `best-selling-last60days`：按近 60 天销量降序排序
    - `best-selling`：按近 90 天销量降序排序
    - `additional-purchase-rate-last3days`：按近 3 天加购率降序排序
    - `additional-purchase-rate-last7days`：按近 7 天加购率降序排序
    - `additional-purchase-rate-last15days`：按近 15 天加购率降序排序
    - `additional-purchase-rate-last30days`：按近 30 天加购率降序排序
    - `additional-purchase-rate-last60days`：按近 60 天加购率降序排序
    - `additional-purchase-rate-last90days`：按近 90 天加购率降序排序
    - `conversion-rate-last3days`：按近 3 天转化率降序排序
    - `conversion-rate-last7days`：按近 7 天转化率降序排序
    - `conversion-rate-last15days`：按近 15 天转化率降序排序
    - `conversion-rate-desc`：按近 30 天转化率降序排序
    - `conversion-rate-last60days`：按近 60 天转化率降序排序
    - `conversion-rate-last90days`：按近 90 天转化率降序排序
    - `additional-purchases-num-last3days`：按近 3 天加购量降序排序
    - `additional-purchases-num-last7days`：按近 7 天加购量降序排序
    - `additional-purchases-num-last15days`：按近 15 天加购量降序排序
    - `additional-purchases-num-last30days`：按近 30 天加购量降序排序
    - `additional-purchases-num-last60days`：按近 60 天加购量降序排序
    - `add-to-cart-desc`：按近 90 天加购量降序排序
    - `views-pv-last3days`：按近 3 天浏览量降序排序
    - `views-pv-last7days`：按近 7 天浏览量降序排序
    - `views-pv-last15days`：按近 15 天浏览量降序排序
    - `views-pv-last30days`：按近 30 天浏览量降序排序
    - `views-pv-last60days`：按近 60 天浏览量降序排序
    - `view-desc`：按近 90 天浏览量降序排序

  * `template_path`

    string

    分类的主题模板。

  * `title`

    string

    分类的标题。

  * `updated_at`

    string

    分类最近一次更新的时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "tags": [
    "创建智能分类"
  ],
  "description": "在店铺中创建一个新智能分类。",
  "externalDocs": {
    "description": "接口使用的权限点: `write_products` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": "| Error Code | HTTP Status Code | Error Description |\n|------------|------------------|-------------------|\n| DATA_NOT_EXIST | 404 | The requested data does not exist. |\n| QUANTITY_EXCEEDS_LIMIT | 400 | The quantity exceeds the limit. |\n| INTERNAL_ERROR | 500 | An internal error occured. |\n| INVALID_PARAMETER | 400 | The provided parameter is invalid. |\n| SUCCESS | 200 | request success |\n"
  },
  "operationId": "0967Fdsv",
  "parameters": [
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "name": "body",
          "description": "body",
          "type": "object",
          "properties": {
            "smart_collection": {
              "name": "smart_collection",
              "description": "智能分类信息。",
              "type": "object",
              "properties": {
                "banner": {
                  "name": "banner",
                  "description": "分类的封面图。",
                  "type": "object",
                  "properties": {
                    "alt": {
                      "name": "alt",
                      "description": "图片的替代文本描述，通常是具有图片特征或内容的单词或短语。<br/>\n最大长度限制：512",
                      "type": "string",
                      "example": "This is an image alt"
                    },
                    "id": {
                      "name": "id",
                      "description": "已有图片的唯一标识 ID。若通过 `src` 新增图片，无需传入此字段。<br/>\n最大长度限制：64",
                      "type": "string",
                      "example": "5759070976424132652"
                    },
                    "src": {
                      "name": "src",
                      "description": "图片的链接，以 URL 形式展示。<br/>\n最大长度限制：255",
                      "type": "string",
                      "example": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                    }
                  },
                  "example": {
                    "alt": "This is an image alt",
                    "id": "5759070976424132652",
                    "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                  }
                },
                "body_html": {
                  "name": "body_html",
                  "description": "分类的描述。<br/>\n最大容量限制：64 KB",
                  "type": "string",
                  "example": "This is a description"
                },
                "disjunctive": {
                  "name": "disjunctive",
                  "description": "用来设置智能分类中商品筛选条件之间的逻辑关系。\n\n- `true`：商品符合任意一个条件，即可被纳入该智能分类中。\n- `false`：商品必须满足所有条件，才可被纳入该智能分类中。\n\n默认值: `true`",
                  "type": "boolean"
                },
                "handle": {
                  "name": "handle",
                  "description": "分类的语义化的唯一标识，默认基于 `title` 生成。<br/>\n最大长度限制： 255",
                  "type": "string",
                  "example": "collection-handle"
                },
                "image": {
                  "name": "image",
                  "description": "分类的图片。",
                  "type": "object",
                  "properties": {
                    "alt": {
                      "name": "alt",
                      "description": "分类图的替代文本描述，通常是具有图片特征或内容的单词或短语。<br/>\n最大长度限制：512",
                      "type": "string",
                      "example": "This is an image alt"
                    },
                    "id": {
                      "name": "id",
                      "description": "已有图片的唯一标识 ID。若通过 `src` 新增图片，无需传入此字段。<br/>\n最大长度限制：64",
                      "type": "string",
                      "example": "5759070976424132652"
                    },
                    "src": {
                      "name": "src",
                      "description": "分类图的链接，以 URL 形式展示。<br/>\n最大长度限制：255",
                      "type": "string",
                      "example": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                    }
                  },
                  "example": {
                    "alt": "This is an image alt",
                    "id": "5759070976424132652",
                    "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                  }
                },
                "path": {
                  "name": "path",
                  "description": "分类的相对路径。<br/>\n最大长度限制：512",
                  "type": "string",
                  "example": "/collections/spring"
                },
                "published_scope": {
                  "name": "published_scope",
                  "description": "分类的销售渠道发布范围。有效值固定为 `web`，代表在线商城。",
                  "type": "string"
                },
                "rules": {
                  "name": "rules",
                  "description": "表示智能分类的筛选规则，是一个规则的数组，每个规则定义商品筛选的条件。",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "column": {
                        "name": "column",
                        "description": "指定筛选的字段。\n\n- `title`：产品标题 \n- `sale_price`：商品款式售价\n- `compared_at_price`：商品款式原价\n- `tag`：产品标签\n- `inventory`：商品库存\n- `vendor`：品牌或厂商\n- `variant_weight`：商品款式重量\n- `variant_title`：商品款式标题\n- `created_at`：商品创建时间 \n- `sales_last_3_days`：商品近 3 天销量\n- `sales_last_7_days`：商品近 7 天销量\n- `sales_last_15_days`：商品近 15 天销量\n- `sales_last_30_days`：商品近 30 天销量\n- `sales_last_60_days`：商品近 60 天销量\n- `sales`：商品近 90 天销量\n- `view`：商品浏览量\n- `add_to_cart`：商品加购量\n- `type`：自定义商品类型\n- `product_taxonomy_node_id`：标准商品类型\n- `product_taxonomy_node_id_with_descendants`：标准商品类型（包含子类）\n- `product_metafield_definition`：商品元字段的值",
                        "type": "string",
                        "example": "title"
                      },
                      "condition": {
                        "name": "condition",
                        "description": "指定筛选的值，例如 `T shirt` 表示标签匹配的值，`10.00` 表示价格的具体数值。\n\n当 `relation` 为 `is_not_set` 或 `is_set` 时，字段无效。",
                        "type": "string",
                        "example": "true"
                      },
                      "condition_object_id": {
                        "name": "condition_object_id",
                        "description": "元字段对象的 ID。",
                        "type": "long",
                        "example": 483749284
                      },
                      "relation": {
                        "name": "relation",
                        "description": "字段和取值之间的关系。\n\n- `equals`：表示等于\n- `not_equals`：表示不等于\n- `starts_with`：表示前缀匹配\n- `ends_with`：表示后缀匹配\n- `contains`：表示包含关系\n- `not_contains`：表示不包含关系\n- `greater_than`：表示大于\n- `less_than`：表示小于\n- `is_not_set`：表示全为空\n- `is_set`：表示不为空",
                        "type": "string",
                        "example": "equals"
                      }
                    },
                    "required": [
                      "column",
                      "relation"
                    ],
                    "example": {
                      "column": "title",
                      "condition": "true",
                      "condition_object_id": 483749284,
                      "relation": "equals"
                    }
                  },
                  "example": [
                    {}
                  ]
                },
                "sort_order": {
                  "name": "sort_order",
                  "description": "表明分类页商品列表默认排序值的排序方式。\n\n- `alpha-asc`：按产品名称从 A 到 Z 排序\n- `alpha-desc`：按产品名称从 Z 到 A 排序\n- `updated-desc`：按更新时间从新到旧排序\n- `updated-asc`：按更新时间从旧到新排序\n- `manual`：按自定义排序\n- `created-desc`：按创建时间从新到旧排序\n- `created-asc`：按创建时间从旧到新排序\n- `price-asc`：按商品款式最低售价升序排序\n- `price-desc`：按商品款式最低售价降序排序\n- `best-selling-last3days`：按近 3 天销量降序排序\n- `best-selling-last7days`：按近 7 天销量降序排序\n- `best-selling-last15days`：按近 15 天销量降序排序\n- `best-selling-last30days`：按近 30 天销量降序排序\n- `best-selling-last60days`：按近 60 天销量降序排序\n- `best-selling`：按近 90 天销量降序排序\n- `additional-purchase-rate-last3days`：按近 3 天加购率降序排序\n- `additional-purchase-rate-last7days`：按近 7 天加购率降序排序\n- `additional-purchase-rate-last15days`：按近 15 天加购率降序排序\n- `additional-purchase-rate-last30days`：按近 30 天加购率降序排序\n- `additional-purchase-rate-last60days`：按近 60 天加购率降序排序\n- `additional-purchase-rate-last90days`：按近 90 天加购率降序排序\n- `conversion-rate-last3days`：按近 3 天转化率降序排序\n- `conversion-rate-last7days`：按近 7 天转化率降序排序\n- `conversion-rate-last15days`：按近 15 天转化率降序排序\n- `conversion-rate-desc`：按近 30 天转化率降序排序\n- `conversion-rate-last60days`：按近 60 天转化率降序排序\n- `conversion-rate-last90days`：按近 90 天转化率降序排序\n- `additional-purchases-num-last3days`：按近 3 天加购量降序排序\n- `additional-purchases-num-last7days`：按近 7 天加购量降序排序\n- `additional-purchases-num-last15days`：按近 15 天加购量降序排序\n- `additional-purchases-num-last30days`：按近 30 天加购量降序排序\n- `additional-purchases-num-last60days`：按近 60 天加购量降序排序\n- `add-to-cart-desc`：按近 90 天加购量降序排序\n- `views-pv-last3days`：按近 3 天浏览量降序排序\n- `views-pv-last7days`：按近 7 天浏览量降序排序\n- `views-pv-last15days`：按近 15 天浏览量降序排序\n- `views-pv-last30days`：按近 30 天浏览量降序排序\n- `views-pv-last60days`：按近 60 天浏览量降序排序\n- `view-desc`：按近 90 天浏览量降序排序",
                  "type": "string"
                },
                "template_path": {
                  "name": "template_path",
                  "description": "分类的主题模板。",
                  "type": "string",
                  "example": "templates/collection.collection_template_name.json"
                },
                "title": {
                  "name": "title",
                  "description": "分类的标题。<br/>\n最大长度限制：255",
                  "type": "string",
                  "example": "This is a collection title"
                }
              },
              "required": [
                "rules",
                "title"
              ],
              "example": {
                "banner": {
                  "alt": "This is an image alt",
                  "id": "5759070976424132652",
                  "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                },
                "body_html": "This is a description",
                "disjunctive": null,
                "handle": "collection-handle",
                "image": {
                  "alt": "This is an image alt",
                  "id": "5759070976424132652",
                  "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                },
                "path": "/collections/spring",
                "published_scope": null,
                "rules": [
                  {}
                ],
                "sort_order": null,
                "template_path": "templates/collection.collection_template_name.json",
                "title": "This is a collection title"
              }
            }
          },
          "required": [
            "smart_collection"
          ],
          "example": {
            "smart_collection": {
              "banner": {
                "alt": "This is an image alt",
                "id": "5759070976424132652",
                "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
              },
              "body_html": "This is a description",
              "disjunctive": null,
              "handle": "collection-handle",
              "image": {
                "alt": "This is an image alt",
                "id": "5759070976424132652",
                "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
              },
              "path": "/collections/spring",
              "published_scope": null,
              "rules": [
                {}
              ],
              "sort_order": null,
              "template_path": "templates/collection.collection_template_name.json",
              "title": "This is a collection title"
            }
          }
        },
        "examples": {
          "创建智能分类": {
            "description": "创建智能分类。",
            "value": {
              "smart_collection": {
                "banner": {
                  "alt": "This is an image alt",
                  "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                },
                "body_html": "This is a description",
                "disjunctive": true,
                "handle": "spring-clothing",
                "image": {
                  "alt": "This is an image alt",
                  "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                },
                "path": "/collections/spring",
                "published_scope": "web",
                "rules": [
                  {
                    "column": "tag",
                    "condition": "tag1",
                    "relation": "equals"
                  }
                ],
                "sort_order": "updated-asc",
                "title": "spring clothing"
              }
            }
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "smart_collection": {
                "name": "smart_collection",
                "description": "智能分类信息。",
                "type": "object",
                "properties": {
                  "banner": {
                    "name": "banner",
                    "description": "分类的封面图。",
                    "type": "object",
                    "properties": {
                      "alt": {
                        "name": "alt",
                        "description": "图片的替代文本描述，通常是具有图片特征或内容的单词或短语。",
                        "type": "string",
                        "example": "This is an image alt"
                      },
                      "id": {
                        "name": "id",
                        "description": "图片的唯一标识 ID。",
                        "type": "string",
                        "example": "5785060242207917075"
                      },
                      "src": {
                        "name": "src",
                        "description": "图片的链接，以 URL 形式展示。",
                        "type": "string",
                        "example": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                      }
                    },
                    "example": {
                      "alt": "This is an image alt",
                      "id": "5785060242207917075",
                      "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                    }
                  },
                  "body_html": {
                    "name": "body_html",
                    "description": "分类的描述。",
                    "type": "string",
                    "example": "This is a description"
                  },
                  "created_at": {
                    "name": "created_at",
                    "description": "分类的创建时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
                    "type": "string",
                    "example": "2021-09-03T14:11:54+00:00"
                  },
                  "disjunctive": {
                    "name": "disjunctive",
                    "description": "用来设置智能分类中商品筛选条件之间的逻辑关系。\n\n- `true`：商品符合任意一个条件，即可被纳入该智能分类中。\n- `false`：商品必须满足所有条件，才可被纳入该智能分类中。",
                    "type": "boolean"
                  },
                  "handle": {
                    "name": "handle",
                    "description": "分类的语义化的唯一标识，默认基于 `title` 生成。",
                    "type": "string",
                    "example": "collection-handle"
                  },
                  "id": {
                    "name": "id",
                    "description": "分类的唯一标识 ID。",
                    "type": "string",
                    "example": "12257170618007271602093384"
                  },
                  "image": {
                    "name": "image",
                    "description": "分类的图片。",
                    "type": "object",
                    "properties": {
                      "alt": {
                        "name": "alt",
                        "description": "图片的替代文本描述，通常是具有图片特征或内容的单词或短语。",
                        "type": "string",
                        "example": "This is an image alt"
                      },
                      "id": {
                        "name": "id",
                        "description": "图片的唯一标识 ID。",
                        "type": "string",
                        "example": "5785060242207917075"
                      },
                      "src": {
                        "name": "src",
                        "description": "图片的链接，以 URL 形式展示。",
                        "type": "string",
                        "example": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                      }
                    },
                    "example": {
                      "alt": "This is an image alt",
                      "id": "5785060242207917075",
                      "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                    }
                  },
                  "published_at": {
                    "name": "published_at",
                    "description": "分类发布到在线商店的时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
                    "type": "string",
                    "example": "2021-09-03T14:11:54+00:00"
                  },
                  "published_scope": {
                    "name": "published_scope",
                    "description": "分类的销售渠道发布范围。有效值固定为`web`，代表在线商城。",
                    "type": "string"
                  },
                  "rules": {
                    "name": "rules",
                    "description": "表示智能分类的筛选规则，是一个规则的数组，每个规则定义商品筛选的条件。",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "column": {
                          "name": "column",
                          "description": "指定筛选的字段。\n\n- `title`：产品标题 \n- `sale_price`：商品款式售价\n- `compared_at_price`：商品款式原价\n- `tag`：产品标签\n- `inventory`：商品库存\n- `vendor`：品牌或厂商\n- `variant_weight`：商品款式重量\n- `variant_title`：商品款式标题\n- `created_at`：商品创建时间 \n- `sales_last_3_days`：商品近 3 天销量\n- `sales_last_7_days`：商品近 7 天销量\n- `sales_last_15_days`：商品近 15 天销量\n- `sales_last_30_days`：商品近 30 天销量\n- `sales_last_60_days`：商品近 60 天销量\n- `sales`：商品近 90 天销量\n- `view`：商品浏览量\n- `add_to_cart`：商品加购量\n- `type`：自定义商品类型\n- `product_taxonomy_node_id`：标准商品类型\n- `product_taxonomy_node_id_with_descendants`：标准商品类型（包含子类）\n- `product_metafield_definition`：商品元字段的值",
                          "type": "string"
                        },
                        "condition": {
                          "name": "condition",
                          "description": "指定筛选的值，例如 `T shirt` 表示标签匹配的值，`10.00` 表示价格的具体数值。\n\n当 `relation` 为 `is_not_set` 或 `is_set` 时，字段无效。",
                          "type": "string",
                          "example": "true"
                        },
                        "condition_object_id": {
                          "name": "condition_object_id",
                          "description": "元字段对象的 ID。",
                          "type": "long",
                          "example": 483749284
                        },
                        "relation": {
                          "name": "relation",
                          "description": "字段和取值之间的关系。\n\n- `equals`：表示等于\n- `not_equals`：表示不等于\n- `starts_with`：表示前缀匹配\n- `ends_with`：表示后缀匹配\n- `contains`：表示包含关系\n- `not_contains`：表示不包含关系\n- `greater_than`：表示大于\n- `less_than`：表示小于\n- `is_not_set`：表示全为空\n- `is_set`：表示不为空",
                          "type": "string"
                        }
                      },
                      "example": {
                        "column": null,
                        "condition": "true",
                        "condition_object_id": 483749284,
                        "relation": null
                      }
                    }
                  },
                  "sort_order": {
                    "name": "sort_order",
                    "description": "表明分类页商品列表默认排序值的排序方式。\n\n- `alpha-asc`：按产品名称从 A 到 Z 排序\n- `alpha-desc`：按产品名称从 Z 到 A 排序\n- `updated-desc`：按更新时间从新到旧排序\n- `updated-asc`：按更新时间从旧到新排序\n- `manual`：按自定义排序\n- `created-desc`：按创建时间从新到旧排序\n- `created-asc`：按创建时间从旧到新排序\n- `price-asc`：按商品款式最低售价升序排序\n- `price-desc`：按商品款式最低售价降序排序\n- `best-selling-last3days`：按近 3 天销量降序排序\n- `best-selling-last7days`：按近 7 天销量降序排序\n- `best-selling-last15days`：按近 15 天销量降序排序\n- `best-selling-last30days`：按近 30 天销量降序排序\n- `best-selling-last60days`：按近 60 天销量降序排序\n- `best-selling`：按近 90 天销量降序排序\n- `additional-purchase-rate-last3days`：按近 3 天加购率降序排序\n- `additional-purchase-rate-last7days`：按近 7 天加购率降序排序\n- `additional-purchase-rate-last15days`：按近 15 天加购率降序排序\n- `additional-purchase-rate-last30days`：按近 30 天加购率降序排序\n- `additional-purchase-rate-last60days`：按近 60 天加购率降序排序\n- `additional-purchase-rate-last90days`：按近 90 天加购率降序排序\n- `conversion-rate-last3days`：按近 3 天转化率降序排序\n- `conversion-rate-last7days`：按近 7 天转化率降序排序\n- `conversion-rate-last15days`：按近 15 天转化率降序排序\n- `conversion-rate-desc`：按近 30 天转化率降序排序\n- `conversion-rate-last60days`：按近 60 天转化率降序排序\n- `conversion-rate-last90days`：按近 90 天转化率降序排序\n- `additional-purchases-num-last3days`：按近 3 天加购量降序排序\n- `additional-purchases-num-last7days`：按近 7 天加购量降序排序\n- `additional-purchases-num-last15days`：按近 15 天加购量降序排序\n- `additional-purchases-num-last30days`：按近 30 天加购量降序排序\n- `additional-purchases-num-last60days`：按近 60 天加购量降序排序\n- `add-to-cart-desc`：按近 90 天加购量降序排序\n- `views-pv-last3days`：按近 3 天浏览量降序排序\n- `views-pv-last7days`：按近 7 天浏览量降序排序\n- `views-pv-last15days`：按近 15 天浏览量降序排序\n- `views-pv-last30days`：按近 30 天浏览量降序排序\n- `views-pv-last60days`：按近 60 天浏览量降序排序\n- `view-desc`：按近 90 天浏览量降序排序",
                    "type": "string"
                  },
                  "template_path": {
                    "name": "template_path",
                    "description": "分类的主题模板。",
                    "type": "string",
                    "example": "templates/collection.collection_template_name.json"
                  },
                  "title": {
                    "name": "title",
                    "description": "分类的标题。",
                    "type": "string",
                    "example": "This is a title"
                  },
                  "updated_at": {
                    "name": "updated_at",
                    "description": "分类最近一次更新的时间。格式：[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)。",
                    "type": "string",
                    "example": "2021-09-03T14:11:54+00:00"
                  }
                },
                "example": {
                  "banner": {
                    "alt": "This is an image alt",
                    "id": "5785060242207917075",
                    "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                  },
                  "body_html": "This is a description",
                  "created_at": "2021-09-03T14:11:54+00:00",
                  "disjunctive": null,
                  "handle": "collection-handle",
                  "id": "12257170618007271602093384",
                  "image": {
                    "alt": "This is an image alt",
                    "id": "5785060242207917075",
                    "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                  },
                  "published_at": "2021-09-03T14:11:54+00:00",
                  "published_scope": null,
                  "rules": null,
                  "sort_order": null,
                  "template_path": "templates/collection.collection_template_name.json",
                  "title": "This is a title",
                  "updated_at": "2021-09-03T14:11:54+00:00"
                }
              }
            },
            "example": {
              "smart_collection": {
                "banner": {
                  "alt": "This is an image alt",
                  "id": "5785060242207917075",
                  "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                },
                "body_html": "This is a description",
                "created_at": "2021-09-03T14:11:54+00:00",
                "disjunctive": null,
                "handle": "collection-handle",
                "id": "12257170618007271602093384",
                "image": {
                  "alt": "This is an image alt",
                  "id": "5785060242207917075",
                  "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
                },
                "published_at": "2021-09-03T14:11:54+00:00",
                "published_scope": null,
                "rules": null,
                "sort_order": null,
                "template_path": "templates/collection.collection_template_name.json",
                "title": "This is a title",
                "updated_at": "2021-09-03T14:11:54+00:00"
              }
            }
          },
          "examples": {
            "创建智能分类": {
              "description": "创建智能分类。",
              "value": {
                "smart_collection": {
                  "banner": {
                    "alt": "This is an image alt",
                    "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png?type=banner"
                  },
                  "body_html": "This is a description",
                  "created_at": "2026-01-21T11:37:42+08:00",
                  "disjunctive": true,
                  "handle": "spring-clothing-3",
                  "id": "12273591337512073128362340",
                  "image": {
                    "alt": "This is an image alt",
                    "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png?type=cover"
                  },
                  "published_at": "2026-01-21T11:37:42+08:00",
                  "published_scope": "web",
                  "rules": [
                    {
                      "column": "tag",
                      "condition": "tag1",
                      "condition_object_id": null,
                      "relation": "equals"
                    }
                  ],
                  "sort_order": "updated-asc",
                  "template_path": null,
                  "title": "spring clothing",
                  "updated_at": "2026-01-21T11:37:42+08:00"
                }
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/products/smart_collections.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "创建智能分类",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_products"
  ]
}
```