版本:202607
创建商品专辑
POST/openapi/2026-07/collections
在店铺中创建一个新的商品专辑,可设置专辑名称、描述、关联商品、SEO 信息及商品排序规则。
请求
- application/json
- 请求体
- 示例
请求体必填
manual:手动排序(默认)sales-desc:按总销量从高到低price-asc:按售价从低到高price-desc:按售价从高到低views-desc:按浏览人气从高到低vendor-asc:按供应商 A-Z 展示vendor-desc:按供应商 Z-A 展示created-desc:按创建时间从近到远:intelligent:智能推荐排序true:满足任一规则模块即可(OR)false:所有规则模块都必须满足(AND,默认)- Array [
true:满足任一规则即可(OR)false:所有规则都必须满足(AND,默认)- Array [
title:商品标题product_status:商品状态tags:商品标签vendor:供应商 / 品牌variant_price:SKU 价格variant_weight:SKU 重量inventory_quantity:库存数量product_note:商品备注sales:销售量real_sales:实际销售量views:浏览量add_to_cart_count:加购次数created_at:商品创建时间spu:SPU 标识符spus_match:SPU 匹配状态published_at:发布时间category_id:类目 IDbrand:品牌equals:等于not_equals:不等于starts_with:以...开头ends_with:以...结尾contains:包含not_contains:不包含greater_than:大于less_than:小于top:前 N 个结果(通常用于可排序字段)- 文本字段:普通字符串。
- 数值字段:可转换为数字的字符串。
- 时间字段:时间戳或约定的时间格式。
top运算符:代表 N 的值。- ]
- ]
collection object必填
待创建的专辑数据
titlestring必填
专辑名称
handlestring
专辑 handle(URL 友好的唯一别名)
descriptionstring
专辑描述
image object
专辑封面
srcstring必填
专辑封面的源 URL
widthint32
专辑封面宽度(单位:像素)
heightint32
专辑封面高度(单位:像素)
altstring
专辑封面的替代文本(alt)
seo_titlestring
专辑的 SEO 标题
seo_keywordsstring[]
SEO 关键词列表
seo_descriptionstring
专辑的 SEO 描述
sort_orderstring
专辑内商品的排序规则,可选值:
默认值:
manualproduct_idsstring[]
要加入专辑的商品 ID 列表,必须为有效的 UUID
smartboolean
是否为智能集合
match_rules object
智能集合匹配规则
disjunctiveboolean
规则模块之间的逻辑关系:
rule_modules object[]
规则模块列表
disjunctiveboolean
模块内规则之间的逻辑关系:
rules object[]
模块内的规则列表
columnstring
规则匹配的目标字段。可选值:
relationstring
用于匹配的比较运算符。可选值:
conditionstring
规则的条件值
tagsstring[]
集合标签列表
{
"collection": {
"title": "string",
"handle": "string",
"description": "string",
"image": {
"src": "string",
"width": 0,
"height": 0,
"alt": "string"
},
"seo_title": "string",
"seo_keywords": [
"string"
],
"seo_description": "string",
"sort_order": "manual",
"product_ids": [
"string"
],
"smart": true,
"match_rules": {
"disjunctive": true,
"rule_modules": [
{
"disjunctive": true,
"rules": [
{
"column": "string",
"relation": "string",
"condition": "string"
}
]
}
]
},
"tags": [
"string"
]
}
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
- Array [
- Array [
- ]
- ]
codestring
错误码
messagestring
错误信息
data object
collection object
已创建的专辑
idstring
专辑 ID
titlestring
专辑名称
descriptionstring
专辑描述
handlestring
专辑 handle(URL 友好的唯一别名)
smartboolean
是否为智能专辑(满足条件的商品自动加入)
image object
专辑封面
srcstring
图片来源 URL
widthint32
图片宽度(像素)
heightint32
图片高度(像素)
altstring
图片替代文本
seo_titlestring
专辑的 SEO 标题
seo_keywordsstring[]
SEO 关键词列表
seo_descriptionstring
专辑的 SEO 描述
sort_orderstring
专辑内商品的排序规则(取值见创建专辑接口)
created_atstring
专辑创建时间(ISO-8601 格式)
updated_atstring
专辑最后更新时间(ISO-8601 格式)
match_rules object
智能集合匹配规则
disjunctiveboolean
条件是否为析取关系(OR)
rule_modules object[]
规则模块列表
disjunctiveboolean
条件是否为析取关系(OR)
rules object[]
此模块中的规则列表
columnstring
列
relationstring
关联关系
conditionstring
条件
tagsstring[]
集合标签列表
product_countint64
集合中的商品数量
{
"code": "string",
"message": "string",
"data": {
"collection": {
"id": "string",
"title": "string",
"description": "string",
"handle": "string",
"smart": true,
"image": {
"src": "string",
"width": 0,
"height": 0,
"alt": "string"
},
"seo_title": "string",
"seo_keywords": [
"string"
],
"seo_description": "string",
"sort_order": "string",
"created_at": "string",
"updated_at": "string",
"match_rules": {
"disjunctive": true,
"rule_modules": [
{
"disjunctive": true,
"rules": [
{
"column": "string",
"relation": "string",
"condition": "string"
}
]
}
]
},
"tags": [
"string"
],
"product_count": 0
}
}
}