# 拼多多面单云打印接口
接口地址: http://www.damaijia168.com/vv/external/platformTheSingle
请求方式: POST
传参方式: JSON
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| owner_id | string | 是 | 店铺 owner_id |
| sender_name | string | 是 | 发货人姓名 |
| sender_mobile | string | 是 | 发货人手机 |
| province | string | 是 | 发货省 |
| city | string | 是 | 发货市 |
| district | string | 是 | 区 |
| detail | string | 是 | 发货地详细地址 |
| wp_code | string | 是 | 快递 wp_code |
| waybill_type | string | 是 | 面单类型 1:一联单,2:二 联单,3:其他 |
| shop_code | string | 是 | 订购软件里的店铺关联码(账号设置-店铺关联码) |
| order_sn_list[] | string | 是 | 订单号 索引数组["201117-681808366402308", "201117-431331084902308"] |
| edition | string | 否 | 版本 默认:1(不传默认为1) 1:1.0,2:2.0 |
# 请求示例
{
"owner_id": "店铺 owner_id",
"sender_name": "发货人姓名",
"sender_mobile": "发货人手机",
"province": "发货省",
"city": "发货市",
"district": "区",
"detail": "发货地详细地址",
"wp_code": "快递 wp_code",
"waybill_type": "1",
"shop_code": "订购软件 shop_code(订购软件设置中可复制,一单配置不要刷新,避免出错)",
"order_sn_list":["201117-6********8", "201117-4********8"],
}
# 请求代码示例
cURL请求代码示例
curl --location --request POST 'http://www.damaijia168.com/vv/external/platformTheSingle' \
--header 'Authorization: f38e89384ea1e8ee1bcxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"owner_id": "1234567",
"sender_name": "玛卡玛卡",
"sender_mobile": "13988888888",
"province": "河南省",
"city": "郑州市",
"district": "中牟县",
"detail": "马卡马卡比克崩",
"wp_code": "YUNDA",
"waybill_type": "1",
"type": 1,
"shop_code": "1234567",
"order_sn_list": [
"210910-1234567"
]
}'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://www.damaijia168.com/vv/external/platformTheSingle',
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 =>'{
"owner_id": "1234567",
"sender_name": "玛卡玛卡",
"sender_mobile": "13988888888",
"province": "河南省",
"city": "郑州市",
"district": "中牟县",
"detail": "马卡马卡比克崩",
"wp_code": "YUNDA",
"waybill_type": "1",
"type": 1,
"shop_code": "1234567",
"order_sn_list": [
"210910-1234567"
]
}',
CURLOPT_HTTPHEADER => array(
'Authorization: f38e89384ea1e8ee1bcxxxxxxx',
'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 \"owner_id\": \"1234567\",\r\n \"sender_name\": \"玛卡玛卡\",\r\n \"sender_mobile\": \"13988888888\",\r\n \"province\": \"河南省\",\r\n \"city\": \"郑州市\",\r\n \"district\": \"中牟县\",\r\n \"detail\": \"马卡马卡比克崩\",\r\n \"wp_code\": \"YUNDA\",\r\n \"waybill_type\": \"1\",\r\n \"type\": 1,\r\n \"shop_code\": \"1234567\",\r\n \"order_sn_list\": [\r\n \"210910-1234567\"\r\n ]\r\n}");
Request request = new Request.Builder()
.url("http://www.damaijia168.com/vv/external/platformTheSingle")
.method("POST", body)
.addHeader("Authorization", "f38e89384ea1e8ee1bcxxxxxxx")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Python请求代码示例
import requests
url = "http://www.damaijia168.com/vv/external/platformTheSingle"
payload="{\r\n \"owner_id\": \"1234567\",\r\n \"sender_name\": \"玛卡玛卡\",\r\n \"sender_mobile\": \"13988888888\",\r\n \"province\": \"河南省\",\r\n \"city\": \"郑州市\",\r\n \"district\": \"中牟县\",\r\n \"detail\": \"马卡马卡比克崩\",\r\n \"wp_code\": \"YUNDA\",\r\n \"waybill_type\": \"1\",\r\n \"type\": 1,\r\n \"shop_code\": \"1234567\",\r\n \"order_sn_list\": [\r\n \"210910-1234567\"\r\n ]\r\n}"
headers = {
'Authorization': 'f38e89384ea1e8ee1bcxxxxxxx',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | object | 返回数据 |
| --order_sn | string | 订单号 |
| --object_id | string | 任务 id |
| --print_data | string | 打印信息 |
| --waybill_code | string | 面单号 |
| --parent_waybill_code | string | 父订单面单号 |
| --code | string | 状态:0 失败; 1 成功 |
| --error_msg | string | 错误信息 |
| --deduct_money | int | 消耗点券 |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data": {
"orderSn": "订单号",
"objectId": null,
"printData": "打印信息",
"waybillCode": "面单号",
"parentWaybillCode": null,
"code": 1,
"errorMsg": null,
"deduct_money":4
},
"status": 0
}
# 错误码
| 状态码(status) | 错误信息 | 解决方案 |
|---|---|---|
| 132 | 请求格式必须为JSON | 修改请求参数格式为json |
| 422 | 参数列表不合法,在err中会给出提示 | 根据提示做相应修改 |
| 200 | 认证失败 | 请确保请求头里的Authorization存在或者未过期 |