发货接口
发货接口
1.请求参数:
请求URL:
| 参数名称 | 参数类型 | 是否必须 | 示例值 | 参数描述 |
|---|---|---|---|---|
| appid | String | 是 | 合作伙伴AppId | |
| timestamp | String | 是 | 1657525936 | 当前Unix时间戳,秒 |
| seller_nick | String | 是 | 38173182 | 店铺账号,对应蜂巢授权返回seller_nick字段 |
| sign | String | 是 |
业务参数
| 参数名称 | 参数类型 | 是否必须 | 参数描述 |
|---|---|---|---|
| request_data | JSON | 必需 | 报表 |
2. 请求示例代码(Java)
@Test
public void logisticsSend() throws Exception {
String reqData ="\n" + " [\n" + " {\n" + " \"order_sn\": \"P769320972163297951\",\n" + " \"wp_code\": \"shentong\",\n" + " \"waybill_code\": \"772045592697942\",\n" + " \"ownerId\": \"67d39413f596f20015fe0ebe\"\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);
}
3. 返回结果
返回结果如下
{
"code": 0,
"message": "处理成功",
"data": {
"fail": [
{
"order_sn": "P769320972163297951",
"message": "发货失败"
}
],
"success": [{
"order_sn": "P769320972163297951",
"message": "发货成功"
}]
}
}
返回code为0表示成功, 非0为失败,失败时message会有失败原因。
文档更新时间: 2025-12-29 20:28 作者:admin