官方分类
获取电商平台店铺的官方分类树,支持 1688 与 微店(weidian 须传 shop_id)。
GET
https://open.hiobuy.com/api/client/open-purchase/category/item若实际 API 基地址不同,请替换 `https://open.hiobuy.com`。
请求头
| 名称 | 必填 | 类型 | 说明 |
|---|---|---|---|
X-Uuid | 是 | string | 商户 UUID(账户唯一标识) |
查询参数
| 名称 | 必填 | 类型 | 说明 |
|---|---|---|---|
platform | 是 | string | 平台:`taobao`(淘宝)、`1688`、`weidian`(微店) |
shop_id | 否 | string | 店铺 ID。`platform` 为 `weidian` 时**必填** |
categoryId | 否 | string | 父分类 ID,用于加载子分类;不传则返回完整分类树 |
请求示例
GET /api/client/open-purchase/category/item?platform=1688微店示例:
GET /api/client/open-purchase/category/item?platform=weidian&shop_id=YOUR_SHOP_ID响应示例
{
"ret": 1,
"msg": "操作成功",
"data": [
{
"id": 0,
"name": "未分类",
"children": []
},
{
"id": 153155016,
"name": "女装",
"children": [
{
"id": 153155017,
"name": "睡衣"
},
{
"id": 153155049,
"name": "打底裤"
}
]
},
{
"id": 153156429,
"name": "男装",
"children": [
{
"id": 153156430,
"name": "羽绒服"
},
{
"id": 153191807,
"name": "T恤"
}
]
}
]
}实际 `data` 分类列表可能很长,下例仅展示部分节点。
响应字段
顶层字段
| 名称 | 类型 | 说明 |
|---|---|---|
ret | number | 状态码,`1` 表示成功 |
msg | string | 状态说明 |
data | object | 官方分类树 |
data[]
| 名称 | 类型 | 说明 |
|---|---|---|
id | number | 分类 ID,`0` 表示未分类 |
name | string | 分类显示名称 |
children | array | 子分类列表;无子级时为空数组 |
data[].children[]
| 名称 | 类型 | 说明 |
|---|---|---|
id | number | 子分类 ID |
name | string | 子分类名称 |