# Driver Related

# 司机余额管理

功能: 查看和管理余额,计算司机收入

方法: POST

URL: /fleet/open-api/drivers/getBalance

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_id int64 司机ID
location_country string 所属国家
lang string 语言

返回参数:

参数 类型 说明
driver_balance string 司机余额
currency_code string 货币代码

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success",
    "data": {
      "response": {
        "driver_balance": "-217.01",
        "currency_code": "₽"
      },
      "trace_id": "0a6072d45f3cdd6be61db3f9ffdfc9b0"
    }
}
1
2
3
4
5
6
7
8
9
10
11

异常情况

{
    "errno": 20002,
    "msg": "the driver does not exist."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 司机订单管理

功能: 获取车头下司机的订单列表

方法: POST

URL: /fleet/open-api/drivers/getOrderList

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
location_country string 所属国家
lang string 语言
page int32 页码,范围[1,1000000]
size int32 每页订单数量,范围[1,100]
driver_id int64 司机ID
driver_phone string 手机号码
start_time string 接单开始时间。时间格式为ISO8601,如:"2006-01-02T15:04:05-07:00"
end_time string 接单结束时间。时间格式为ISO8601,如:"2006-01-02T15:04:05-07:00"

返回参数:

参数 类型 说明
driver_id int64 司机ID
driver_name string 司机姓名
fleet_id int64 车头ID
driver_phone string 司机手机号
order_id int64 订单id
acceptance_time string 接单时间,时间格式为ISO8601
start_at string 订单起点
end_at string 订单终点
order_distance string 距离
order_status int32 订单状态,枚举值:见附录“订单状态”
order_status_desc string 订单状态说明
is_pay int32 是否支付。 0:否 1:是
pay_type int32 支付方式,枚举值:见附录“支付方式”
pay_type_desc string 支付方式说明
total_fee string 总费用
currency_code string 货币代码

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success",
    "data": {
      "response": {
        "list": [
          {
            "driver_id": 50000000000000,
            "driver_name": "测试号50000000000000",
            "fleet_id": 10000000000000,
            "driver_phone": "************",
            "order_id": 80000000000000,
            "acceptance_time": "2021-09-01T00:00:00+08:00",
            "start_at": "*************",
            "end_at": "************",
            "order_distance": "2 808 м",
            "order_status": 1,
            "order_status_desc": "Accepted",
            "is_pay": 1,
            "pay_type": 1024,
            "pay_type_desc": "Cash Payment",
            "total_fee": "478.0",
            "currency_code": "RUB"
          }
        ],
        "count": 1
      },
      "trace_id": "0a6072d45f3cdd6be61db3f9ffdfc9b0"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

异常情况

{
    "errno": 20002,
    "msg": "the driver does not exist."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 检查司机状态

功能: 通过手机号检测司机是否可以被车头录入

方法: POST

URL: /fleet/open-api/drivers/checkDriverExist

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_phone string 司机的手机号,格式为国家码+电话号码,如"+700016****44"
location_country string 所属国家
lang string 语言

返回参数:

参数 类型 说明
is_exists int32 司机系统是否存在司机信息,0-不存在 1-存在
driver_id int64 司机id
driver_name string 司机名字

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success",
    "data": {
      "response": {
        "driver_info": {
          "driver_id": 50000000000000,
          "driver_name": ""
        },
        "is_exists": 1
      },
      "trace_id": "0a6072d45f3cdd6be61db3f9ffdfc9b0"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

异常情况

{
    "errno": 10001,
    "msg": "driver phone is empty."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 绑定新司机

功能: 车头添加新司机

前置条件: 调用接口前需要判断司机是否是新司机。用户可以通过“检查司机状态”接口获取司机的状态,如果返回的“is_exists”参数的值为0的话,代表这个司机为新司机。

方法: POST

URL: /fleet/open-api/drivers/bindNewDriver

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_phone string 司机的手机号,格式为国家码+电话号码,如"+700016****44"
driver_info object 司机信息
identity_info object 证件信息
strategy_info object 策略信息
location_country string 所属国家
lang string 语言
uranus_product_id int32 产品线,默认值为2,枚举值见附录“产品线”

driver_info对象内容:

参数 类型 是否必填 说明
license_no string 司机信息:驾照号码
family_name string 司机信息:姓氏
given_name string 司机信息:名字
father_name string 司机信息:父亲名字,俄罗斯地区会使用
license_issue_date string 司机信息:驾照发证日期,日期格式:2020-01-01
license_valid_date string 司机信息:驾照有效期结束日期,日期格式:2020-01-01
birthday string 司机信息:出生日期,日期格式:2020-01-01
license_kind string 司机信息:驾照类别,枚举值:见附录“驾照类别”
license_issue_country string 司机信息:驾照签发国家英文缩写,见附录“国家英文缩写”
driver_special_marks string 司机信息:驾驶员专用标志
area_id int64 司机信息:所属城市码,由“获取已开放城市信息”接口获取
license_f_img string 司机信息:驾照正面照片地址。需要先调用“上传图片信息”接口获取图片地址
license_b_img string 司机信息:驾照反面照片地址。需要先调用“上传图片信息”接口获取图片地址

identity_info对象内容:

参数 类型 是否必填 说明
identity_type string 证件信息:证件类型,枚举值:见附件“证件类型”
identity_id string 证件信息:证件号码
id_valid_date string 证件信息:证件有效期,日期格式:2020-01-01
driver_nationality string 证件信息:证件所属国家
identity_img string 证件信息:证件照片地址。需要先调用“上传图片信息”接口获取图片地址

strategy_info对象内容:

参数 类型 是否必填 说明
amount int64 订单按金额抽取数量
cap_amount int64 订单安百分比最高抽取的金额,0是没有限制
start_time string 开始日期,不填或者为空的话默认使用当前时间,时间格式为2021-10-01
percent int32 每笔订单扣除百分比
deduct_type int32 扣除类型。枚举值:0-订单按百分比,1-订单按金额
strategy_type int32 策略类型:0-订单策略,2-是周期性策略
name string 策略名称,参考附录“安周期收费类型”
strategy_fee_type int32 费用类型。枚举值:见附录“安周期收费类型”
period_type int32 计费周期类别,只针对非订单。枚举值:见附件“计费周期类别”

订单策略安百分比请求示例:

[{
    "cap_amount": 2000, 
    "deduct_type": 0, 
    "start_time": "",
    "strategy_type": 0,
    "percent": 18
}
]
1
2
3
4
5
6
7
8

订单策略安金额请求示例:

[{
    "amount": 20, 
    "deduct_type": 1, 
    "start_time": "",
    "strategy_type": 0
}
]
1
2
3
4
5
6
7

周期性策略请求示例:

[{
    "name": "洗车费",
    "amount": 10, 
    "start_time": "2021-10-02",
    "period_type": 0,
    "strategy_type": 2,
    "strategy_fee_type": 1002
}
]
1
2
3
4
5
6
7
8
9

请求示例:

{
  "fleet_id": 10000000000000,
  "location_country": "RU",
  "lang": "ru-RU",
  "drive_id": 50000000000000,
  "driver_phone": "+700016****44",
  "driver_info": {
      "license_no": "6622573****450081D",
      "family_name": "",
      "given_name": "", 
      "father_name": "", 
      "license_issue_date": "2017-09-27",
      "license_valid_date": "2027-09-27",
      "birthday": "1995-09-01",
      "license_kind": "B",
      "license_issue_country": "RU",
      "area_id": 7800600,
      "license_f_img": "/upload/rooster20210901/5739e4c49e2d/3569dd813b2",
      "license_b_img": "/upload/rooster20210901/57bae93fda8e9/00239d7b4d"
  },
  "identity_info": {
      "identity_type": "passport",
      "identity_id": "7765****8865",
      "id_valid_date": "2027-09-01",
      "driver_nationality": "RU",
      "identity_img": "/upload/rooster20210901/57bae93fda8e9/00239d7b4d"
  },
  "strategy_info": [{
       "cap_amount": 2000, 
       "deduct_type": 0, 
       "start_time": "",
       "strategy_type": 0,
       "percent": 18
  }]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success"
}
1
2
3
4

异常情况

{
    "errno": 10001,
    "msg": "parameter error."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 绑定老司机

功能: 车头绑定老司机

前置条件: 调用接口前需要判断司机是否是老司机。用户可以通过“检查司机状态”接口获取司机的状态,如果返回的“is_exists”参数的值为1的话,代表这个司机为老司机。

方法: POST

URL: /fleet/open-api/drivers/bindOldDriver

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_phone string 司机的手机号,格式为国家码+电话号码,如"+700016****44"
strategy_info object 策略列表
location_country string 所属国家
lang string 语言
uranus_product_id int32 产品线,默认值为2,枚举值见附录“产品线”

strategy_info对象内容:

参数 类型 是否必填 说明
amount int64 订单按金额抽取数量
cap_amount int64 订单安百分比最高抽取的金额,0是没有限制
start_time string 开始日期,不填或者为空的话默认使用当前时间,格式为2021-10-01
percent int32 每笔订单扣除百分比
deduct_type int32 扣除类型。枚举值:0-订单按百分比,1-订单按金额
strategy_type int32 策略类型:0-订单策略,2-是周期性策略
name string 策略名称,参考附录“安周期收费类型”
strategy_fee_type int32 费用类型。枚举值:见附录“安周期收费类型”
period_type int32 计费周期类别,只针对非订单。枚举值:见附件“计费周期类别”

请求示例:

{
  "fleet_id": 10000000000000,
  "drive_id": 50000000000000,
  "location_country": "RU",
  "lang": "ru-RU",
  "driver_phone": "+700016****44",
  "strategy_info": [{
       "cap_amount": 2000, 
       "deduct_type": 0, 
       "start_time": "",
       "strategy_type": 0,
       "percent": 18
  }]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success"
}
1
2
3
4

异常情况

{
    "errno": 20020,
    "msg": "the driver has been bound by other fleet."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 解绑司机

功能: 车头解绑司机

方法: POST

URL: /fleet/open-api/drivers/unbind

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_id int64 司机ID
location_country string 所属国家
lang string 语言
uranus_product_id int32 产品线,默认值为2,枚举值见附录“产品线”

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success"
}
1
2
3
4

异常情况

{
    "errno": 20007,
    "msg": "failed to get driver binding relationship."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 获取司机工作条件

功能: 获取司机工作条件

方法: POST

URL: /fleet/open-api/drivers/getWorkCondition

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_id int64 司机ID
location_country string 所属国家
lang string 语言

返回参数:

参数 类型 说明
id int64 ID,策略的唯一id
name string 策略名称
amount int64 金额
cap_amount int64 百分比最高抽取的金额,0是没有限制
start_time string 开始时间,时间格式为ISO8601
percent int32 每笔订单扣除百分比
deduct_type int32 扣除类型。枚举值:0-订单按百分比,1-订单按金额
strategy_type int32 策略类型:0-订单策略,2-是周期性策略
strategy_fee_type int32 费用类型。枚举值:见附录“安周期收费类型”
period_type int32 计费周期类别,只针对非订单。枚举值:见附件“计费周期类别”

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success",
    "data": {
      "response": {
        "list":[{
          "id": 2198,
          "cap_amount": 2000,
          "deduct_type": 0,
          "start_time": "2021-10-02T15:04:05+08:00",
          "strategy_type": 0,
          "percent": 18,
          "strategy_fee_type": 0
        }],
        "count": 1
      },
      "trace_id": "0a6072d45f3cdd6be61db3f9ffdfc9b0"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

异常情况

{
    "errno": 20002,
    "msg": "the driver does not exist."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 更新司机工作条件

功能: 更新司机工作条件

方法: POST

URL: /fleet/open-api/drivers/updateWorkCondition

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_id int64 司机ID
strategy_info object 策略列表
location_country string 所属国家
lang string 语言

strategy_info对象内容:

参数 类型 是否必填 说明
id int64 ID,策略的唯一id
amount int64 订单按金额抽取数量
cap_amount int64 订单安百分比最高抽取的金额,0是没有限制
start_time string 开始日期,不填或者为空的话默认使用当前时间,日期格式为2021-10-01
percent int32 每笔订单扣除百分比
deduct_type int32 扣除类型。枚举值:0-订单按百分比,1-订单按金额
strategy_type int32 策略类型:0-订单策略,2-是周期性策略
name string 策略名称,参考附录“安周期收费类型”
strategy_fee_type int32 费用类型。枚举值:见附录“安周期收费类型”
period_type int32 计费周期类别,只针对非订单。枚举值:见附件“计费周期类别”

订单策略安百分比请求示例:

{
    "id": 2198,
    "cap_amount": 2000, 
    "deduct_type": 0, 
    "start_time": "",
    "strategy_type": 0,
    "percent": 18
}
1
2
3
4
5
6
7
8

订单策略安金额请求示例:

{
    "id": 2198,
    "amount": 20, 
    "deduct_type": 1, 
    "start_time": "",
    "strategy_type": 0
}
1
2
3
4
5
6
7

周期性策略请求示例:

{
    "id": 2198,
    "name": "洗车费",
    "amount": 10, 
    "start_time": "2021-10-02T00:00:00+03:00",
    "period_type": 0,
    "strategy_type": 2,
    "strategy_fee_type": 1002
}
1
2
3
4
5
6
7
8
9

请求示例:

{
  "fleet_id": 10000000000000,
  "drive_id": 50000000000000,
  "location_country": "RU",
  "lang": "ru-RU",
  "strategy_info": {
    "id": 2198,
    "cap_amount": 2000, 
    "deduct_type": 0, 
    "start_time": "",
    "strategy_type": 0,
    "percent": 18
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success"
}
1
2
3
4

异常情况

{
    "errno": 10001,
    "msg": "parameter error."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 增加司机工作条件

功能: 增加司机工作条件

方法: POST

URL: /fleet/open-api/drivers/addWorkCondition

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_id int64 司机ID
strategy_info object 策略详情
location_country string 所属国家
lang string 语言

strategy_info对象内容:

参数 类型 是否必填 说明
amount int64 订单按金额抽取数量
cap_amount int64 订单安百分比最高抽取的金额,0是没有限制
start_time string 开始日期,不填或者为空的话默认使用当前时间,日期格式为2021-10-01
percent int32 每笔订单扣除百分比
deduct_type int32 扣除类型。枚举值:0-订单按百分比,1-订单按金额
strategy_type int32 策略类型:0-订单策略,2-是周期性策略
name string 策略名称,参考附录“安周期收费类型”
strategy_fee_type int32 费用类型。枚举值:见附录“安周期收费类型”
period_type int32 计费周期类别,只针对非订单。枚举值:见附件“计费周期类别”

订单策略安百分比请求示例:

{
    "cap_amount": 2000, 
    "deduct_type": 0, 
    "start_time": "",
    "strategy_type": 0,
    "percent": 18
}
1
2
3
4
5
6
7

订单策略安金额请求示例:

{
    "amount": 20, 
    "deduct_type": 1, 
    "start_time": "",
    "strategy_type": 0
}
1
2
3
4
5
6

周期性策略请求示例:

{
    "name": "洗车费",
    "amount": 10, 
    "start_time": "2021-10-02",
    "period_type": 0,
    "strategy_type": 2,
    "strategy_fee_type": 1002
}
1
2
3
4
5
6
7
8

请求示例:

{
  "fleet_id": 10000000000000,
  "drive_id": 50000000000000,
  "location_country": "RU",
  "lang": "ru-RU",
  "strategy_info": {
    "cap_amount": 2000, 
    "deduct_type": 0, 
    "start_time": "",
    "strategy_type": 0,
    "percent": 18
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success"
}
1
2
3
4

异常情况

{
    "errno": 10001,
    "msg": "parameter error."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 删除司机工作条件

功能: 删除司机工作条件

方法: POST

URL: /fleet/open-api/drivers/delWorkCondition

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_id int64 司机ID
id int64 策略id
location_country string 所属国家
lang string 语言

返回参数:

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success"
}
1
2
3
4

异常情况

{
    "errno": 10004,
    "msg": "fleet have no permission for this driver"
}
{
    "errno":-1
    "msg":"order strategy can not be delete"
}
1
2
3
4
5
6
7
8

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 获取司机信息

功能: 获取司机信息,返回“已绑定”状态的司机信息

方法: POST

URL: /fleet/open-api/drivers/getDriverList

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
page int32 页码,范围[1,1000000]
size int32 每页订单数量,范围[1,100]
location_country string 所属国家
lang string 语言
uranus_product_id int32 产品线,默认值为2,枚举值见附录“产品线”

返回司机信息参数说明:

参数 类型 说明
driver_id int64 司机ID
driver_name string 司机姓名
family_name string 司机姓氏
given_name string 司机名字
father_name string 司机父亲名字
driver_phone string 司机手机号
driver_status int32 司机状态。枚举值:见附录“司机状态”
driver_status_desc string 司机状态说明
work_status int32 工作状态。枚举值: 见附录“工作状态”
work_status_desc int32 工作状态说明
registration_city string 注册城市

返回车辆信息参数说明:

参数 类型 说明
car_id int64 车辆id
plate_no string 车牌号码
brand_name string 车辆品牌
car_status string 车辆审核状态。枚举值:见附录“车辆审核状态”

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success",
    "data": {
      "response": {
        "list": [{
          "car": [{
            "car_id": 50000000000000,
            "plate_no": "688AZZ15",
            "brand_name": "现代伊兰特",
            "car_status": 1
          }],
          "car_count": 1,
          "driver":{
            "driver_id": 50000000000000,
            "driver_name": "测试号571********786",
            "family_name": "zhang",
            "given_name": "san",
            "father_name": "",
            "driver_phone": "**********",
            "driver_status": 3,
            "driver_status_desc": "Approved",
            "work_status": 1,
            "work_status_desc": "Trip in progress",
            "registration_city": "北京"
          }
        }],
        "count": 1
      },
      "trace_id": "0a6072d45f3cdd6be61db3f9ffdfc9b0"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

异常情况

{
    "errno": 20002,
    "msg": "the driver does not exist."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式

# 司机统计信息

功能: 车头查看司机订单统计信息

方法: POST

URL: /fleet/open-api/drivers/getOrderSummary

请求参数:

参数 类型 是否必填 说明
fleet_id int64 车头ID
driver_id_list object 司机ID列表
start_date string 开始日期, 最早时间为三个月前的日期,时间格式为ISO8601
end_date string 结束日期,最大时间为开始时间后一个月,时间格式为ISO8601
location_country string 所属国家
lang string 语言

返回参数:

参数 类型 说明
driver_id int64 司机ID
driver_name string 司机姓名
fleet_id int64 车头ID
driver_phone string 司机手机号
online_time float64 总在线时长,精确到小时点后两位(单位:小时)
dispatch_orders int64 派单数
acceptance_num int64 接单数
acceptance_rate string 接单率
completion_num int64 完单数
completion_rate string 完单率
passenger_cancel_orders int64 乘客取消的订单数
driver_cancel_orders int64 司机取消的订单数
others_cancel_orders int64 其他原因取消的订单数
orders_paid_num int64 已完成并已支付的订单数
paid_transactions string 已完成并已支付的订单总额
currency_code string 货币代码

请求示例:

{
  "fleet_id": 10000000000000,
  "drive_id_list": [60000000000000,60000000000001],
  "location_country": "RU",
  "lang": "ru-RU",
  "start_date": "2021-01-01T00:00:00+03:00",
  "end_date": "2021-01-30T00:00:00+03:00"
}
1
2
3
4
5
6
7
8

返回示例:

正常情况

{
    "errno": 0,
    "msg": "success",
    "data": {
      "response": {
        "detail": [
          {
            "driver_id": 50000000000000,
            "driver_name": "测试号50000000000000",
            "fleet_id": 10000000000000,
            "driver_phone": "*********",
            "online_time": 68.40,
            "dispatch_orders": 50,
            "acceptance_num": 30,
            "acceptance_rate": "60%",
            "completion_num": 30,
            "completion_rate": "60%",
            "passenger_cancel_orders": 10,
            "driver_cancel_orders": 5,
            "others_cancel_orders": 5,
            "orders_paid_num": 30,
            "paid_transactions": "150.50",
            "trip_distance": "100.01",
            "currency_code": "RUB"
          }
        ],
        "count": 1
      },
      "trace_id": "0a6072d45f3cdd6be61db3f9ffdfc9b0" 
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

异常情况

{
    "errno": 20002,
    "msg": "the driver does not exist."
}
1
2
3
4

注:返回示例中的“response”是经过解密,反序列化后的json格式