查询商家订购情况
查询商家是否订购了应用情况 。
一、请求参数
| 参数名 | 类型 | 说明 | 示例 |
|---|---|---|---|
| appid | String | 合作伙伴AppId | uwkahf@jfs92 |
| timestamp | String | 当前时间戳 | |
| seller_nick | String | 淘宝或拼多多商家账号,注意要和channel参数匹配 | kingdo |
| channel | String | 订购平台, 1:淘宝, 2:拼多多, 3: 抖店, 4:京东 ,5:快手,6:1688 | 1 |
| sysid | String | 若有不清楚请联系客服! | 100 |
| sign | String | 接口签名 | 如何计算生成见示例代码 |
二、请求示例代码
Java
/** * 检查商家订购情况 * @throws Exception */ @Test public void PartnerSellerSubscribe() throws Exception {
String channel = "2"; // 淘宝/拼多多商家账号 String seller_nick = "pdd43901635752"; //业务参数 Map<String, String> data = new HashMap<String, String>(); data.put("appid", Config.AppId); Long timestamp = System.currentTimeMillis() / 1000; data.put("timestamp", timestamp.toString()); data.put("seller_nick", seller_nick); data.put("channel",channel); data.put("sysid","100"); // 签名 data.put("sign", Utils.Sign(data,Config.AppSecret)); // 调用服务API doHttpRequest(Config.PartnerSellerSubscribeUrl ,data);
}三、返回结果
{ "code": 0, "message": "ok", "data": { "dead_line": "2022-03-13 00:00:00", "is_valid": true, "granted": true, "need_op_reauth": false }, "trace_id": ""}说明: code为0表示成功,非0为失败,message会包含失败原因,其他字段说明:
| 参数名 | 类型 | 说明 | 建议处理 |
|---|---|---|---|
| dead_line | String | 订购到期时间 | 此字段仅参考,个别商家可能中间退款 |
| is_valid | bool | 订购是否在有效订购期内,即deadline是否在当前时间之后。 | 应用订购过期,重新订购应用服务。 |
| need_op_reauth | bool | true: 需要商家重新授权给应用,false: 应用授权正常。 | 如果返回true, 需要商家在电商平台打开订购的应用,重新登录应用首页。 |
| granted | bool | 是否已经授权给蜂巢开发者 ,true:表示商家已经授权蜂巢开发者,false:表示未授权给蜂巢开发者。 | 需要商家授权给您。 即网页跳转到让商家授权给您的页面 |