开发指南 官网
API 2.0 > 3.1 商品 > 3.1.1 获取商品列表

3.1.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.goods-list 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述
pageSize int 分页,-1表示不分页(每页显示数)
search string 搜索词(示例:?search=sales_status::on;sales_channels::1;category::1;keyword::值;) sales_status:上下架状态(on or off),sales_channels:销售渠道 1:门店,2:网店,category:分类id,keyword:搜索值
page Int 当前页
orderBy string 排序字段 id::asc;sort::asc;
scene string goods-spec 或者 goods-content

响应参数

参数 参数类型 描述
current_page int 当前页码
total int 总条数
item_list array
 ├0 array
  ├name string 商品名称
  ├goods_id int 商品id(零售)
  ├type int 商品类型(1:实体商品,2:虚拟卡券商品)
  ├ brand_id int 品牌id
  ├corner_mark_id int 角标id
  ├market_price Money(分) 市场价
  ├sell_price Money(分) 销售价
  ├use_spec string 是否多规格(on or off) (平台零售、餐饮中是:是否多规格 1-是 0-否)
  ├sales_channels int 销售渠道(1:门店,2:网店)
  ├sales_status string 上下架状态(on or off)
  ├is_card_discount string 是否参加会员折扣(no or yes)
  ├share_text string 分享文字 最大20字
  ├limit_num int 限购数量
  ├limit_user int 准备时长
  ├min_buy_num string 实体条码 max:20
  ├prepare_time_type int 销售数量
  ├sort int 排序
  ├base_sales_num int 模拟销量
  ├sales_sum int 销售总数量
  ├unit string 库存单位
  ├spec array
   ├0 array
    ├id Int 规格id
    ├name string 规格名称
    ├value array
     ├0 array
      ├id Int 规格id
      ├name string 规格名称
  ├created_at DateTime 创建时间
  ├updated_at DateTime 更新时间
  ├product_no string 商品条码
  ├tag_name Int 实体标识
  ├cost_price Money(分 成本价
  ├stock Int 库存
  ├occupying_stock Int 占用库存
  ├images array
   ├0 array
    ├img_url string 图片url
    ├is_default Int 是否默认
  ├category array
   ├0 array
    ├category_id Int 分类id
    ├category_name string 分类名称
  ├entities array
   ├0 array
    ├goods_id Int 商品id
    ├product_no string 商品条码
    ├market_price Money(分) 市场价
    ├sell_price Money(分) 销售价
    ├img string 图片
    ├name string 商品名称
    ├tag_name string 实体标识
    ├prepare_time Int 准备时长
    ├prepare_time_type string 时间类型。d:日,h:时,m:分
    ├entity_id Int 实体id
    ├spec_value array
     ├尺寸 string 规格字符串 "规格名称":"规格值名称"
    ├spec_id array
     ├211 string 规格id字符串 "规格id":"规格值id"
    ├cost_price Money 成本价
    ├stock Int 库存
    ├occupying_stock Int 占用库存
  ├membership_price Money(分) 会员价
per_page int 每页显示数
total_pages int 总页数
next string 下一页链接

请求示例

{
    "OpenId": "6dc05b4ac175cf316d226252b05cf685",
    "GrantCode": "782c281f62",
    "Timestamp": "1547186244",
    "Nonce": "658965",
    "Token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "Action": "goods.goods-list",
    "Params": {
        "pageSize": "10",
        "search": "sales_status::on",
        "page": "1",
        "orderBy": "id::asc",
        "scene": "goods-content"
    }
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "current_page": "1",
        "total": "100",
        "item_list": [
            {
                "name": "商品名称",
                "goods_id": "",
                "type": "",
                "  brand_id": "",
                "corner_mark_id": "",
                "market_price": "",
                "sell_price": "",
                "use_spec": "",
                "sales_channels": "",
                "sales_status": "",
                "is_card_discount": "",
                "share_text": "",
                "limit_num": "",
                "limit_user": "",
                "min_buy_num": "",
                "prepare_time_type": "",
                "sort": "",
                "base_sales_num": "",
                "sales_sum": "",
                "unit": "只",
                "spec": [
                    {
                        "id": "",
                        "name": "",
                        "value": [
                            {
                                "id": "",
                                "name": ""
                            }
                        ]
                    }
                ],
                "created_at": "",
                "updated_at": "",
                "product_no": "",
                "tag_name": "",
                "cost_price": "",
                "stock": "",
                "occupying_stock": "",
                "images": [
                    {
                        "img_url": "",
                        "is_default": ""
                    }
                ],
                "category": [
                    {
                        "category_id": "",
                        "category_name": ""
                    }
                ],
                "entities": [
                    {
                        "goods_id": "",
                        "product_no": "",
                        "market_price": "",
                        "sell_price": "",
                        "img": "",
                        "name": "",
                        "tag_name": "",
                        "prepare_time": "",
                        "prepare_time_type": "",
                        "entity_id": "",
                        "spec_value": {
                            "尺寸": ""
                        },
                        "spec_id": {
                            "211": ""
                        },
                        "cost_price": "",
                        "stock": "",
                        "occupying_stock": ""
                    }
                ],
                "membership_price": ""
            }
        ],
        "per_page": "",
        "total_pages": "",
        "next": ""
    }
}

异常示例

{
    "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.goods-list 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述
category_id int 商品分类id
keywords string 搜索的商品字符(支持商品名称模糊搜索)
page int 页码
pagesize int 每页显示条数
status int 状态 0删除 1正常 2下架
sale_type int 销售类型 1堂食,2外卖,3堂食和外卖

响应参数

参数 参数类型 描述
current_page int 当前页码
last_page int 总页数
total int 总条数
item_list array
 ├0 array
  ├id int 商品id
  ├name string 商品名称
  ├images array
   ├0 string 商品图片
  ├stock int 商品堂食库存
  ├out_stock int 商品外卖库存
  ├sales int 商品销售量
  ├sell_price float 商品堂食价格(元)
  ├out_sell_price float 商品外卖价格(元)
  ├unit string 商品计量单位
  ├sale_type int 商品销售类型1堂食,2外卖,3堂食和外卖
  ├recommend int 是否推荐商品(1是 0否)
  ├sale_type_text string 商品销售类型 文字说明
  ├categories array
   ├0 array
    ├category_id int 商品分类id
    ├name string 商品分类名称
    ├sign string 商品分类编码
  ├koubei_sync_status int 口碑同步状态(1是 0否)
  ├image array
   ├0 string 商品图片
  ├property array
   ├0 array
    ├name string 做法名称
    ├values array
     ├0 array
      ├value string 做法值
  ├type int 商品的销售类型 1表示普通商品 2表示套餐商品
  ├goods_set_meals array
   ├0 array
    ├id int 商品套餐中的商品id
    ├images array
     ├0 string 商品套餐中的商品图片
    ├pivot array
     ├goods_id int 关联的套餐id
     ├goods_meal_id int 关联的套餐商品id
  ├cover_img string 商品封面图
  ├old_images array
   ├0 string 商品图片

请求示例

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

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "current_page": "1",
        "last_page": "10",
        "total": "100",
        "item_list": [
            {
                "id": "10001",
                "name": "商品名称",
                "images": [
                    ""
                ],
                "stock": "100",
                "out_stock": "100",
                "sales": "1000",
                "sell_price": "0.02",
                "out_sell_price": "0.02",
                "unit": "份",
                "sale_type": "3",
                "recommend": "1",
                "sale_type_text": "",
                "categories": [
                    {
                        "category_id": "1",
                        "name": "",
                        "sign": ""
                    }
                ],
                "koubei_sync_status": "0",
                "image": [
                    ""
                ],
                "property": [
                    {
                        "name": "",
                        "values": [
                            {
                                "value": ""
                            }
                        ]
                    }
                ],
                "type": "",
                "goods_set_meals": [
                    {
                        "id": "",
                        "images": [
                            ""
                        ],
                        "pivot": {
                            "goods_id": "",
                            "goods_meal_id": ""
                        }
                    }
                ],
                "cover_img": "",
                "old_images": [
                    "s10155\/2018\/12\/25\/6f3e8a8d677693f2c9.png"
                ]
            }
        ]
    }
}

异常示例

{
    "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.goods-list 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述
search string 搜索词(示例:?search=sales_status::on;sales_channels::1;category::1;keyword::值;) sales_status:上下架状态(on or off),sales_channels:销售渠道 1:门店,2:网店,category:分类id,keyword:搜索值
page Int 当前页
page_size int 20 每页显示数
verify_status int 审核状态筛选 0未提交审核 1待审核 2审核通过 3审核不通过
shelve_status int 上下架状态筛选 1-商家 0-下架
category_id array 分类筛选,支持数组

响应参数

参数 参数类型 描述
current_page int 当前页码
last_page int 总页数
total int 总条数
item_list array
 ├0 array
  ├id int 商品id
  ├sort int 商品排序
  ├name string 商品名称
  ├sales int 商品销售量
  ├market_price Money(分) 市场价
  ├sell_price Money(分) 销售价
  ├use_spec string 是否多规格(on or off) (平台零售、餐饮中是:是否多规格 1-是 0-否)
  ├unit string 库存单位
  ├created_at DateTime 创建时间
  ├stock Int 库存
  ├entities array
   ├0 array
    ├market_price Money(分) 市场价
    ├sell_price Money(分) 销售价
    ├stock Int 库存
    ├id string 规格id
    ├name string 规格名
    ├product_no string 条码
    ├tag_name string 标签,多个标签空格分割
    ├takeout_price Money(分) 外卖价
  ├takeout_price Money(分) 外卖价
  ├shelve_status int 上下架状态筛选 1-商家 0-下架
  ├verify_status int 审核状态筛选 0未提交审核 1待审核 2审核通过 3审核不通过
  ├shelve_reason int 下架 原因
  ├image string 主图

请求示例

{
    "OpenId": "6dc05b4ac175cf316d226252b05cf685",
    "GrantCode": "782c281f62",
    "Timestamp": "1547186244",
    "Nonce": "658965",
    "Token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "Action": "goods.goods-list",
    "Params": {
        "search": "sales_status::on",
        "page": "1",
        "page_size": "20",
        "verify_status": "1",
        "shelve_status": "1",
        "category_id": ""
    }
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "current_page": "1",
        "last_page": "10",
        "total": "100",
        "item_list": [
            {
                "id": "10001",
                "sort": "100",
                "name": "商品名称",
                "sales": "1000",
                "market_price": "",
                "sell_price": "",
                "use_spec": "",
                "unit": "只",
                "created_at": "",
                "stock": "",
                "entities": [
                    {
                        "market_price": "",
                        "sell_price": "",
                        "stock": "",
                        "id": "",
                        "name": "",
                        "product_no": "",
                        "tag_name": "",
                        "takeout_price": ""
                    }
                ],
                "takeout_price": "",
                "shelve_status": "1",
                "verify_status": "",
                "shelve_reason": "",
                "image": "https:\\\/\\\/images.qmai.cn\\\/s1000185\\\/2019\\\/04\\\/25\\\/bcddb36c2a18003331.jpg"
            }
        ]
    }
}

异常示例

{
    "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.goods-list 接口方法
Params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述
search string 搜索词(示例:?search=sales_status::on;sales_channels::1;category::1;keyword::值;) sales_status:上下架状态(on or off),sales_channels:销售渠道 1:门店,2:网店,category:分类id,keyword:搜索值
page Int 当前页
page_size int 20 每页显示数
verify_status int 审核状态筛选 0未提交审核 1待审核 2审核通过 3审核不通过
shelve_status int 上下架状态筛选 1-商家 0-下架
category_id array 分类筛选,支持数组

响应参数

参数 参数类型 描述
current_page int 当前页码
last_page int 总页数
total int 总条数
item_list array
 ├0 array
  ├id int 商品id
  ├sort int 商品排序
  ├name string 商品名称
  ├sales int 商品销售量
  ├market_price Money(分) 市场价
  ├sell_price Money(分) 销售价
  ├use_spec string 是否多规格(on or off) (平台零售、餐饮中是:是否多规格 1-是 0-否)
  ├unit string 库存单位
  ├created_at DateTime 创建时间
  ├stock Int 库存
  ├entities array
   ├0 array
    ├market_price Money(分) 市场价
    ├sell_price Money(分) 销售价
    ├stock Int 库存
    ├id string 规格id
    ├name string 规格名
    ├product_no string 条码
    ├tag_name string 标签,多个标签空格分割
    ├takeout_price Money(分) 外卖价
  ├takeout_price Money(分) 外卖价
  ├shelve_status int 上下架状态筛选 1-商家 0-下架
  ├verify_status int 审核状态筛选 0未提交审核 1待审核 2审核通过 3审核不通过
  ├shelve_reason int 下架 原因
  ├image string 主图

请求示例

{
    "OpenId": "6dc05b4ac175cf316d226252b05cf685",
    "GrantCode": "782c281f62",
    "Timestamp": "1547186244",
    "Nonce": "658965",
    "Token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "Action": "goods.goods-list",
    "Params": {
        "search": "sales_status::on",
        "page": "1",
        "page_size": "20",
        "verify_status": "1",
        "shelve_status": "1",
        "category_id": ""
    }
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "current_page": "1",
        "last_page": "10",
        "total": "100",
        "item_list": [
            {
                "id": "10001",
                "sort": "100",
                "name": "商品名称",
                "sales": "1000",
                "market_price": "",
                "sell_price": "",
                "use_spec": "",
                "unit": "只",
                "created_at": "",
                "stock": "",
                "entities": [
                    {
                        "market_price": "",
                        "sell_price": "",
                        "stock": "",
                        "id": "",
                        "name": "",
                        "product_no": "",
                        "tag_name": "",
                        "takeout_price": ""
                    }
                ],
                "takeout_price": "",
                "shelve_status": "1",
                "verify_status": "",
                "shelve_reason": "",
                "image": "https:\\\/\\\/images.qmai.cn\\\/s1000185\\\/2019\\\/04\\\/25\\\/bcddb36c2a18003331.jpg"
            }
        ]
    }
}

异常示例

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

错误码

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

免费升级

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

免费专业培训

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

7×24小时服务支持

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

 

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