ECJiaWiki:Api:goods/list (o2o)

来自ECJiaWiki
跳转至: 导航搜索

应用场景

 获取商品列表

接口名称

 goods/list

请求参数

字段名 变量名 必填 类型 示例值 描述
token请求凭证 token String eec1ca04e8efbbe098f19aa16eb2764b3d3236d4 token信息
分类id category_id Int 1 分类id
品牌id brand_id Int 1 品牌id
搜索关键字 keywords String 搜索关键字
以什么字段排序 sort_by String add_time 以什么字段排序
价格区间 price_range String 价格区间
分页信息 pagination pagination字典 分页信息
└ 每页显示条数 count Int 每页显示条数
└ 当前页数 page Int 当前页数


举例如下

{
      "token" : "eec1ca04e8efbbe098f19aa16eb2764b3d3236d4",
      "pagination" : {
    	    "count" : 10,
    	    "page" : 1
      },
      "category_id" : "1",
      "brand_id" : "1",
      "keywords" : "热销",
      "price_range" : "1000-2000",
      "sort_by"  : "add_time",
}


返回参数

字段名 变量名 必填 类型 示例值 描述
返回状态码 status json {"succeed" : 1} 返回请求接口后的数据,succeed为1代表成功,0则为失败,失败后则返回error_code(错误code)及error_desc(错误说明)
返回信息 data Array() 请求接口提供的返回信息
└ 店铺id store_id Int 店铺id
└ 店铺名称 store_name string 店铺名称
└ 分页信息 paginated paginated字典 分页信息
   └ 总条数 total Int 总条数
   └ 当前返回数组的总条数 count Int 当前返回数组的总条数
   └ 是否有下一页 more Int 1:有下一页,0:没有下一页 是否有下一页


成功举例如下

{
    "data": [
        {
            "store_id": 58,
            "store_name": "尚品美食专营店",
            "store_logo": "http://192.168.1.69/cityo2o/content/uploads/merchant/58/data/shop_logo/1478818644987941673.png",
            "manage_mode": "join",
            "seller_id": 58,
            "seller_name": "尚品美食专营店",
            "seller_logo": "http://192.168.1.69/cityo2o/content/uploads/merchant/58/data/shop_logo/1478818644987941673.png",
            "goods_id": 342,
            "goods_name": "澳洲 进口牛奶 生机谷(Living Planet)有机全脂牛奶1L*12盒",
            "id": 342,
            "name": "澳洲 进口牛奶 生机谷(Living Planet)有机全脂牛奶1L*12盒",
            "goods_sn": "ECS000342",
            "market_price": "¥480.00",
            "unformatted_market_price": "480.00",
            "shop_price": "¥400.00",
            "unformatted_shop_price": "400.00",
            "promote_price": "",
            "promote_start_date": "",
            "promote_end_date": "",
            "unformatted_promote_price": "0.00",
            "product_id": 0,
            "product_goods_attr": "",
            "goods_barcode": "",
            "activity_type": "GENERAL_GOODS",
            "object_id": 0,
            "saving_price": "80.00",
            "formatted_saving_price": "已省80元",
            "properties": [
                {
                    "name": "名称",
                    "value": "澳洲 进口牛奶 生机谷(Living Planet)有机全脂牛奶1L*12盒"
                },
                {
                    "name": "品牌",
                    "value": "生机谷"
                },
                {
                    "name": "产地",
                    "value": "澳洲 "
                },
                {
                    "name": "净含量",
                    "value": "1L*12盒"
                },
                {
                    "name": "保质期",
                    "value": "十二个月"
                },
                {
                    "name": "类别",
                    "value": "休闲食品"
                }
            ],
            "specification": [],
            "img": {
                "thumb": "http://192.168.1.69/cityo2o/content/uploads/images/201508/goods_img/342_G_1440470920724.png",
                "url": "http://192.168.1.69/cityo2o/content/uploads/images/201508/source_img/342_G_1440470920400.png",
                "small": "http://192.168.1.69/cityo2o/content/uploads/images/201508/thumb_img/342_thumb_G_1440470920839.png"
            }
        }
    ],
            "status": {
            "succeed": 1
    },
            "paginated": {
            "total": 547,
            "count": 547,
            "more": 1
    }
}

注:错误编码

错误返回参数

失败举例如下

注:错误编码