开发指南 官网
API 2.0 > 3.4 商品分类 > 3.4.1 获取分类列表

3.4.1 获取分类列表

开启令牌和权限后可调用。签名方式请查看开发指南
场景描述:获取当前店铺下所有的商品分类列表

请求地址

请求方式 版本信息 请求地址
POST V2 http://openapi.zvcms.com/api/v2

公共参数

参数 参数类型 是否必填 默认值 描述
OpenId string 密钥Id
GrantCode string 授权code
Token string 签名,参考《数字签名sign》
Timestamp string 当前时间戳
Nonce string 随机正整数
Action string goods-category.goods-category-list 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述

响应参数

参数 参数类型 描述
item_list array
 ├0 array
  ├id int 分类id
  ├name string 分类名称
  ├parent_id int 父ID
  ├lft int
  ├rgt int
  ├depth int 层级
  ├img string 图片
  ├goods_count Int 商品数量汇总
  ├created_at TimeStamp 创建时间
  ├updated_at TimeStamp 更新时间
  ├is_hidden Int 是否隐藏 0--不隐藏 1--隐藏
  ├code string 分类编码
  ├sales_channels array
   ├0 array 销售渠道 1:门店,2:网店
   ├1 array 销售渠道 1:门店,2:网店

请求示例

{
    "OpenId": "6dc05b4ac175cf316d226252b05cf685",
    "GrantCode": "782c281f62",
    "Timestamp": "1547186244",
    "Nonce": "658965",
    "Token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "Action": "goods-category.goods-category-list",
    "Params": []
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "item_list": [
            {
                "id": "10001",
                "name": "分类名称",
                "parent_id": "",
                "lft": "",
                "rgt": "",
                "depth": "",
                "img": "",
                "goods_count": "",
                "created_at": "",
                "updated_at": "",
                "is_hidden": "",
                "code": "",
                "sales_channels": [
                    "1",
                    "2"
                ]
            }
        ]
    }
}

异常示例

{
    "status": true,
    "code": "异常编码,根据不同的业务返回编码",
    "message": "异常说明:查询的信息不存在"
}

错误码

{
    "status": false,
    "code": "系统错误编码:详见全局返回编码",
    "message": "系统错误说明"
}

请求地址

请求方式 版本信息 请求地址
POST V2 http://openapi.zvcms.com/api/v2

公共参数

参数 参数类型 是否必填 默认值 描述
OpenId string 密钥Id
GrantCode string 授权code
Token string 签名,参考《数字签名sign》
Timestamp string 当前时间戳
Nonce string 随机正整数
Action string goods-category.goods-category-list 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述
type int 分类类型 1-堂食 2-外卖 3-外卖堂食
page int 页码
per_page int 每页显示条数

响应参数

参数 参数类型 描述
current_page int 当前页码
last_page int 总页数
total int 总条数
item_list array
 ├0 array
  ├id int 分类id
  ├name string 分类名称
  ├sort int 分类排序
  ├show_period_text string 说明展示
  ├icon string 分类图标
  ├type_text string 分类类型 文本说明
  ├start_time string 售卖开始时间
  ├end_time string 售卖结束时间
  ├koubei_sync_status int 同步口碑状态: 0 未同步 1已同步
  ├pid int 父级分类ID 0为顶级(餐饮业务不返回该字段)
  ├sign string 分类编码

请求示例

{
    "OpenId": "6dc05b4ac175cf316d226252b05cf685",
    "GrantCode": "782c281f62",
    "Timestamp": "1547186244",
    "Nonce": "658965",
    "Token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "Action": "goods-category.goods-category-list",
    "Params": {
        "type": "3",
        "page": "1",
        "per_page": "10"
    }
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "current_page": "1",
        "last_page": "10",
        "total": "100",
        "item_list": [
            {
                "id": "10001",
                "name": "分类名称",
                "sort": "100",
                "show_period_text": "全时段售卖",
                "icon": "",
                "type_text": "堂食\/外卖",
                "start_time": "00:00:00",
                "end_time": "23:59:59",
                "koubei_sync_status": "0",
                "pid": "",
                "sign": ""
            }
        ]
    }
}

异常示例

{
    "status": true,
    "code": "异常编码,根据不同的业务返回编码",
    "message": "异常说明:查询的信息不存在"
}

错误码

{
    "status": false,
    "code": "系统错误编码:详见全局返回编码",
    "message": "系统错误说明"
}

请求地址

请求方式 版本信息 请求地址
POST V2 http://openapi.zvcms.com/api/v2

公共参数

参数 参数类型 是否必填 默认值 描述
OpenId string 密钥Id
GrantCode string 授权code
Token string 签名,参考《数字签名sign》
Timestamp string 当前时间戳
Nonce string 随机正整数
Action string goods-category.goods-category-list 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述

响应参数

参数 参数类型 描述
item_list array
 ├0 array
  ├id int 分类id
  ├name string 分类名称
  ├sort int 分类排序
  ├pid int 父级分类ID 0为顶级(餐饮业务不返回该字段)
  ├_child array
   ├0 array
    ├id array 子分类id
    ├name array 子分类名
    ├pid array 分类父id
    ├sort array 排序,数字越小越靠前

请求示例

{
    "OpenId": "6dc05b4ac175cf316d226252b05cf685",
    "GrantCode": "782c281f62",
    "Timestamp": "1547186244",
    "Nonce": "658965",
    "Token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "Action": "goods-category.goods-category-list",
    "Params": []
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "item_list": [
            {
                "id": "10001",
                "name": "分类名称",
                "sort": "100",
                "pid": "",
                "_child": [
                    {
                        "id": "",
                        "name": "",
                        "pid": "",
                        "sort": ""
                    }
                ]
            }
        ]
    }
}

异常示例

{
    "status": true,
    "code": "异常编码,根据不同的业务返回编码",
    "message": "异常说明:查询的信息不存在"
}

错误码

{
    "status": false,
    "code": "系统错误编码:详见全局返回编码",
    "message": "系统错误说明"
}

请求地址

请求方式 版本信息 请求地址
POST V2 http://openapi.zvcms.com/api/v2

公共参数

参数 参数类型 是否必填 默认值 描述
OpenId string 密钥Id
GrantCode string 授权code
Token string 签名,参考《数字签名sign》
Timestamp string 当前时间戳
Nonce string 随机正整数
Action string goods-category.goods-category-list 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述

响应参数

参数 参数类型 描述
item_list array
 ├0 array
  ├id int 分类id
  ├name string 分类名称
  ├sort int 分类排序
  ├pid int 父级分类ID 0为顶级(餐饮业务不返回该字段)
  ├_child array
   ├0 array
    ├id array 子分类id
    ├name array 子分类名
    ├pid array 分类父id
    ├sort array 排序,数字越小越靠前

请求示例

{
    "OpenId": "6dc05b4ac175cf316d226252b05cf685",
    "GrantCode": "782c281f62",
    "Timestamp": "1547186244",
    "Nonce": "658965",
    "Token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "Action": "goods-category.goods-category-list",
    "Params": []
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "item_list": [
            {
                "id": "10001",
                "name": "分类名称",
                "sort": "100",
                "pid": "",
                "_child": [
                    {
                        "id": "",
                        "name": "",
                        "pid": "",
                        "sort": ""
                    }
                ]
            }
        ]
    }
}

异常示例

{
    "status": true,
    "code": "异常编码,根据不同的业务返回编码",
    "message": "异常说明:查询的信息不存在"
}

错误码

{
    "status": false,
    "code": "系统错误编码:详见全局返回编码",
    "message": "系统错误说明"
}

免费升级

营销功能、插件持续每月更新开发升级

免费专业培训

每月建站、微信营销、电商等互联网增值培训

7×24小时服务支持

400电话、QQ、微信、在线等多渠道售后支持

 

安徽智迈科技股份有限公司 版权所有 Copyright 2009-2018 皖公网安备 34019202000074号 增值电信业务经营许可证:皖B2-20170075