电子面单云打印更新接口
商家更新电子面单号对应的面单信息。
1.请求参数
请求URL:
POST https://kf.fw199.com/gateway/taobao/cainiao/waybill/update
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
appid | String | 合作伙伴AppId | uwkahf@jfs92 |
timestamp | String | 当前时间戳 | |
tb_seller_nick | String | 淘宝卖家店铺登录账号,非店铺名称 | kingdo |
request_data | json | 要更新的电子面单信息 | |
sign | String | 接口签名 | 如何计算生成见示例代码 |
2. 请求示例代码(Java)
@Test
public void getCaiNiaoWayBillUpdate() throws Exception {
String tb_seller_nick = Config.TBSellerNick;
String reqeustData = "{ " +
" \"cp_code\": \"POSTB\"," +
" \"logistics_services\": \"\"," +
" \"object_id\": \"473184714813813\"," +
" \"package_info\": { " +
" \"items\": [{" +
" \"count\": 1," +
" \"name\": \"赠品:XXXX\"" +
" }]," +
" \"volume\": 1," +
" \"weight\": 1" +
" }," +
" \"recipient\": {" +
" \"address\": {" +
" \"city\": \"广州市\"," +
" \"detail\": \"凤凰城1121-13号\"," +
" \"district\": \"白云区\"," +
" \"province\": \"广东省\"" +
" }," +
" \"mobile\": \"15378197532\"," +
" \"name\": \"朱德新\"," +
" \"phone\": \"\"," +
" \"caid\" : \"\"," +
" \"oaid\" : \"\"" +
" }," +
" \"sender\": { " +
" \"mobile\": \"18666072377\"," +
" \"name\": \"罗生\"," +
" \"phone\": \"\"" +
" }, " +
" \"template_url\": \"http://cloudprint.cainiao.com/template/standard/304351/5\"," +
" \"waybill_code\": \"9883698891776\"" +
" " +
" }";
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
data.put("tb_seller_nick", tb_seller_nick);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
data.put("request_data", reqeustData);
data.put("sign", Utils.Sign(data, Config.AppSecret));
String resp = doHttpRequest(Config.TaoBaoCaiNiaoWayBillUpateUrl, data);
}
上面requestData的参数说明见文档
3. 返回结果如下(部分数据):
{
"code": 0,
"message": "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gbwOCwr+SNlIg0lUnVKC6Ky1wM8FV1hQQFUsT6GTzAyzrBEJiBO92j1r1CtkKvh6RrdNCV+aRPLnHHNHlt9PjDnBB4CR5eWXCbeC6zisLXz9xop1DOohq+Tdthxx/AGJ9j7jwkouq4okppkZCN46Cr+vj4cGAtE/vNXSu7PDzk/tNyOLsgUc7UgWs0booiPJ83zJS6bI2NQyi3zddibEm22fP4JGgFRS9R16dNMpGR1SkiCiZvM1PtfWkZZnMLxPjVtRoeCedbva7Wg=\",\"signature\":\"MD:yctbIZLOn35Fa5jYcorZsQ==\",\"templateURL\":\"http://cloudprint.cainiao.com/template/standard/304351\",\"ver\":\"waybill_print_secret_version_1\"}",
"waybill_code": "9883698891776"
},
"trace_id": ""
}
说明: code为0表示成功 非0为失败,失败时message包含错误的详细信息。
文档更新时间: 2023-03-14 16:31 作者:admin