有赞新零售社区

发帖
API使用问题»查询用户优惠券结果不正确

[API调用-商品/交易] 查询用户优惠券结果不正确

Ivan Wang 2022-08-31 1132 浏览 1 评论 | 只看楼主 [打印]
应用名称:「UpToDate临床顾问云测试店铺dPonC]                应用AppId:「7379791720118

                ClientId:「123d950b9529f18d16」 店铺编号【547612086
                相关文档地址:「https://doc.youzanyun.com/detail/API/0/830
                问题描述:「当我填入参数,并获取结果。 该用户在测试店铺 (云测试店铺dPonC)里有6张优惠券,使用了2张。 但使用该接口获取的接口却是显示为0。」
                trace_id:「yz7-0ad26a54-1661912233087-504758」
                日志:「{"total":0,"trace_id":"yz7-0ad26a54-1661912233087-504758","code":200,"data":[],"success":true,"page_num":1,"message":"successful","page_size":20}」
                截图/视频:「如附件」
                三方系统:「系统打通」
                店铺Id:「云测试店铺dPonC
                店铺名称:「91720118

本帖最后由 Ivan Wang 于 2022-8-31 10:46 编辑
用手机打开
收藏 ··· 回复
    Ivan Wang 青铜   2022-08-31 | 只看该作者
    追加我的请求参数:

    {"status":1 , "mobile":13880074647,' "fans_id":1333417612,"fans_type":9, "yz_open_id":"WyqNnIx3608001239971540992","page_size":20,"page_num":1,"activity_type_group":1}
    • 冬日暖阳 2022-08-31
      您好,后台正在调查,请耐心等待
    • 冬日暖阳 2022-08-31
      您好,尝试一下只加这几个参数看看能不能有值"yz_open_id":"WyqNnIx3608001239971540992","page_size":20,"page_num":1
    • Ivan Wang 回复 y 2022-08-31
      尝试了2次,第一次使用你给的参数,提示{"trace_id":"yz7-0ad26a52-1661926633789-993557","code":161201012,"data":[],"success":false,"message":"activityTypeGroup不能为null"}
      第二次加上 activityTypeGroup : {"total":0,"trace_id":"yz7-0ad26a54-1661926688391-756377","code":200,"data":[],"success":true,"page_num":1,"message":"successful","page_size":20}
    • 冬日暖阳 回复 Ivan Wang 2022-08-31
      您好,"yz_open_id":481811866这个有赞openId传成了userId了
    • Ivan Wang 回复 y 2022-08-31
      Hi,我不是很明白您的意思, yz_open_id 是根据有赞推送的交易支付接口 TRADE_PAID
      字符串获取的。
      我刚才将 "yz_open_id":481811866 替换了 "yz_open_id":"WyqNnIx3608001239971540992" .发送的参数为: {"yz_open_id":481811866,"page_size":20,"page_num":1,"activity_type_group":1}  获取到的结果是{"gw_err_resp":{"trace_id":"yz7-0ad26a58-1661932674117-401598","err_msg":"openid不存在","err_code":4009}} 。。
    • Ivan Wang 回复 y 2022-08-31
      {"msg":"%7B%22delivery_order%22%3A%5B%5D%2C%22order_promotion%22%3A%7B%22item%22%3A%5B%5D%2C%22adjust_fee%22%3A%220.00%22%2C%22order%22%3A%5B%5D%7D%2C%22refund_order%22%3A%5B%5D%2C%22full_order_info%22%3A%7B%22address_info%22%3A%7B%22self_fetch_info%22%3A%22%22%2C%22delivery_address%22%3A%22%22%2C%22delivery_postal_code%22%3A%22%22%2C%22receiver_name%22%3A%22%22%2C%22delivery_province%22%3A%22%22%2C%22delivery_city%22%3A%22%22%2C%22address_extra%22%3A%22%7B%7D%22%2C%22delivery_district%22%3A%22%22%2C%22receiver_tel%22%3A%22%22%7D%2C%22remark_info%22%3A%7B%22buyer_message%22%3A%22%22%7D%2C%22pay_info%22%3A%7B%22outer_transactions%22%3A%5B%224200001554202208108396689835%22%5D%2C%22post_fee%22%3A%220.00%22%2C%22total_fee%22%3A%220.01%22%2C%22payment%22%3A%220.01%22%2C%22transaction%22%3A%5B%222208101015080004570894%22%5D%7D%2C%22buyer_info%22%3A%7B%22outer_user_id%22%3A%22oHIuujr-30fD9iKoaVBo9Y33NLug%22%2C%22buyer_phone%22%3A%2213880074647%22%2C%22yz_open_id%22%3A%22WyqNnIx3608001239971540992%22%2C%22fans_type%22%3A9%2C%22buyer_id%22%3A481811866%2C%22fans_nickname%22%3A%22%E8%81%AA%E6%98%8E%E5%8B%87%E6%95%A2%E6%9C%89%E5%8A%9B%E6%B0%94%22%2C%22fans_id%22%3A1333417612%7D%2C%22orders%22%3A%5B%7B%22is_cross_border%22%3A%22%22%2C%22outer_item_id%22%3A%22%22%2C%22discount_price%22%3A%220.01%22%2C%22item_type%22%3A208%2C%22num%22%3A1%2C%22oid%22%3A%222889082517205680137%22%2C%22title%22%3A%22%E4%BB%98%E8%B4%B9%E4%BC%98%E6%83%A0%E5%88%B8%22%2C%22fenxiao_payment%22%3A%220.00%22%2C%22item_message%22%3A%22%22%2C%22item_no%22%3A%22%22%2C%22buyer_messages%22%3A%22%22%2C%22cross_border_trade_mode%22%3A%22%22%2C%22is_present%22%3Afalse%2C%22sub_order_no%22%3A%22%22%2C%22price%22%3A%220.01%22%2C%22fenxiao_price%22%3A%220.00%22%2C%22total_fee%22%3A%220.01%22%2C%22alias%22%3A%222ot4umuzm8qpy4p%22%2C%22payment%22%3A%220.01%22%2C%22item_barcode%22%3A%22%22%2C%22outer_sku_id%22%3A%22%22%2C%22goods_url%22%3A%22https%3A%2F%2Fh5.youzan.com%2Fv2%2Fshowcase%2Fgoods%3Falias%3D2ot4umuzm8qpy4p%22%2C%22customs_code%22%3A%22%22%2C%22item_id%22%3A1753938053%2C%22sku_properties_name%22%3A%22%5B%5D%22%2C%22sku_id%22%3A0%2C%22pic_path%22%3A%22https%3A%2F%2Fimg01.yzcdn.cn%2Fupload_files%2F2021%2F05%2F31%2FFsYog7gC3BD0K4pPDmDuTu7tdHbr.jpg%22%2C%22sku_no%22%3A%22%22%2C%22points_price%22%3A%220%22%2C%22sku_barcode%22%3A%22%22%7D%5D%2C%22source_info%22%3A%7B%22is_offline_order%22%3Afalse%2C%22book_key%22%3A%22d9b3fbcc-5cb9-4a69-b534-c0b34e4c6080%22%2C%22source%22%3A%7B%22platform%22%3A%22wx%22%2C%22wx_entrance%22%3A%22direct_buy%22%7D%7D%2C%22order_info%22%3A%7B%22consign_time%22%3A%22%22%2C%22order_extra%22%3A%7B%22is_from_cart%22%3A%22false%22%2C%22is_points_order%22%3A%220%22%7D%2C%22created%22%3A%222022-08-10+10%3A15%3A08%22%2C%22status_str%22%3A%22%E5%B7%B2%E6%94%AF%E4%BB%98%22%2C%22expired_time%22%3A%222022-08-10+11%3A15%3A08%22%2C%22success_time%22%3A%22%22%2C%22type%22%3A0%2C%22confirm_time%22%3A%22%22%2C%22tid%22%3A%22E20220810101508041006153%22%2C%22pay_time%22%3A%222022-08-10+10%3A15%3A15%22%2C%22update_time%22%3A%222022-08-10+10%3A15%3A15%22%2C%22is_retail_order%22%3Afalse%2C%22team_type%22%3A0%2C%22pay_type%22%3A10%2C%22refund_state%22%3A0%2C%22close_type%22%3A0%2C%22order_tags%22%3A%7B%22is_virtual%22%3Atrue%2C%22is_secured_transactions%22%3Atrue%2C%22is_payed%22%3Atrue%7D%2C%22express_type%22%3A9%2C%22status%22%3A%22TRADE_PAID%22%7D%7D%7D","kdt_name":"云测试店铺dPonC","test":false,"sign":"a2fb941bb07fac5e810e8899672b0e5d","sendCount":1,"type":"trade_TradePaid","version":1660097715,"client_id":"123d950b9529f18d16","mode":1,"kdt_id":91720118,"id":"E20220810101508041006153","msg_id":"8c6f891b-3378-4ba3-ad70-75e504da018a","root_kdt_id":91720118,"status":"TRADE_PAID"}
    • 冬日暖阳 回复 Ivan Wang 2022-09-01
      您好,请稍等,我们正在调查
    • Ivan Wang 回复 y 2022-09-01
      你好,请问有什么结果了吗?
    • 冬日暖阳 回复 Ivan Wang 2022-09-02
      您好,activity_type_group":1,"page_num":1,"yz_open_id":481811866,"page_size":20目前查到,yz_open_id没有纯数字的,如果方便可以把解密过的推送消息发一下。如果是纯数字的可以尝试下,调接口时传入user_Id字段,看下是否能行
    • Ivan Wang 回复 y 2022-09-02
      请问是不是有什么误会?我咨询的接口是 youzan.ump.voucher.query.3.0.0
      https://doc.youzanyun.com/detail/API/0/830 里面没有你说的参数retail_param。 而你给我的API 链接 是 商品新增接口 。
      我的业务场景是:在售卖代金券后根据有赞推送 TRADE_PAID 字符串中的信息,去获取查询客户获得的优惠券: 根据状态查询用户优惠券/优惠码列表 ;
      现在所面临的问题是: 我通过 有赞API : 根据状态查询用户优惠券/优惠码列表 接口。 无法正确获取到店铺中用户的优惠券数量和状态。 请问我表述的是否清晰, 如果有什么问题,请告诉我,谢谢
    • 冬日暖阳 回复 Ivan Wang 2022-09-02
      您好,回答已更新,麻烦您再看一下
    • Ivan Wang 回复 y 2022-09-02
      Hi,您好, 我添加上了user_Id。 获得的参数 {"total":0,"trace_id":"yz7-0ad26a52-1662085093194-285706","code":200,"data":[],"success":true,"page_num":1,"message":"successful","page_size":20} 。

      我请求的参数是 {"yz_open_id":"WyqNnIx3608001239971540992","page_size":20,"page_num":1,"activity_type_group":1,"user_Id":481811866}
      关于您说将推送的信息发送给您, 我已经将推送的Json 放在了回复贴中。 为方便您的对照。 我将再次将推送内容放在这里:{"msg":"%7B%22delivery_order%22%3A%5B%5D%2C%22order_promotion%22%3A%7B%22item%22%3A%5B%5D%2C%22adjust_fee%22%3A%220.00%22%2C%22order%22%3A%5B%5D%7D%2C%22refund_order%22%3A%5B%5D%2C%22full_order_info%22%3A%7B%22address_info%22%3A%7B%22self_fetch_info%22%3A%22%22%2C%22delivery_address%22%3A%22%22%2C%22delivery_postal_code%22%3A%22%22%2C%22receiver_name%22%3A%22%22%2C%22delivery_province%22%3A%22%22%2C%22delivery_city%22%3A%22%22%2C%22address_extra%22%3A%22%7B%7D%22%2C%22delivery_district%22%3A%22%22%2C%22receiver_tel%22%3A%22%22%7D%2C%22remark_info%22%3A%7B%22buyer_message%22%3A%22%22%7D%2C%22pay_info%22%3A%7B%22outer_transactions%22%3A%5B%224200001554202208108396689835%22%5D%2C%22post_fee%22%3A%220.00%22%2C%22total_fee%22%3A%220.01%22%2C%22payment%22%3A%220.01%22%2C%22transaction%22%3A%5B%222208101015080004570894%22%5D%7D%2C%22buyer_info%22%3A%7B%22outer_user_id%22%3A%22oHIuujr-30fD9iKoaVBo9Y33NLug%22%2C%22buyer_phone%22%3A%2213880074647%22%2C%22yz_open_id%22%3A%22WyqNnIx3608001239971540992%22%2C%22fans_type%22%3A9%2C%22buyer_id%22%3A481811866%2C%22fans_nickname%22%3A%22%E8%81%AA%E6%98%8E%E5%8B%87%E6%95%A2%E6%9C%89%E5%8A%9B%E6%B0%94%22%2C%22fans_id%22%3A1333417612%7D%2C%22orders%22%3A%5B%7B%22is_cross_border%22%3A%22%22%2C%22outer_item_id%22%3A%22%22%2C%22discount_price%22%3A%220.01%22%2C%22item_type%22%3A208%2C%22num%22%3A1%2C%22oid%22%3A%222889082517205680137%22%2C%22title%22%3A%22%E4%BB%98%E8%B4%B9%E4%BC%98%E6%83%A0%E5%88%B8%22%2C%22fenxiao_payment%22%3A%220.00%22%2C%22item_message%22%3A%22%22%2C%22item_no%22%3A%22%22%2C%22buyer_messages%22%3A%22%22%2C%22cross_border_trade_mode%22%3A%22%22%2C%22is_present%22%3Afalse%2C%22sub_order_no%22%3A%22%22%2C%22price%22%3A%220.01%22%2C%22fenxiao_price%22%3A%220.00%22%2C%22total_fee%22%3A%220.01%22%2C%22alias%22%3A%222ot4umuzm8qpy4p%22%2C%22payment%22%3A%220.01%22%2C%22item_barcode%22%3A%22%22%2C%22outer_sku_id%22%3A%22%22%2C%22goods_url%22%3A%22https%3A%2F%2Fh5.youzan.com%2Fv2%2Fshowcase%2Fgoods%3Falias%3D2ot4umuzm8qpy4p%22%2C%22customs_code%22%3A%22%22%2C%22item_id%22%3A1753938053%2C%22sku_properties_name%22%3A%22%5B%5D%22%2C%22sku_id%22%3A0%2C%22pic_path%22%3A%22https%3A%2F%2Fimg01.yzcdn.cn%2Fupload_files%2F2021%2F05%2F31%2FFsYog7gC3BD0K4pPDmDuTu7tdHbr.jpg%22%2C%22sku_no%22%3A%22%22%2C%22points_price%22%3A%220%22%2C%22sku_barcode%22%3A%22%22%7D%5D%2C%22source_info%22%3A%7B%22is_offline_order%22%3Afalse%2C%22book_key%22%3A%22d9b3fbcc-5cb9-4a69-b534-c0b34e4c6080%22%2C%22source%22%3A%7B%22platform%22%3A%22wx%22%2C%22wx_entrance%22%3A%22direct_buy%22%7D%7D%2C%22order_info%22%3A%7B%22consign_time%22%3A%22%22%2C%22order_extra%22%3A%7B%22is_from_cart%22%3A%22false%22%2C%22is_points_order%22%3A%220%22%7D%2C%22created%22%3A%222022-08-10+10%3A15%3A08%22%2C%22status_str%22%3A%22%E5%B7%B2%E6%94%AF%E4%BB%98%22%2C%22expired_time%22%3A%222022-08-10+11%3A15%3A08%22%2C%22success_time%22%3A%22%22%2C%22type%22%3A0%2C%22confirm_time%22%3A%22%22%2C%22tid%22%3A%22E20220810101508041006153%22%2C%22pay_time%22%3A%222022-08-10+10%3A15%3A15%22%2C%22update_time%22%3A%222022-08-10+10%3A15%3A15%22%2C%22is_retail_order%22%3Afalse%2C%22team_type%22%3A0%2C%22pay_type%22%3A10%2C%22refund_state%22%3A0%2C%22close_type%22%3A0%2C%22order_tags%22%3A%7B%22is_virtual%22%3Atrue%2C%22is_secured_transactions%22%3Atrue%2C%22is_payed%22%3Atrue%7D%2C%22express_type%22%3A9%2C%22status%22%3A%22TRADE_PAID%22%7D%7D%7D","kdt_name":"云测试店铺dPonC","test":false,"sign":"a2fb941bb07fac5e810e8899672b0e5d","sendCount":1,"type":"trade_TradePaid","version":1660097715,"client_id":"123d950b9529f18d16","mode":1,"kdt_id":91720118,"id":"E20220810101508041006153","msg_id":"8c6f891b-3378-4ba3-ad70-75e504da018a","root_kdt_id":91720118,"status":"TRADE_PAID"}
    • 冬日暖阳 回复 Ivan Wang 2022-09-02
      您好,可以尝试一下这么传activity_type_group":1,"user_Id":481811866,"page_num":1,page_size":20,可以把解密过的发过来吗,我们这没有办法解密,如果我们看到解密后的推送消息还是没发现问题,我们将询问后台,请您耐心等待。
    • Ivan Wang 回复 y 2022-09-02
      你说的解密是这样?
      {
          "msg":{
              "delivery_order":[

              ],
              "order_promotion":{
                  "item":[

                  ],
                  "adjust_fee":"0.00",
                  "order":[

                  ]
              },
              "refund_order":[

              ],
              "full_order_info":{
                  "address_info":{
                      "self_fetch_info":"",
                      "delivery_address":"",
                      "delivery_postal_code":"",
                      "receiver_name":"",
                      "delivery_province":"",
                      "delivery_city":"",
                      "address_extra":"{}",
                      "delivery_district":"",
                      "receiver_tel":""
                  },
                  "remark_info":{
                      "buyer_message":""
                  },
                  "pay_info":{
                      "outer_transactions":[
                          "4200001554202208108396689835"
                      ],
                      "post_fee":"0.00",
                      "total_fee":"0.01",
                      "payment":"0.01",
                      "transaction":[
                          "2208101015080004570894"
                      ]
                  },
                  "buyer_info":{
                      "outer_user_id":"oHIuujr-30fD9iKoaVBo9Y33NLug",
                      "buyer_phone":"13880074647",
                      "yz_open_id":"WyqNnIx3608001239971540992",
                      "fans_type":9,
                      "buyer_id":481811866,
                      "fans_nickname":"聪明勇敢有力气",
                      "fans_id":1333417612
                  },
                  "orders":[
                      {
                          "is_cross_border":"",
                          "outer_item_id":"",
                          "discount_price":"0.01",
                          "item_type":208,
                          "num":1,
                          "oid":"2889082517205680137",
                          "title":"付费优惠券",
                          "fenxiao_payment":"0.00",
                          "item_message":"",
                          "item_no":"",
                          "buyer_messages":"",
                          "cross_border_trade_mode":"",
                          "is_present":false,
                          "sub_order_no":"",
                          "price":"0.01",
                          "fenxiao_price":"0.00",
                          "total_fee":"0.01",
                          "alias":"2ot4umuzm8qpy4p",
                          "payment":"0.01",
                          "item_barcode":"",
                          "outer_sku_id":"",
                          "goods_url":"https://h5.youzan.com/v2/showcase/goods?alias=2ot4umuzm8qpy4p",
                          "customs_code":"",
                          "item_id":1753938053,
                          "sku_properties_name":"[]",
                          "sku_id":0,
                          "pic_path":"https://img01.yzcdn.cn/upload_files/2021/05/31/FsYog7gC3BD0K4pPDmDuTu7tdHbr.jpg",
                          "sku_no":"",
                          "points_price":"0",
                          "sku_barcode":""
                      }
                  ],
                  "source_info":{
                      "is_offline_order":false,
                      "book_key":"d9b3fbcc-5cb9-4a69-b534-c0b34e4c6080",
                      "source":{
                          "platform":"wx",
                          "wx_entrance":"direct_buy"
                      }
                  },
                  "order_info":{
                      "consign_time":"",
                      "order_extra":{
                          "is_from_cart":"false",
                          "is_points_order":"0"
                      },
                      "created":"2022-08-10+10:15:08",
                      "status_str":"已支付",
                      "expired_time":"2022-08-10+11:15:08",
                      "success_time":"",
                      "type":0,
                      "confirm_time":"",
                      "tid":"E20220810101508041006153",
                      "pay_time":"2022-08-10+10:15:15",
                      "update_time":"2022-08-10+10:15:15",
                      "is_retail_order":false,
                      "team_type":0,
                      "pay_type":10,
                      "refund_state":0,
                      "close_type":0,
                      "order_tags":{
                          "is_virtual":true,
                          "is_secured_transactions":true,
                          "is_payed":true
                      },
                      "express_type":9,
                      "status":"TRADE_PAID"
                  }
              }
          },
          "kdt_name":"云测试店铺dPonC",
          "test":false,
          "sign":"a2fb941bb07fac5e810e8899672b0e5d",
          "sendCount":1,
          "type":"trade_TradePaid",
          "version":1660097715,
          "client_id":"123d950b9529f18d16",
          "mode":1,
          "kdt_id":91720118,
          "id":"E20220810101508041006153",
          "msg_id":"8c6f891b-3378-4ba3-ad70-75e504da018a",
          "root_kdt_id":91720118,
          "status":"TRADE_PAID"
      }
    • 冬日暖阳 回复 Ivan Wang 2022-09-02
      您好,activity_type_group":1,"user_Id":481811866,"page_num":1,page_size":20
      activity_type_group":1,"yz_open_id":"WyqNnIx3608001239971540992","page_num":1,page_size":20
      activity_type_group":1,"mobile":"13880074647","page_num":1,page_size":20
      试一下这几种参数组合,这几种都可以定位到唯一的购买人。如果都尝试过后不行的话将询问后台接口同学
    • Ivan Wang 回复 y 2022-09-02
      能否请询问下你们后台。你给的参数 user_Id 在这个接口文档没有描述,也没有要求。 按照你给的参数请求,也直接显示请求参数不全。 {"gw_err_resp":{"trace_id":"yz7-0ad26a52-1662103283666-660361","err_msg":"非法的Content","err_code":4004}}.
    • 冬日暖阳 回复 Ivan Wang 2022-09-02
      您好,报错是因为user_id(i大写了),(activity_type_group":1,"yz_open_id":"WyqNnIx3608001239971540992","page_num":1,page_size":20)

      (activity_type_group":1,"mobile":"13880074647","page_num":1,page_size":20)您尝试下这两种参数,请您检查好参数,字段名不能错
    • Ivan Wang 回复 y 2022-09-03
      你好,非常感谢你的回复和帮助, 你提供的参数以及建议,我分别以如下参数进行尝试和得到结果
      1.
      "yz_open_id":"WyqNnIx3608001239971540992","page_size":20,"page_num":1,"activity_type_group":1,"user_id":481811866

      {"total":0,"trace_id":"yz7-0ad26a52-1662107888840-528404","code":200,"data":[],"success":true,"page_num":1,"message":"successful","page_size":20}

      2. {activity_type_group":1,"mobile":"13880074647","page_num":1,page_size":20}

      {"gw_err_resp":{"trace_id":"yz7-0ad26a5f-1662107955135-776220","err_msg":"非法的Content","err_code":4004}}

      3. {"activity_type_group":1,"mobile":"13880074647","page_num":1,page_size":20,"user_id":481811866}
      {"gw_err_resp":{"trace_id":"yz7-0ad26a5f-1662108051247-862489","err_msg":"非法的Content","err_code":4004}}

      这里再次对你的帮助表达感谢,不过我的疑问是,我已经提供了我所使用的参数以及参数解析结果。 能否请你们先尝试一下是否能有正确结果?而不是我单方面的尝试不同参数和回复结果,你们所需要的trace_id 我也每条都有提供。



    • 冬日暖阳 回复 Ivan Wang 2022-09-03
      您好,我们会问下后台用这几个参数能否获取到优惠券,请您耐心等待
    • 冬日暖阳 回复 Ivan Wang 2022-09-05
      您好,您的用户ID查询就是没有优惠券确认下发券 和 查询优惠券 的用户ID是否匹配
    加载更多

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

    本版积分规则

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

    • 评分

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

    复制成功