发货接口
一、请求参数
请求URL:
| 参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
|---|---|---|---|---|
| appid | String | 是 | 合作伙伴AppId | |
| timestamp | String | 是 | 1657525936 | 当前Unix时间戳,秒 |
| seller_nick | String | 是 | 38173182 | 店铺账号,对应蜂巢授权返回seller_nick字段 |
| sign | String | 是 |
业务参数
| 参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
|---|---|---|---|---|
| request_data | JSON | 是 | 报文 |
二、请求示例代码
Java
@Testpublic void logisticsSend() throws Exception { String reqData = "{\n" + " \"order_id\": \"8\",\n" + " \"delivery_list\": [\n" + " {\n" + " \"delivery_id\": \"ZTO\",\n" + " \"waybill_id\": \"73612959240139\",\n" + " \"deliver_type\": 1,\n" + " \"product_infos\": [\n" + " {\n" + " \"product_id\": \"63\",\n" + " \"sku_id\": \"82\",\n" + " \"product_cnt\": 24\n" + " },\n" + " {\n" + " \"product_id\": \"30\",\n" + " \"sku_id\": \"38\",\n" + " \"product_cnt\": 69\n" + " }\n" + " ]\n" + " }\n" + " ]\n" + "}\n";
String sellerNick = "xxx"; //业务参 Map<String, String> data = new HashMap(); data.put("appid", Config.AppId); data.put("seller_nick", sellerNick); Long timestamp = System.currentTimeMillis(); data.put("timestamp", timestamp.toString()); data.put("request_data", reqData); // 参数签名 data.put("sign", Utils.Sign(data, Config.AppSecret)); String result = doHttpRequest(apiUrl, data); System.out.println("result:"+result);}三、返回结果
返回结果如下
{ "code": 0, "message": "处理成功", "data": { "status": true, "message": "ok" }}返回code为0表示成功, 非0为失败,失败时message会有失败原因。