创建分类
POST /openapi/2023-10/collections
权限:write_collections
Header参数
参数名
说明
必填
值可能性
示例
X-LANG
语言项
否
zh-CN
Body参数
参数名
说明
必填
类型
值可能性
示例
name
分类名称
是
[string]
collection
description
分类描述
否
[string]
<p>hello, world</p>
thumbnail
缩略图ID
否
[integer]
1
sort_type
排序类型
否
[string]
manual:手动排序
created_descending:创建时间降序
created_ascending:创建时间升序
price_descending:价格降序
price_ascending:价格升序
best_selling_descending:按销量降序
best_selling_descending_descending:按销量升序
manual
seo_title
SEO 标题
否
[string]
seo title
slug
商品地址slug
否
[string]
product-cat
product_ids
分类所含商品ID
否
[array]
[[id =>商品ID, locked => 锁定位置,在排序的基础上再加了一层锁定,值(0,1)]]
category_type
分类类型
否
[string]
manual_category:手动分类
auto_category:自动分类
auto_category
additional
额外属性
否
[string]
fetach_any:满足任意
fetach_all:满足所有
fetch_all
conditions
分类条件
否
[array]
当 category_type=auto_category 时必填
conditions[]>>type
条件类型
是
[string]
title:标题
price:现价
regular_price:原价
weight:重量
tag:标签
stock:库存
title
conditions[]>>options
条件配置
是
[object]
conditions[]>>options>>operator
条件比较符
是
[string]
equal:相等
not_equal:不相等
more_than:大于
less_than:小于
contain:包含
not_contain:不包含
equal
conditions[]>>options>>value
条件值
否
[string]
100
示例请求内容
curl --location --request POST 'https://example.hotishop.com/openapi/2021-08/collections' \
--header 'Authorization: {access-token}' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"name": "This is a test collection",
"description": "<p><strong>There</strong> is collection <a href=\"https://example.hotishop.com\" target=\"_blank\" rel=\"noopener\">description</a>.</p>",
"sort_type": "manual",
"seo_title": "This is a test collection",
"seo_description": "<p><strong>There</strong> is collection <a href=\"https://example.hotishop.com\" target=\"_blank\" rel=\"noopener\">description</a>.</p>",
"category_type": "manual_category",
"conditions": []
}'
示例响应内容
{
"term_taxonomy_id": 1924,
"taxonomy": "product_cat",
"description": "<p>product category</p>",
"parent": 0,
"count": 0,
"id": 1924,
"thumbnail": null,
"thumbnail_url": "",
"product_count": 0,
"order": null,
"seo_title": "product category",
"seo_description": "product category description.",
"name": "product category",
"slug": "product-category",
"public_url": "https://example.hotishop.com/collections/product-category",
"base_url": "https://example.hotishop.com/collections",
"source": null,
"total_count": null,
"path": "/collections/product-category",
"sort_type": "manual",
"category_type": "manual_category",
"additional": "",
"conditions": [],
"term": {
"term_id": 1925,
"name": "product category",
"slug": "product-category",
"term_group": 0
}
}
Last updated