有赞新零售社区

发帖
API使用问题»通过root_item_id找不到对应的总部商品item_id,怎么对应呢

[API调用-商品/交易] 通过root_item_id找不到对应的总部商品item_id,怎么对应呢

xxl 2023-09-27 1246 浏览 3 评论 | 只看楼主 [打印]
门店商品:api/youzan.item.search/3.0.0?access_token=d602f57fb93f0ad7e62b464e4cd48c6
{
    "page_size":50,
    "channel":-1,
    "show_sold_out":2,
    "order_by":"sku_update_time:desc",
    "q":"不用动222"
}
返回
{
    "trace_id": "yz7-0ae85b73-1695726741891-820463",
    "code": 200,
    "data": {
        "count": 1,
        "items": [
            {
                "page_url": "packages/goods/detail/index",
                "detail_url": "https://h5.youzan.com/v2/showcase/goods?alias=2xasuwejxpyab1k",
                "share_detail": 100,
                "post_fee": 0,
                "item_type": 0,
                "num": 0,
                "origin": "",
                "channel": 1,
                "title": "许晓龙新建 不用动222",
                "item_no": "BM230926432056067",
                "update_time": "2023-09-26 19:04:04",
                "price": 100,
                "alias": "2xasuwejxpyab1k",
                "post_type": 1,
                "meas_prop": {
                    "meas": []
                },
                "created_time": "2023-09-26 19:00:55",
                "image": "https://img.yzcdn.cn/upload_files/2020/05/19/FhO5Y19m1QWzD_FXF3lxF8IllIgN.png?imageView2/0/w/240/h/240/q/75",
                "tag_ids": [
                    250642731
                ],
                "sub_title": "",
                "quantity": 0,
                "item_id": 3461499870,
                "item_imgs": [
                    {
                        "thumbnail": "https://img.yzcdn.cn/upload_files/2020/05/19/FhO5Y19m1QWzD_FXF3lxF8IllIgN.png?imageView2/2/w/290/h/290/q/75/format/jpg",
                        "created": "2023-09-26 19:12:22",
                        "medium": "https://img.yzcdn.cn/upload_files/2020/05/19/FhO5Y19m1QWzD_FXF3lxF8IllIgN.png?imageView2/2/w/600/h/0/q/75/format/jpg",
                        "url": "https://img.yzcdn.cn/upload_files/2020/05/19/FhO5Y19m1QWzD_FXF3lxF8IllIgN.png",
                        "combine": "https://img.yzcdn.cn/upload_files/2020/05/19/FhO5Y19m1QWzD_FXF3lxF8IllIgN.png?imageView2/2/w/600/h/0/q/75/format/jpg"
                    }
                ],
                "group_names": [
                    "水果"
                ],
                "has_multi_sku": false,
                "share_icon": "https://img.yzcdn.cn/upload_files/2020/05/19/FhO5Y19m1QWzD_FXF3lxF8IllIgN.png?imageView2/0/w/240/h/240/q/75",
                "classid": "youzan_goods_selling",
                "item_source": 0,
                "actual_quantity": "0.0",
                "share_title": "许晓龙新建 不用动222",
                "sku_extension_attributes": [
                    {
                        "sku_id": 14328144157
                    }
                ],
                "root_item_id": 2720736383,
                "delivery_template": {},
                "root_kdt_id": 140980410,
                "properties": {
                    "publics": [],
                    "privates": []
                },
                "video_id": 0
            }

    },
    "success": true,
    "message": "successful"
}

root_item_id 为2720736383
但是总部 api/youzan.item.detail.get/1.0.0?access_token=9fa929c444b4be3bf00749c9aa74495
{   
    "kdt_id":140980410,
    "item_id":2720736383
}
返回
{
    "trace_id": "yz7-0ae85bdb-1695726867593-339973",
    "code": 120007201,
    "data": {
        "size_group": {
            "sizes": []
        },
        "images": [],
        "channels": [],
        "sku_list": [],
        "category_properties": {
            "publics": [],
            "privates": []
        },
        "messages": [],
        "sku_value_props": [],
        "item_props": []
    },
    "success": false,
    "message": "非主档(总部网店)商品id"
}
















用手机打开
收藏 ··· 回复
    smile   黄金   2023-09-27 | 只看该作者
    您好,根据您提供的trace_id :yz7-0ae85b73-1695726741891-820463 排查到您调用接口:youzan.item.search.3.0.0使用的access_token是门店(北京大兴荟聚门店)的token,那么查询出来的item_id 是门店的item_id .不是总部的。

    如果您想要使用目前的接口youzan.item.search.3.0.0查询到总部的item_id ,那么需要使用总部的kdt_id 生成的access_token ,您的总部店铺为当红齐天。

    这边建议您可以使用https://doc.youzanyun.com/detail/API/0/3561 接口来查询。这样您使用总店的access_token 既可以查到root_item_id 也可以查到分店的item_id ,比较方便
    • xxl 2023-09-27
      你可能没理解我的意思,我是查询门店是商品,然后根据门店商品的root_item_id去总部查询总部对应的商品,但是现在是查询不到,你的接口的数据没有对应上呢?用门店是root_item_id去总部查询报非主档(总部网店)商品id
    • xxl 2023-09-27
      你好,有回复了吗

    1跳至
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    复制链接
    新浪微博
    QQ空间
    微信扫码
    • 回复

    • 评分

    客服工作时间是9:00-18:00,客服妹子当前不在线,若不能及时回复请谅解。试试右上角的搜索吧,论坛有丰富的经验贴、公告贴,相信一定能够帮到您~

    复制成功