cat_id 、 release_mode 字段描述,新增 extra_service_list 、 is_need_bar_code 字段。接口应在服务器端调用,不可在前端(小程序、网页、APP等)直接调用,具体可参考接口调用指南
接口英文名:getcategoryproductrule
POST https://api.weixin.qq.com/shop/ec/category/getcategoryproductrule?access_token=ACCESS_TOKEN
本接口支持第三方平台代微信小店商家调用。第三方服务商调用模式介绍
该接口所属的权限集 id 为:85、129
服务商获得其中之一权限集授权后,可通过使用 authorizer_access_token 代微信小店商家进行调用,具体可查看 第三方调用 说明文档。
Query String parameters| 参数名 | 类型 | 必填 | 示例 | 说明 |
|---|---|---|---|---|
| access_token | string | 是 | ACCESS_TOKEN | 接口调用凭证,可使用 access_token(微信小店商家)、authorizer_access_token(服务商代调用) |
Request Payload| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| cat_id | number | 是 | 类目ID |
| release_mode | number | 是 | 发布模式。0: 普通模式;1: 极简模式 |
Response Payload| 参数名 | 类型 | 说明 |
|---|---|---|
| errcode | number | 错误码 |
| errmsg | string | 错误信息 |
| info | object | 类目信息 |
| product_attr_list | objarray | 产品属性 |
| sale_attr_list | objarray | 销售属性 |
| product_qua_list | objarray | 资质信息 |
| floor_price | number | 价格下限,单位分,商品售价不可低于此价格 |
| size_chart | object | 尺码表 |
| product_requirement | object | 商品编辑要求 |
| extra_service_list | objarray | 额外服务 |
| is_need_bar_code | boolean | 是否必填sku条形码 |
Object Payload类目信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| cat_id | number | 类目ID |
| name | string | 类目名称 |
Object Payload产品属性
| 参数名 | 类型 | 说明 |
|---|---|---|
| name | string | 类目必填项名称 |
| value | string | 可选项列表,当type为:select_one/select_many时,为选项列表 当type为:integer_unit/decimal4_unit时,为单位的列表 |
| hint | string | 输入提示,请填写提示语 |
| append_allowed | boolean | 允许添加选项,当type为select_one/select_many时,标识是否允许添加新选项(value中不存在的选项) |
| type_v2 | string | 属性类型v2,共7种类型 string:文本 select_one:单选,选项列表在value中 select_many:多选,选项列表在value中 integer:整数,数字必须为整数 decimal4:小数(4 位精度),小数部分最多 4 位 integer_unit:整数 + 单位,单位的选项列表在value中 decimal4_unit:小数(4 位精度) + 单位,单位的选项列表在value中 |
| required_rule | object | 填写规则 |
Object Payload销售属性
| 参数名 | 类型 | 说明 |
|---|---|---|
| name | string | 类目必填项名称 |
| value | string | 可选项列表,当type为:select_one/select_many时,为选项列表 当type为:integer_unit/decimal4_unit时,为单位的列表 |
| hint | string | 输入提示,请填写提示语 |
| append_allowed | boolean | 允许添加选项,当type为select_one/select_many时,标识是否允许添加新选项(value中不存在的选项) |
| type_v2 | string | 属性类型v2,共7种类型 string:文本 select_one:单选,选项列表在value中 select_many:多选,选项列表在value中 integer:整数,数字必须为整数 decimal4:小数(4 位精度),小数部分最多 4 位 integer_unit:整数 + 单位,单位的选项列表在value中 decimal4_unit:小数(4 位精度) + 单位,单位的选项列表在value中 |
| required_rule | object | 填写规则 |
Object Payload资质信息
| 参数名 | 类型 | 说明 |
|---|---|---|
| id | number | 资质ID |
| tips | string | 资质的描述信息 |
| name | string | 资质名称 |
| required_rule | object | 填写规则 |
Object Payload尺码表
| 参数名 | 类型 | 说明 |
|---|---|---|
| is_support | boolean | 是否支持尺码表 |
| item_list | objarray | 尺码配置要求列表 |
Object Payload商品编辑要求
| 参数名 | 类型 | 说明 |
|---|---|---|
| product_title_requirement | string | 商品标题的编辑要求 |
| product_img_requirement | string | 商品主图的编辑要求 |
| product_desc_requirement | string | 商品描述的编辑要求 |
Object Payload额外服务
| 参数名 | 类型 | 说明 |
|---|---|---|
| extra_service_name | string | 额外服务参数名 |
| extra_service_type | string | 额外服务参数类型,select_one:单选,选项列表在value中;integer:整数,数字必须为整数 |
| extra_service_value | string | 额外服务参数可选值 |
Object Payload填写规则
以下参数使用相同结构:
- Res.sale_attr_list(Array).required_rule : 填写规则
| 参数名 | 类型 | 说明 |
|---|---|---|
| rule_type | number | 规则类型,1-必填 2-选填 3-条件必填,依赖or_combinators |
| or_combinators | objarray | 规则组合, 关系固定为or;仅rule_type==3时生效 |
Object Payload规则组合, 关系固定为or;仅rule_type==3时生效
| 参数名 | 类型 | 说明 |
|---|---|---|
| and_combinators | object | 规则组合, 关系固定为and |
Object Payload规则组合, 关系固定为and
| 参数名 | 类型 | 说明 |
|---|---|---|
| combine_type | number | 组合类型 |
| text_conditions | objarray | 检查参数 |
Object Payload检查参数
| 参数名 | 类型 | 说明 | 枚举 |
|---|---|---|---|
| check_field | number | 检查的字段 | 枚举值 |
| oper_type | number | 操作类型 | 枚举值 |
| keywords | array | 关键字列表 | - |
Object Payload尺码配置要求列表
| 参数名 | 类型 | 说明 |
|---|---|---|
| name | string | 尺码属性名称 |
| unit | string | 尺码属性值的单位 |
| type | string | 尺码属性值的类型,1:字符型,2:整数型,3:小数型 |
| is_required | boolean | 是否必填 |
| format | string | 尺码属性值的填写格式,1:单值填写,2:区间值填写,3:支持单值或区间值 |
| limit | string | 尺码属性值的限制 |
Enum检查的字段
| 枚举值 | 描述 |
|---|---|
| 1 | 商品参数key |
| 2 | 商品参数value |
| 3 | 商品标题 |
Enum操作类型
| 枚举值 | 描述 |
|---|---|
| 1 | 包含 |
| 2 | 不含 |
| 3 | 正则 |
本接口无特殊注意事项
请求示例
{
"cat_id": 546776,
"release_mode":0
}
返回示例
{
"errcode": 0,
"errmsg": "ok",
"info": {
"cat_id": "546776",
"name": "鹅蛋"
},
"product_attr_list": [
{
"name": "国产/进口",
"type": "select_one",
"value": "国产;进口",
"hint": "",
"append_allowed": false,
"type_v2": "select_one",
"required_rule": {
"rule_type": 1,
"or_combinators": []
}
},
{
"name": "产地",
"type": "select_one",
"value": "美国;韩国;日本",
"hint": "",
"append_allowed": false,
"type_v2": "select_one",
"required_rule": {
"rule_type": 1,
"or_combinators": []
}
}
],
"sale_attr_list": [],
"product_qua_list": [
{
"id": 1111518,
"tips": "生鲜肉类产品需提供",
"name": "动物防疫条件合格证",
"required_rule": {
"rule_type": 3,
"or_combinators": [
{
"and_combinators": [
{
"combine_type": 1,
"text_conditions": [
{
"check_field": 1,
"oper_type": 1,
"keywords": [
"国产/进口"
]
},
{
"check_field": 2,
"oper_type": 1,
"keywords": [
"国产"
]
}
]
}
]
}
]
}
},
{
"id": 1111491,
"tips": "若为进口商品,需提供近一年内的中华人民共和国海关进口货物报关单,展现对应品牌名称及商品名称",
"name": "报关单",
"required_rule": {
"rule_type": 3,
"or_combinators": [
{
"and_combinators": [
{
"combine_type": 1,
"text_conditions": [
{
"check_field": 1,
"oper_type": 1,
"keywords": [
"国产/进口"
]
},
{
"check_field": 2,
"oper_type": 1,
"keywords": [
"进口"
]
}
]
}
]
}
]
}
}
],
"size_chart": {
"is_support": false,
"item_list": []
},
"product_requirement": {
"product_title_requirement": "",
"product_img_requirement": "",
"product_desc_requirement": ""
}
}
此接口没有特殊错误码,可参考 通用错误码;调用接口遇到报错,可使用官方提供的 API 诊断工具 辅助定位和分析问题。
本接口支持「微信小店」账号类型调用。其他账号类型如无特殊说明,均不可调用。
cat_id 、 release_mode 字段描述,新增 extra_service_list 、 is_need_bar_code 字段。