# 批量发货
接口地址: http://www.damaijia168.com/vv/external/pddShipFree
请求方式: POST
传参方式: JSON
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| params | object | 是 | form 表单的数组形式 |
| params[order_sn] | string | 是 | 订单号 |
| params[wp_code] | string | 是 | 快递公司编码 |
| params[waybill_code] | string | 是 | 面单号 |
| params[owner_id] | string | 是 | 店铺 owner_id |
| edition | string | 否 | 版本 默认:1(不传默认为1) 1:1.0,2:2.0 |
# 请求示例
"params": [
{
"order_sn": "订单号",
"wp_code": "STO",
"waybill_code": "面单号",
"owner_id": "店铺 owner_id"
},
{
"order_sn": "订单号",
"wp_code": "YTO",
"waybill_code": "面单号",
"owner_id": "店铺 owner_id"
}
]
# 请求代码示例
cURL请求代码示例
curl --location --request POST 'http://www.damaijia168.com/vv/external/pddShipFree' \
--header 'Authorization: d705a2c26e05d7d13988888888' \
--header 'Content-Type: application/json' \
--data-raw '{
"params": [
{
"order_sn": "210910-13988888888",
"wp_code": "YUNDA",
"waybill_code": "13988888888",
"owner_id": "13988888888"
}
]
}'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://www.damaijia168.com/vv/external/pddShipFree',
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": [
{
"order_sn": "210910-13988888888",
"wp_code": "YUNDA",
"waybill_code": "13988888888",
"owner_id": "13988888888"
}
]
}',
CURLOPT_HTTPHEADER => array(
'Authorization: d705a2c26e05d7d13988888888',
'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 \"order_sn\": \"210910-13988888888\",\r\n \"wp_code\": \"YUNDA\",\r\n \"waybill_code\": \"13988888888\",\r\n \"owner_id\": \"13988888888\"\r\n }\r\n ]\r\n}");
Request request = new Request.Builder()
.url("http://www.damaijia168.com/vv/external/pddShipFree")
.method("POST", body)
.addHeader("Authorization", "d705a2c26e05d7d13988888888")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Python请求代码示例
import requests
url = "http://www.damaijia168.com/vv/external/pddShipFree"
payload="{\r\n \"params\": [\r\n {\r\n \"order_sn\": \"210910-13988888888\",\r\n \"wp_code\": \"YUNDA\",\r\n \"waybill_code\": \"13988888888\",\r\n \"owner_id\": \"13988888888\"\r\n }\r\n ]\r\n}"
headers = {
'Authorization': 'd705a2c26e05d7d13988888888',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | object | 返回数据 |
| --code | string | 状态:0 失败; 1 成功 |
| --error_msg | string | 错误内容 |
| --order_sn | string | 订单号 |
| --waybill_code | string | 面单号 |
| --deduct_money | int | 消耗点券 |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data": {
"deduct_money":1,
"result": [
{
"code": 1,
"error_msg": null,
"order_sn": "订单信息",
"waybill_code": "面单号"
},
{
"code": 1,
"error_msg": null,
"order_sn": "订单信息",
"waybill_code": "面单号"
},
]
},
"status": 0
}
# 错误码
| 状态码(status) | 错误信息 | 解决方案 |
|---|---|---|
| 132 | 请求格式必须为JSON | 修改请求参数格式为json |
| 422 | 参数列表不合法,在err中会给出提示 | 根据提示做相应修改 |
| 200 | 认证失败 | 请确保请求头里的Authorization存在或者未过期 |