计算运费
简要描述:
请求URL:
/v1/order/queryDeliverFee
请求方式:
- POST
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
sss_shop_id | 是 | int | 送件侠门店id |
order_id | 是 | string | 订单id,即该订单在合作方系统中的唯一标识,最长不超过32个字符 |
receiver_name | 是 | string | 收件人名称,最长不超过20个字符 |
receiver_address | 是 | string | 收件人地址,最长不超过150个字符 |
receiver_address_detail | 是 | string | 收件人详细地址,最长不超过150个字符 |
receiver_phone | 是 | string | 收件人电话,最长不超过20个字符 |
receiver_lng | 是 | double | 收件人经度,使用高德地图的坐标 |
receiver_lat | 是 | double | 收件人纬度,使用高德地图的坐标 |
goods_type | 是 | int | 货物类型,1:食品小吃 2:饮料 3:蛋糕 4:鲜花 5:生鲜果蔬 6:电子数码 7:百货 8:文印票务 9:医药 10:同城电商 11:小商品市场 12:小龙虾 100:其它 |
goods_weight | 是 | int | 货物重量,单位为kg |
expected_pickup_time | 是 | int | 期望骑手上门时间,时区为GMT+8,当前距离Epoch(1970年1月1日) 以秒计算的时间,即unix-timestamp。传0则为立即上门 |
poi_seq | 是 | int | 门店订单流水号,指定店铺的每日订单顺序号,比如是今日第4单,那就传4 |
note | 否 | string | 订单备注,最长不超过200个字符,如果值为空,则不传此参数 |
coupon_alias | 否 | string | 优惠券唯一码,传入则表示指定一张优惠券,调用订单可用优惠券 接口可获取, 如果不需要则不传此参数,系统默认会推出一张可用优惠券 |
insurance_fee | 否 | int | 此订单保价金额, 不传则不保价, 目前只固定支持 0,100,200,300,400,500元 |
attach | 否 | int | 发单成功后,如需要再次计价,传入attach:1, 此参数作用为过滤掉第一次发单时已选择的运力,并重新计价 (如attach:1,则sss_peisong_id必传) |
sss_peisong_id | 否 | string | 送件侠订单号 |
notify_url | 否 | string | 自定义订单状态通知回调地址,无须参与sign签名 |
特别说明
首次调用此接口,将返回一个sss_peisong_id值,如返回值为1
再次调用此接口,将返回一个新的sss_peisong_id值,如返回值为2
如果业务方订单号是同一个,可以在第一次调用接口之后,记录sss_peisong_id, 如需再次调用,可传入sss_peisong_id:最新的订单号如2
这样的好处是业务方同一个订单号对应送件侠一个订单号
如果需要发单后追加运力功能,流程为
1. 调用计价->调用下单接口
2. 再次调用计价接口,传入以下附加参数
attach:1
sss_peisong_id:第1步时返回的送件侠订单号
3. 调用下单接口,third_logistics_ids 传入本次下单需要追加的运力ID
返回示例
{
"code": 0,
"message": "ok",
"data": {
"sss_peisong_id": 2269722,
"detail": [
{
"third_logistics_id": 14,
"third_logistics_name": "蜂鸟即配",
"third_logistics_icon": "https://sss-admin.oss-cn-zhangjiakou.aliyuncs.com/image/fn.png",
"distance": 9.4,
"fee": 18,
"is_custom_capacity": 0,
"custom_capacity_fee": 0,
"custom_capacity_error_msg": "",
"used_coupon_alias": "62400ce5c3e640b39da44db78d2207c3",
"coupon_fee": 3,
"is_use_insurance": 1,
"insurance_deduct_fee": 2
},
{
"third_logistics_id": 6,
"third_logistics_name": "点我达",
"third_logistics_icon": "https://sss-admin.oss-cn-zhangjiakou.aliyuncs.com/image/dwd.png",
"distance": 9.8,
"fee": 18.4,
"is_custom_capacity": 0,
"custom_capacity_fee": 0,
"custom_capacity_error_msg": "",
"used_coupon_alias": "62400ce5c3e640b39da44db78d2207c3",
"coupon_fee": 3,
"is_use_insurance": 0,
"insurance_deduct_fee": 0
},
{
"third_logistics_id": 12,
"third_logistics_name": "快服务",
"third_logistics_icon": "https://sss-admin.oss-cn-zhangjiakou.aliyuncs.com/image/kfw-logo.png",
"distance": 9.8,
"fee": 20,
"is_custom_capacity": 0,
"custom_capacity_fee": 0,
"custom_capacity_error_msg": "",
"used_coupon_alias": "62400ce5c3e640b39da44db78d2207c3",
"coupon_fee": 3,
"is_use_insurance": 0,
"insurance_deduct_fee": 0
},
{
"third_logistics_id": 8,
"third_logistics_name": "UU跑腿",
"third_logistics_icon": "https://sss-admin.oss-cn-zhangjiakou.aliyuncs.com/image/uu.png",
"distance": 9.495,
"fee": 21,
"is_custom_capacity": 0,
"custom_capacity_fee": 0,
"custom_capacity_error_msg": "",
"used_coupon_alias": "62400ce5c3e640b39da44db78d2207c3",
"coupon_fee": 3,
"is_use_insurance": 0,
"insurance_deduct_fee": 0
},
{
"third_logistics_id": 1,
"third_logistics_name": "达达",
"third_logistics_icon": "https://sss-admin.oss-cn-zhangjiakou.aliyuncs.com/image/dd.png",
"distance": 9.41,
"fee": 21,
"is_custom_capacity": 0,
"custom_capacity_fee": 0,
"custom_capacity_error_msg": "",
"used_coupon_alias": "62400ce5c3e640b39da44db78d2207c3",
"coupon_fee": 3,
"is_use_insurance": 1,
"insurance_deduct_fee": 1
},
{
"third_logistics_id": 11,
"third_logistics_name": "顺丰",
"third_logistics_icon": "https://sss-admin.oss-cn-zhangjiakou.aliyuncs.com/image/sf.png",
"distance": 9.409,
"fee": 21,
"is_custom_capacity": 0,
"custom_capacity_fee": 0,
"custom_capacity_error_msg": "",
"used_coupon_alias": "62400ce5c3e640b39da44db78d2207c3",
"coupon_fee": 3,
"is_use_insurance": 1,
"insurance_deduct_fee": 1.5
},
{
"third_logistics_id": 16,
"third_logistics_name": "闪送v5",
"third_logistics_icon": "https://sss-admin.oss-cn-zhangjiakou.aliyuncs.com/image/ss.png",
"distance": "8.00",
"fee": 23,
"is_custom_capacity": 0,
"custom_capacity_fee": 0,
"custom_capacity_error_msg": "",
"used_coupon_alias": "62400ce5c3e640b39da44db78d2207c3",
"coupon_fee": 3,
"is_use_insurance": 1,
"insurance_deduct_fee": 1.5
}
]
}
}
返回参数说明
参数 | 说明 | 类型 | 必定返回 |
---|---|---|---|
sss_peisong_id | string | 送件侠订单号 | 是 |
third_logistics_id | int | 运力公司标识ID,详见附录 | 是 |
third_logistics_name | string | 运力公司名,详见附录 | 是 |
third_logistics_icon | string | 运力logo | 是 |
distance | double | 配送距离,单位为公里 | 是 |
fee | double | 最终运费,单位为元 | 是 |
is_custom_capacity | int | 是否使用自运力账号 | 是 |
custom_capacity_fee | double | 自运力账号-本次运费 | 是 |
custom_capacity_error_msg | string | 自运力计算运费错误信息 | 否 |
used_coupon_alias | string | 已使用的优惠券码,如无则为空字符 | 是 |
coupon_fee | double | 优惠券金额 | 是 |
is_use_insurance | int | 是否成功由运力方保价, 1:是 0:否 | 是 |
insurance_deduct_fee | double | 保价扣除金额 (如返回运费为10元,其中有2元为保价溢价金额) | 是 |
请求示例demo x-www-form-urlencoded
appkey:4aa32923334940099ad6ecf6a552de33
timestamp:1575525613228
version:1.0
sign:xxxxxxx
sss_shop_id:18000016
receiver_name:李安
receiver_phone:15632131234
receiver_address:阿里巴巴西溪园区(淘宝城)
receiver_address_detail:1幢1402
receiver_lng:120.024393
receiver_lat:30.279713
goods_type:3
goods_weight:1
note:备注信息
poi_seq:30
expected_pickup_time:1589292000
order_id:11123123
notify_url:https://www.qq.com