# 获取包裹列表
接口地址: http://www.damaijia168.com/vv/external/package_get_list
请求方式: POST
传参方式: JSON
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| filter | object | 是 | 筛选条件 |
| —create_time | string[] | 否 | 创建时间 |
| —mobile | int | 否 | 手机号码 |
| —order_sn | string | 否 | 订单编号 |
| —status | string | 否 | 状态 f:待付款 p:未发货 s:已发货 c:已取消 |
| range | array | 是 | 页码(前面是第几页,后面是一页有多少条) |
# 请求示例
{
"range": [1,2],
"filter": {
"create_time":[""],
"mobile": 15******888,
"order_sn": "*********",
"status": "s"
}
}
# 请求代码示例
cURL请求代码示例
curl --location --request POST 'http://www.damaijia168.com/vv/external/package_get_list' \--header 'Authorization: 0b1e37721ae86d31a18a686xxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"range": [1,2],
"filter": {
"create_time":[""], "mobile": 15******888, "order_sn": "", "status": "" } }'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => "http://www.damaijia168.com/vv/external/package_get_list", 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 =>"{\r\n \"range\": [1,2],\r\n \"filter\": {\r\n\r\n \"mobile\": 15******888,\r\n \"order_sn\": \"\",\r\n \"status\": \"\"\r\n }\r\n}",
CURLOPT_HTTPHEADER => array(
"Authorization: 0b1e37721ae86d31a18a6868xxxxxxxx",
"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 \"range\": [1,2],\r\n \"filter\": {\r\n\r\n \"mobile\": 15******888,\r\n \"order_sn\": \"\",\r\n \"status\": \"\"\r\n }\r\n}");
Request request = new Request.Builder()
.url("http://www.damaijia168.com/vv/external/package_get_list")
.method("POST", body)
.addHeader("Authorization", "0b1e37721ae86d31a18a686xxxxxxxx")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Python请求代码示例
import requests
import json
url = "http://www.damaijia168.com/vv/external/package_get_list"
headers = {
'Authorization': '1798c6aadec33d1bc2f5b707f1049aefexxxx',
'Content-Type': 'application/json'
}
payload = json.dumps({
"range": [1,2],
"filter": {
"create_time":[""], "mobile": 15******888, "order_sn": "", "status": "" } })
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | object | 执行任务 |
| index | int | 索引 |
| list | object | 结果集合 |
| —current_page | int | 目前页码 |
| —data | array | 结果数据 |
| —product_name | string | 商品名称 |
| —product_weight | int | 商品重量g |
| —order_sn | string | 订单编号 |
| —product_number | int | 商品数量 |
| —shipping_fee | int | 运费(点券) |
| —price | int | 价格(点券) |
| —create_time | string | 创建时间 |
| —update_time | string | 更新时间 |
| —id | int | 包裹id |
| —consignee | string | 收货人 |
| —mobile | string | 收货人手机号 |
| —province | string | 省份 |
| —city | string | 城市 |
| —district | string | 区 |
| —address | string | 具体地址 |
| —express_no | string | 快递单号 |
| —express_company_name | string | 物流公司 |
| —ext_platform_order_sn | string | 三方订单编号 |
| —additional | string | 额外信息 |
| —cancel_reason | string | 取消原因,非取消状态以及用户手动取消则为null |
| —status | string | 包裹状态 f 待付款 p未发货 s已发货 c已取消 |
| —total | int | 数据总数 |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data": {
"index": 28,
"list": {
"current_page": 28,
"data": [
{
"product_name": "测试商品",
"product_weight": 5,
"order_sn": "20201********7580",
"product_number": 1,
"shipping_fee": 0,
"price": 80,
"create_time": "2020-11-14 16:48:12",
"update_time": "2020-11-14 16:48:12",
"id": 920,
"consignee": "测试",
"mobile": "155==*****2288",
"province": "浙江",
"city": "杭州",
"district": "余杭区",
"address": "梦想小镇",
"express_no": null,
"express_company_name": null,
"ext_platform_order_sn": "898**********9801",
"additional": null,
"status": "f"
}
]
},
"total": 271
},
"status": 0
}
# 错误码(更多错误码请进入获取token页面查看公共错误码)
| 状态码 | 错误说明 |
|---|---|
| 132 | 请求格式必须为JSON |
| 422 | 参数列表不合法,在err中会给出提示 |
| 200 | 认证失败 |