电子面单云打印更新接口
电子面单云打印更新接口
1.请求参数:
参数名 | 类型 | 说明 | 示例 |
---|---|---|---|
appid | String | 合作伙伴AppId | uwkahf@jfs92 |
timestamp | String | 当前时间戳 | |
seller_nick | String | 拼多多商家账号,非店铺名称 | kingdo |
sign | String | 接口签名 | 如何计算生成见示例代码 |
request_data | json | 更新电子面单的业务报文 |
更新电子面单的业务报文request_data的json格式如下:
{
"object_id": "1000",
"sender": {
"address": {
"city": "上海市",
"detail": "东方路7238",
"district": "浦东新区",
"province": "上海市",
"town": "陆家嘴街道"
},
"mobile": "13813122363",
"name": "陈先生",
"phone": ""
},
"package_info": {
"items": [{
"count": 1,
"name": "A4打印纸"
}],
"volume": 22,
"weight": 22
},
"recipient": {
"address": {
"city": "上海市",
"detail": "~AgAAAACjmWAIZ1vG5AGpNSXy3yNfQqkPwX83TI8H0IYyf0f3qi8Bdzs2b5nfKniLc2NBtLVUhUMWwHkN8dg==~4Uc5fqNUxr5Sntd4fXM7UZAPXpVNVVXr~1~~",
"district": "浦东新区",
"province": "上海市",
"town": "陆家嘴街道"
},
"mobile": "$WsuJt4Yh3K7a$AgAAAACjmWAGZ1vG5ABLUicfAzPuXzSdjyz1biPoE6E=$1$$",
"name": "~AgAAAACjmWAFZ1vG5ABcHJJv1G1LcKH2BRzsYjGe/s=~niqTGhCNifXk~1~~",
"phone": ""
},
"template_url": "https://file-link.pinduoduo.com/xlobo_std",
"waybill_code": "9866025654820",
"wp_code": "YZXB"
}
上述请求参数字段说明见此文档。
2. 请求示例代码(Java)
@Test
public void PddWayBillUpdate() throws Exception {
String seller_nick = Config.PddSellerNick ; // 拼多多卖家账号
//业务参数
Map<String, String> data = new HashMap<String, String>();
data.put("appid", Config.AppId);
data.put("seller_nick", seller_nick);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
String requestData = "{" +
" \"object_id\":\"1000\"," +
" \"sender\":{" +
" \"address\":{" +
" \"city\": \"上海市\", " +
" \"detail\": \"东方路7238\"," +
" \"district\": \"浦东新区\"," +
" \"province\": \"上海市\"," +
" \"town\":\"陆家嘴街道\"" +
" }," +
" " +
" \"mobile\":\"13813122363\"," +
" \"name\":\"陈先生\"," +
" \"phone\":\"\"" +
" }," +
" \"package_info\":{" +
" \"items\":[" +
" {" +
" \"count\":1," +
" \"name\":\"A4打印纸\"" +
" }" +
" ]," +
" \"volume\":22," +
" \"weight\":22" +
" }," +
" \"recipient\":{" +
" \"address\":{" +
" \"city\": \"上海市\", " +
" \"detail\": \"~AgAAAACjmWAIZ1vG5AG+pNSXy3yNfQqkPwX83TI8H0IYyf0f3qi8Bdzs2b5+nfKniLc2NB+tLVUhUMWwHkN8dg==~4Uc5fqNUxr5Sntd4fXM7UZAPXpVNVVXr~1~~\"," +
" \"district\": \"浦东新区\"," +
" \"province\": \"上海市\"," +
" \"town\":\"陆家嘴街道\"" +
" }," +
" \"mobile\":\"$WsuJt4Yh3K7a$AgAAAACjmWAGZ1vG5ABLUicfAzPuXzSdjyz1biPoE6E=$1$$\"," +
" \"name\":\"~AgAAAACjmWAFZ1vG5ABcHJJ+v1G1LcKH2BRzsYjGe/s=~niqTGhCNifXk~1~~\"," +
" \"phone\":\"\"" +
" }," +
" \"template_url\":\"https://file-link.pinduoduo.com/xlobo_std\"," +
" \"waybill_code\":\"9866025654820\" ," +
" \"wp_code\":\"YZXB\"" +"}";
data.put("request_data", requestData);
// 参数签名
data.put("sign", Utils.Sign(data,Config.AppSecret));
doHttpRequest(Config.PddWayBillUpdateUrl, data);
需要注意的是package_info中的id为包裹id ,请不要相同。
3. 返回结果如下:
{
"code": 0,
"message": "ok",
"data": {
"print_data": "{\"encryptedData\":\"a67d4819d0cd21554e9437e0bc2caa629864b0effd1aec65833023f78e93733ca9eec3468dc487b24682b9d64f176ca64ae77d4e5b440dde253ded6238cc08b6b195e93384bcb18984cd2f980317fafa8ae1cdc1bfd4f1a35437168d4b0913993fec5cf57bb6b16ffac84443b02e68e56909a3194debb36bbd4e826b162896c7b9d044adb57d2e4ed265e2a2110614ad1d1f4728339cdb09cb0f042b06cc7338591a13448eb3d9d328b915d29ac48ab1e305e527633915ed85be40945b26d27bde3b2fedc85accb6e3f6108fe6de1f2f864ca7a3ad929c9448ea63df15b7c4547270a210d91f437a06570a00b9c747fa331166c641b8ecfe4215b9b7b5f2a1244c6a652b54e0b5cf5a2f5bc6ff703c260afa58054b0e80e371216ad97d22d4ae3f53e7e1d512963f801f5d8d589099bd26f699bec0b7d86d6ee34b0f7b336c19a826de33a27c25e35d0c5011cf7ca70ee858075764a41e567374036cbadafbf07bf20318a262c1842f744e71de1f3cb82597dcab1aecd08fd091ca4c2a4914ac0c4ab96bc0dcb7072d9d367bea97a4af4b0b78ae74306997c2bd0057f64ab515b9f0cac7557279a2fe4613c81c455cb0be4c29dfb6e95c3dced62f64536b1159af0a8e7de8b17584b1d45b1c56b1d1c704cd9a4c4cf61009a127e0f1b3678dc92445322e2bf80862059999839b8ba2382a60f8f88e8685630c9c50379963927ce779e79543b23cee5b722ec64cf1322e63c7604249010b81dbdfedc72d2370554e61a0bd78efe4ba2576f1c757652b7e3a5a0f7b7c1c55975a3c5cd80678804520c6419cd158f78b25101b57ef2f13dd5d8bfe86d3e94de451a41390e3ed8a8f6a0e9b8448a699a05a4546949dcf6705aa54c2d2f532acef9780dae2e02bd322bcbad23b329f894abf60cf5c9e8ae93a9419e81fcb73f20ea7a9b944a624ff1fafb5c5ceb0e05ddebc737bffb7cdc441b700bc92303789b5887d771c665681d996b96a2cd5eec8ecdff8f4df643a3492b0dabe80eef615985696c1240d364bd4cf253317521e772346cc8b04c53e8811d556e6848f3fb58150a33c707f654103c7170a3516c11b900cdaee9332f30a1d917ecd3aeb7dfa4090a7999a7cd0337e52d219e8250d30231380bd6715ec31b509b7e8cef70df2f8b21c1ac6de4f121efb558be371ea53312694fedeaf2b238e393543eab2b91c5cc93fbe1e6ebde323e2d401e70bb9be3e9b131c86cf33bd7dd84c46d1bf910a74393b16462736de0c7366c550b2f4572e878a8cf76670086d6d08dc882de1875647b799d25493a4ed8521a3e011ce5de070af559fe90ee0cfc23e92de2f475e39e83b32b89024133c98364c5dad1a6e880fcbffb843647b6a4055e3330d825a08ed3cb98bcbf7a26caed6e660fe061035dba163ccc7d8e502a6a1f433261ce106035cb2dc4d8f904693785409d0f2403e64ce8f9d8076c1b532983fdb454643fb5e644bfb33d9ee79cfd85b4606a6821e3b7a01992692e1f496ab6dc5ac464f3ed1234add09e87b04258a6a13ae3066e62cd1a4b8fb241495923dc06217e079fee293fe94ddc17c109093eff457c9b00041dbfc835f7002f8d91dd9e094a30394a51a79b3a23a434b\",\"signature\":\"FhBxP9o1JKLi0CTDIbdhq/up4wZxYdevbmlaLQqTIKcLnCzqN7TQcNZss9i/YB5ee9HK1uXgjJr/LEJ3jWHNB6+X/WQuRyltpPqUHRBalyCO63km9R8nEWHho869SWNdpBIhUvk1G2b3bgq+lowxi2I+KgslSQR0wBezRsP+04I=\",\"templateUrl\":\"https://file-link.pinduoduo.com/xlobo_std\",\"ver\":\"3\"}",
"request_id": "16299373852359934",
"waybill_code": "9866025654820"
},
"trace_id": ""
}
说明: code为0表示成功,非0为失败,message会包含失败原因。其他字段print_data 为模板内容,waybill_code 为面单号。
文档更新时间: 2023-03-14 17:02 作者:admin