# 接口说明
- 1.如果有审批业务,则需要进行通过该接口创建审批单,在下单时可以选择创建的相应审批单
- 2.如果审批单中包含相应的规则信息,则可以创建相应的规则,如果审批单不使用规则相关信息,则不需要传递
- 3.增加国际机票审批
- 4.相同审批单ID创建返回成功 判断审批单是否存在 相同审批 说明审批已存在
| 名称 | 描述 |
|---|---|
| HTTP方法 | POST |
| Content-Type | application/x-www-form-urlencoded |
| method | /openapi/func/apply/trip/create |
| 字段 | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| access_token | token | string | Y | 登录 token |
| sign | 签名 | string | Y | oihfnlyeofdh98 |
| timestamp | 时间戳 | long | Y | 13位时间戳 1241243250000 |
| employee_id | 用户ID | string | Y | 分贝用户id或者第三方用户id,为创建人的ID |
| employee_type | 用户类型 | string | Y | 类型,0为分贝用户,1为第三方用户 |
| data | 请求数据 | jsonobject | Y | 请求数据 |
| data.apply | 申请单内容 | jsonobject | Y | 申请单详细内容 |
| data.apply.type | 申请单业务类型 | integer | Y | 1.差旅,固定为1(对应trip_list下的type值为7、11、15) |
| data.apply.apply_reason | 申请事由 | String | N | 申请事由,不能超过200字符 |
| data.apply.flow_type | 审批类型 | integer | Y | 固定为4 |
| data.apply.third_id | 申请单id | string | Y | 第三方审批单id,不可重复 |
| data.apply.third_remark | 第三方备注 | string | Y | 详细备注信息 |
| data.apply.budget | 申请单预算 | integer | Y | 预算总额(为trip_list中estimated_amount的总和 ) |
| data.apply.apply_reason_desc | 申请事由补充说明 | string | N | 补充事由说明,小于500,对应web后台单据信息中的申请事由,若需后台展示使用则为必填 |
| data.apply.cost_attribution_list | 费用归属对象集合 | jsonarray | N | 费用归属对象集合 |
| data.apply.cost_attribution_list.cost_attribution_id | 费用归属id | string | N | 部门ID或项目ID,需使用三方id,当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.cost_attribution_list.cost_attribution_name | 费用归属name | string | N | 部门名称或项目名称,当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.cost_attribution_list.cost_attribution_category | 费用归属类型 | integer | N | 1.部门 2.项目 当传递费用归属时,费用归属三个属性必须同时传递,否则无法识别 |
| data.apply.new_cost_attributions | (新)费用归属对象集合 | jsonarray | N | (新)费用归属对象集合 |
| data.apply.new_cost_attributions.type | (新)费用归属类型 | Integer | N | (新)费用归属类型1.部门 2.项目,3自定义档案 |
| data.apply.new_cost_attributions.third_archive_id | (新)三方自定义档案id | string | N | 三方自定义档案id(type为3时必传) |
| data.apply.new_cost_attributions.archive_name | (新)自定义档案名称 | string | N | 自定义档案名称(type为3时必传) |
| data.apply.new_cost_attributions.details | (新)费用归属详情 | jsonArray | N | (新)费用归属详情 |
| data.apply.new_cost_attributions.details.third_id | (新)三方费用归属id | string | N | 费用归属类型(type)为1时,该字段值为部门三方id;费用归属类型(type)为2时,该字段为项目三方ID;费用归属类型(type)为3时,该字段值为自定义档案项目三方ID |
| data.apply.new_cost_attributions.details.name | (新)费用归属名称 | string | N | 费用归属类型(type)为1时,该字段值为部门name;费用归属类型(type)为2时,该字段为项目name;费用归属类型(type)为3时,该字段值为自定义档案项目name |
| data.guest_list | 出行联系人信息 | jsonarray | N | 出行联系人信息,当出行人为企业员工时id、is_employee、employee_type、name信息必填,出行人非企业员工时,is_employee,name必填 |
| data.guest_list.id | 出行人id | string | N | 出行人id(分贝用户ID),当is_employee为false时,不需要传递id,为true时必传 |
| data.guest_list.is_employee | 是否是企业员工 | boolean | N | true,false,有出行联系人guest_list时该字段必填 |
| data.guest_list.employee_type | 出行联系人类型 | integer | N | 0为分贝用户,1为第三方用户。当is_employee为false时,不需要传递,为true时必传 |
| data.guest_list.name | 出行联系人姓名 | string | N | 张三,有出行联系人guest_list时该字段必填 |
| data.guest_list.phone_num | 出行联系人手机号 | string | N | 非企业员工时则为非必填 |
| data.custom_fields | 自定义字段列表 | jsonarray | N | 自定义字段列表(自定义字段传递时需把字段值告知分贝通,分贝通进行相应配置后,在后台导出审批单时会导出相应字段,否则字段传递值无效) |
| data.trip_list | 行程列表 | jsonarray | Y | 行程列表 |
| data.trip_list.type | 业务类型 | integer | Y | 行程类型 7.机票 11.酒店 15.火车 40.国际/中国港澳台机票 |
| data.trip_list.start_city_id | 出发城市ID | string | Y | 在酒店业务中,start_city_id和arrival_city_id都传入目的地城市ID,可通过13.1.2查询城市编码接口获取 |
| data.trip_list.start_time | 出发时间 | string | Y | 行程开始日期 2017-12-13 |
| data.trip_list.arrival_city_id | 目的地城市 | string | Y | 行程到达城市ID,可通过13.1.2查询城市编码接口获取 |
| data.trip_list.end_time | 结束时间 | string | Y | 行程结束日期 2017-12-29(在分贝通企业管理后台需开启出发日期配置成时间范围后,可创建时间段审批单) |
| data.trip_list.estimated_amount | 预估价格 | integer | Y | 100,单位分 |
| data.trip_list.back_start_time | 返程开始日期 | string | N | 返程开始日期 行程为国际机票且航程为返程类型则必填 |
| data.trip_list.back_end_time | 返程结束日期 | string | N | 返程结束日期 行程为国际机票且航程为返程类型则必填 |
| data.trip_list.trip_type | 航程类型 | integer | N | 航程类型 1单程 2往返 行程为国际机票则必填 |
| data.air_rule_info.air_type | 舱位等级 | array | N | 1:商务舱(头等舱), 3:经济舱 |
| data.air_rule_info.price | 价格限制 | double | N | 100 单位元 |
| data.intl_air_rule_info.air_type | 国际机票舱位等级 | array | N | 1:商务舱(头等舱), 3:经济舱 |
| data.intl_air_rule_info.price | 国际机票价格限制 | double | N | 100 单位元 |
| data.hotel_rule_info.level | 星级 | array | N | 0.二星及以下 1.三星 2.四星 3.五星 |
| data.hotel_rule_info.price | 平均每晚的上限 | double | N | 100,单位元 |
| data.hotel_rule_info.person_pay | 个人支付 | boolean | N | 个人支付 |
| data.train_rule_info.common_train_seat_type | 普通列车席别限制 | array | N | 11.高级软卧 12.软卧 13.硬卧 14.软座 15.硬座 16.无座 |
| data.train_rule_info.highspeed_train_seat_type | 高铁席别限制 | array | N | 1.商务座 2.特等座 3.一等座 4.二等座 5.软卧 6.高铁无座 7.高级软卧 8.动卧 9.硬卧 |
| data.train_rule_info.price | 价格限制 | double | N | 100,单位元 |
请求示例:
"access_token":"5747fbc10f0e60e0709d8d722",
"timestamp":1635820323000,
"sign":"oihfnlyeofdh98",
"employee_id":"59b74c1323445f2d54dd07922",
"employee_type":"1",
"data":
{
"apply": {
"type": 1,
"apply_reason":"",
"flow_type": 4,
"budget": 1,
"third_id": "59dc7fe62798635263b8414a",
"third_remark": "approve-openapi-test2",
"apply_reason_desc": "不是出去玩",
"new_cost_attributions":[
{
"type":"1",
"third_archive_id":"5f361f6523445f0f90a7a8db",
"archive_name":"xxx",
"details":[
{
"third_id":"5f361f652323223445f0f90a7a8db",
"name":"xxx"
}
]
}
],
"cost_attribution_list": [{
"cost_attribution_id": "od-2fd01a3037c27fff0cba7a34d1c2bb07",
"cost_attribution_name": "开放平台",
"cost_attribution_category": 1
},
{
"cost_attribution_id": "5a66b2c1235f2417491280",
"cost_attribution_name": "test1",
"cost_attribution_category": 2
}
]
},
"guest_list": [{
"id": "58dca3035f281a5c225c4d84",
"is_employee": false,
"name": "韩美美",
"phone_num": "18518270668"
}],
"custom_fields": [{
"type": "cost_attribution",
"value": "loiewo98498du3j498jder"
}],
"trip_list": [{
"type": 7,
"start_city_id": "2000002",
"start_time": "2017-12-13",
"arrival_city_id": "1000001",
"end_time": "2017-12-13",
"estimated_amount": 1
},
{
"type": 7,
"start_city_id": "2000002",
"start_time": "2017-12-14",
"arrival_city_id": "1000001",
"end_time": "2017-12-14",
"estimated_amount": 1
}
],
"air_rule_info": [{
"type": "air_type",
"value": [
1
]
},
{
"type": "price",
"value": 100
}
],
"intl_air_rule_info": [{
"type": "air_type",
"value": [
1
]
},
{
"type": "price",
"value": 100
}
],
"hotel_rule_info": [{
"type": "level",
"value": [
1
]
},
{
"type": "price",
"value": 100
},
{
"type": "person_pay",
"value": true
}
],
"train_rule_info": [{
"type": "common_train_seat_type",
"value": [
1
]
},
{
"type": "highspeed_train_seat_type",
"value": [
1
]
},
{
"type": "price",
"value": 100
}
]
}
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
响应结果:
{
"request_id":"xUolOnJHWhIO4YP8MozO",
"code":0,
"msg":"success",
"data":{
"id":"58baa2866819481560f013ac"
}
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8