# 单号回收
接口地址: http://www.damaijia168.com/vv/external/pddWaybillRecovery
请求方式: POST
传参方式: JSON
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| owner_id | string | 是 | 店铺 ID |
| wp_code | string | 是 | 快递编号,比如:SF,STO |
| waybill_code | string | 是 | 面单号(快递单号) |
| edition | string | 否 | 版本 默认:1(不传默认为1) 1:1.0,2:2.0 |
# 请求示例
"params": [
{
"owner_id": "店铺 ID",
"wp_code": "STO",
"waybill_code": "6588888"
},
{
"wp_code": "YTO",
"waybill_code": "面单号",
"owner_id": "店铺 ownerId"
}
]
# 请求代码示例
cURL请求代码示例
curl --location --request POST 'http://www.damaijia168.com/vv/external/pddWaybillRecovery' \
--header 'Authorization: d705a2c26e05d7ddf912XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": [
{
"owner_id": "12356789",
"wp_code": "YUNDA",
"waybill_code": "12356789"
}
]
}'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://www.damaijia168.com/vv/external/pddWaybillRecovery',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"params": [
{
"owner_id": "12356789",
"wp_code": "YUNDA",
"waybill_code": "12356789"
}
]
}',
CURLOPT_HTTPHEADER => array(
'Authorization: d705a2c26e05d7ddf912XXXXXXX',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
JAVA请求代码示例
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"params\": [\r\n {\r\n \"owner_id\": \"12356789\",\r\n \"wp_code\": \"YUNDA\",\r\n \"waybill_code\": \"12356789\"\r\n }\r\n ]\r\n}");
Request request = new Request.Builder()
.url("http://www.damaijia168.com/vv/external/pddWaybillRecovery")
.method("POST", body)
.addHeader("Authorization", "d705a2c26e05d7ddf912XXXXXXX")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Python请求代码示例
import requests
url = "http://www.damaijia168.com/vv/external/pddWaybillRecovery"
payload="{\r\n \"params\": [\r\n {\r\n \"owner_id\": \"12356789\",\r\n \"wp_code\": \"YUNDA\",\r\n \"waybill_code\": \"12356789\"\r\n }\r\n ]\r\n}"
headers = {
'Authorization': 'd705a2c26e05d7ddf912XXXXXXX',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | object | 返回数据 |
| -branch_account_cols | array | wp网点信息及对应的商家的发货信息 |
| -wp_code | string | 快递编号 |
| -order_sn | int | 订单信息 |
| -error_msg | int | 错误内容 |
| -code | int | 面单号(快递单号) |
| --deduct_money | int | 消耗点券 |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data": {
"deduct_money":1,
"result": [
{
"waybill_code": "面单号",
"wp_code": "STO",
"code": 0,
"error_msg": ""
}
],
"status": 0
}
# 错误码
| 状态码(status) | 错误信息 | 解决方案 |
|---|---|---|
| 132 | 请求格式必须为JSON | 修改请求参数格式为json |
| 422 | 参数列表不合法,在err中会给出提示 | 根据提示做相应修改 |
| 200 | 认证失败 | 请确保请求头里的Authorization存在或者未过期 |