获取商品类目

使用场景:批量查询商家抖店商品信息
1、支持使用商品状态,商品类型、商品创建时间和更新时间筛选商品
2、最大支持1次查询1万条,如返回商品数据大于1万条,请增加筛选条件。

请求URL:

POST https://kf.fw199.com/gateway/dd/product/list/v2

公共参数

参数名称 参数类型 是否必须 示例值 参数描述
appid String 合作伙伴AppId
timestamp String 1657525936 当前Unix时间戳,秒
seller_nick String 38173182 抖店的账号,对应蜂巢授权返回doudianseller字段
sign String

业务参数

参数名称 参数类型 是否必须 示例值 参数描述
status Number 0 商品在店铺中状态:0-在线;1-下线;2-删除;详见商品状态机:商品状态机
check_status Number 3 商品审核状态:1-未提交;2-待审核;3-审核通过;4-审核未通过;5-封禁;7-审核通过待上架;详见商品状态机:商品状态机
product_type Number 0 商品类型;0-普通;1-新客商品;3-虚拟;6-玉石闪购;7-云闪购 ;127-其他类型;
start_time Number 1619161933 商品创建开始时间,unix时间戳,单位:秒;
end_time Number 1619162000 商品创建结束时间,unix时间戳,单位:秒;
update_start_time Number 1619161933 商品更新开始时间,unix时间戳,单位:秒;注意:查询范围是update_start_time和update_end_time之间的数据,不包含入参时间。
update_end_time Number 1619161933 商品更新结束时间,unix时间戳,单位:秒;注意:查询范围是update_start_time和update_end_time之间的数据,不包含入参时间。
page Number 1 页码,从1开始,最大为100;page*size最大不能超过1万条
size Number 10 页数,填写范围1~100;page*size最大不能超过1万条
store_id - 123456 小时达商家使用的门店id,即时零售单店版,无需使用
name String 标题 商品标题,支持模糊匹配
product_id List 3600137140018749665 商品id,最大支持传入100个;
use_cursor Bool true 是否使用游标,true 使用,false 不使用;使用游标能遍历全量商品,不会受到只能查询到10000个数据的影响。特别说明:使用游标查询时,page字段失效,只会查询当前游标后面size条数据;根据获取查询数据为空来判断本次遍历结束;查询过程中数据发生变更,可能重复、遗漏数据;需要保证每次查询的筛选条件一致。
cursor_id String WzE2ODI1Nzc4MjksMTc2NDMxMDczMDU3MDg0M10= 游标id,结合use_cursor使用(use_cursor=true);首次查询时不需要传值,每次查询结果会返回cursor_id,下一次查询时复制给该字段。当查询返回数据为空时,结束遍历。
can_combine_product Bool true 能否参加搭配
+lookup_option Struct - 查询option(具体结构体内容未提供)
-need_name_affix Bool true 是否需要获取标题前后缀
-need_title_limit Bool true 是否需要获取商品标题长度限制规则

2. 请求示例代码(Java)

请求示例代码

    @Test
    public void  DDProductListv2() throws Exception {
        Map<String, Object> data = new HashMap<String, Object>();
        data.put("appid",  Config.AppId);
        Long timestamp = System.currentTimeMillis() / 1000;
        data.put("timestamp", timestamp.toString());
        data.put("seller_nick", Config.DDSellerNick);
        long start = System.currentTimeMillis() / 1000 - 3600 * 24 * 30 ;
        long end = System.currentTimeMillis() / 1000;
        data.put("create_time_start", String.valueOf(start));
        data.put("create_time_end", String.valueOf(end));
        data.put("status", "0");
        data.put("check_status", "3");
        data.put("product_type", "0");
        data.put("start_time", start);
        data.put("end_time", end);
        data.put("update_start_time", start);
        data.put("update_end_time", end);
        data.put("page", "1");
        data.put("size", "10");
//        data.put("store_id", "123456");
//        data.put("name", "标题");
        data.put("use_cursor", "false");
//        data.put("cursor_id", "WzE2ODI1Nzc4MjksMTc2NDMxMDczMDU3MDg0M10=");
        data.put("can_combine_product", "true");
        data.put("lookup_option", "{\n" +
                "        \"need_name_affix\": \"true\",\n" +
                "                \"need_title_limit\": \"true\"\n" +
                "    }");
        data.put("product_id", "[]");
        data.put("sign", Sign(data,Config.AppSecret));
        // 调用服务API
        String resp = doHttpRequest(Config.DDProductListV2, data);
        System.out.println(resp);
    }

3. 返回结果如下:


{
    "code": 0,
    "message": "ok",
    "data": {
        "cursor_id": "",
        "data": [
      {
        "can_combine": "false",
        "can_not_combine_reason": "已参加搭配",
        "category_detail": {
          "first_cid": "20117",
          "first_cname": "本地生活服务",
          "fourth_cid": "31800",
          "fourth_cname": "咖啡",
          "second_cid": "22139",
          "second_cname": "餐饮美食卡券",
          "third_cid": "28901",
          "third_cname": "甜品/冰淇淋/咖啡/冷饮"
        },
        "channel_main_product": {
          "product_id": "3570226807****00909",
          "shop_id": "90**9"
        },
        "check_status": "2",
        "cos_ratio": "0",
        "create_time": "1619160933",
        "description": "<p><img src=\\\"https://p3-aio.ecombdimg.com/obj/ecom-shop-material/v1_xPfNJOkX_71153427046487984750183_661ff1f563801d97f382e0ac114a09e6_sx_805824_www933-933\\\" style=\\\"max-width:100%;\\\"/><img src=\\\"https://p3-aio.ecombdimg.com/obj/ecom-shop-material/v1_xPfNJOkX_71153426724709337920183_dd825b6f3c1bc43ec26faea488447709_sx_1059417_www1080-933\\\" style=\\\"max-width:100%;\\\"/><img src=\\\"https://p3-aio.ecombdimg.com/obj/ecom-shop-material/v1_xPfNJOkX_71153465487927217040183_d963cc36ef6e66c0cba70e4cb2188f88_sx_436442_www1920-1080\\\" style=\\\"max-width:100%;\\\"/></p>",
        "discount_price": "100",
        "extra": "{\\\"category_detail\\\":{\\\"first_cid\\\":20117,\\\"second_cid\\\":22139,\\\"third_cid\\\":28901,\\\"fourth_cid\\\":31800,\\\"first_cname\\\":\\\"本地生活服务\\\",\\\"second_cname\\\":\\\"餐饮美食卡券\\\",\\\"third_cname\\\":\\\"甜品/冰淇淋/咖啡/冷饮\\\",\\\"fourth_cname\\\":\\\"咖啡\\\",\\\"is_leaf\\\":true},\\\"class_quality\\\":\\\"\\\",\\\"is_publish\\\":1,\\\"quality_opId\\\":\\\"7132044312682119463\\\",\\\"quality_report\\\":\\\"\\\"}",
        "img": "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/v1_xPfNJOkX_71153427046487984750183_661ff1f563801d97f382e0ac114a09e6_sx_805824_www933-933",
        "is_package_product": "true",
        "market_price": "200",
        "mobile": "022234455561233",
        "name": "夏季男生白色短袖",
        "name_prefix": "略",
        "name_suffix": "略",
        "out_product_id": "1617004369",
        "outer_product_id": "dy001",
        "package_product_list": "[3472490447010721067]",
        "pay_type": "1",
        "product_id": "3472490447010721067",
        "product_type": "0",
        "recommend_remark": "【已废弃】",
        "sell_num": "999",
        "shop_category": {
          "leaf_category_ids": "[123]"
        },
        "spec_id": "1737144307943485",
        "status": "0",
        "sub_product_list": "[3472490447010721067]",
        "title_limit": {
          "max_length": "60",
          "min_length": "0"
        },
        "update_time": "1619161933"
      }
    ],
        "page": 1,
        "size": 10,
        "total": 0
    }
}

说明: code为0表示成功,非0为失败,message会包含失败原因。返回字段说明见文档
https://op.jinritemai.com/docs/api-docs/14/633

文档更新时间: 2024-05-22 14:16   作者:JSL