# 获取退货地址
接口地址: http://www.damaijia168.com/vv/external/pddGetRefundAddress
请求方式: POST
传参方式: JSON
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| owner_id | string | 是 | 店铺 ID |
| edition | string | 否 | 版本 默认:1(不传默认为1) 1:1.0,2:2.0 |
# 请求示例
{
"order_id": "店铺 ID"
}
# 请求代码示例
cURL请求代码示例
curl --location --request POST 'http://www.damaijia168.com/vv/external/pddGetRefundAddress' \
--header 'Authorization: d705a2c26e05d7XXXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"owner_id": "123456789"
}'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://www.damaijia168.com/vv/external/pddGetRefundAddress',
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": "123456789"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: d705a2c26e05d7XXXXXXXXXXXXX',
'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\": \"123456789\"\r\n }");
Request request = new Request.Builder()
.url("http://www.damaijia168.com/vv/external/pddGetRefundAddress")
.method("POST", body)
.addHeader("Authorization", "d705a2c26e05d7XXXXXXXXXXXXX")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Python请求代码示例
import requests
url = "http://www.damaijia168.com/vv/external/pddGetRefundAddress"
payload="{\r\n \"owner_id\": \"123456789\"\r\n }"
headers = {
'Authorization': 'd705a2c26e05d7XXXXXXXXXXXXX',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | object | 返回数据 |
| -content | array | 退货地址列表 |
| --city_id | int | 退货地址所在城市ID |
| --city_name | string | 退货地址所在城市名字 |
| --district_id | int | 退货地址所在区ID |
| --district_name | string | 退货地址所在区名字 |
| --id | string | 退货地址ID |
| --is_default | string | 是否为默认退货地址 |
| --is_legal | bool | 退货地址是否合法 |
| --is_validated | bool | 退货地址是否有效 |
| --mall_id | string | 店铺ID 同owner_id |
| --province_id | int | 退货地址所在省份ID |
| --province_name | string | 退货地址所在省份名字 |
| --refund_address | string | 退货地址 |
| --refund_address_id | string | refund_id |
| --refund_name | string | 退货收件人名字 |
| --refund_phone | string | 退货收件人手机号 |
| --refund_tel | string | 退货收件人固定电话 |
| --deduct_money | int | 消耗点券 |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data": {
"deduct_money":1,
"content": [
{
"is_legal": true,
"is_default": "Y",
"is_validated": true,
"refund_name": "王先生",
"province_name": "河南省",
"refund_phone": "YmQ4YzUzZGM0NDExNaaaaaaaaaaaajU2YjA2M2VhMTQzMTEyOTJjZmZlOTliMDZiN2UzNTU2Mjc2XXXXXXXXXXXXXXXX",
"district_name": "中牟县",
"city_name": "郑州市",
"refund_address_id": "1_1_123456789",
"province_id": 11,
"mall_id": 123456789,
"refund_address": "乡村爱情",
"district_id": 1267,
"id": 112647083,
"refund_tel": "",
"city_id": 149
}
]
},
"status": 0
}
# 错误码
| 状态码(status) | 错误信息 | 解决方案 |
|---|---|---|
| 132 | 请求格式必须为JSON | 修改请求参数格式为json |
| 422 | 参数列表不合法,在err中会给出提示 | 根据提示做相应修改 |
| 200 | 认证失败 | 请确保请求头里的Authorization存在或者未过期 |