# 訂單運費預估
## 1、基本信息
請求API名稱:deliveryFee
接口描述:調用接口,傳入訂單的基本信息,查詢完成配送的預估費用
## 2、請求參數
| 字段名 | 類型 | 是否必填 | 示例 | 描述 |
| --- | --- | --- | --- | --- |
| buyaddress | Array | 是 | | 取貨地址信息 |
| acceptaddress | Array | 是 | | 收貨人信息 |
| goodsweight | String | 是| 1.5 | 物品重量 單位千克|
| delivery_time | String | 是 | 2020-10-30 12:00 | 預計送達時間 |
| delivery_tips | String | 否 | 2 | 配送小費|
buyaddress 、acceptaddress字段包含信息
| 字段名 | 類型 | 是否必填 | 示例 | 描述 |
| --- | --- | --- | --- | --- |
| realname | String | 是 | 張三 | 姓名|
| mobile | String | 是 | 15364810000 | 手機號 |
| address | String | 是 | 山西省太原市 | 具體地址 |
| sex | String | 是 | 1 | 性別 1男 0女 |
| location_x | String | 是 | 37.87059 | 地址緯度坐標.(坐標系為高德地圖坐標系,又稱火星坐標)|
| location_y | String | 是 | 112.548879 | 地址經度坐標.(坐標系為高德地圖坐標系,又稱火星坐標)|
請求示例:
{
"buyaddress": {
"realname": "張三",
"mobile": "15364810000",
"sex": 1,
"address": "山西省太原市",
"location_x": "37.87059",
"location_y": "112.56619"
},
"acceptaddress": {
"realname": "李四",
"mobile": "15364810001",
"sex": 1,
"address": "山西省太原市",
"location_x": "37.86054",
"location_y": "112.66219"
},
"goods_weight": 1.5,
"delivery_time": "2020-10-30 12:00",
"delivery_tips": 1
}
## 3、響應結果
| 字段名 | 類型 | 示例 | 描述 |
| --- | --- | --- | --- | --- |
| delivery_fee | String | 8.8 |預估配送費|
| delivery_tips | String | 0 | 配送小費,與請求參數中的 delivery_tips 一致|
|total_fee|String|8.8|配送費總金額|
|discount_fee|String|0|配送費優惠金額|
|final_fee|String|8.8|實際需支付的配送費金額|
|distance|String|5.5|配送距離,單位km|
|fees|Array| |配送費詳細說明|
|delivery_time|String|2020-10-30 12:00|預計送達時間|
|goods_weight|String|2.5|物品重量,單位kg|
說明:
響應參數中與費用有關的值的單位均為元。
total_fee = delivery_fee + delivery_tips
final_fee = total_fee - discount_fee
正確響應結果示例:
{
"errno": 0,
"message": {
"delivery_fee": 5.5,
"delivery_tips": 0,
"total_fee": 5.5,
"discount_fee": 0,
"final_fee": 5.5,
"distance": 1.1,
"fees": {
"basic": {
"title": "基礎配送費",
"note": "固定金額",
"fee": 5.5,
"fee_cn": "¥5.5"
}
},
"delivery_time": "2020-10-30 12:00",
"goods_weight": 1.5
}
}
錯誤響應結果示例:
{
"errno": -1,
"message": "配送地址信息不完善"
}