单据创建
- 接口:common/document
- Method:POST
- 数据格式:JSON
- 接口说明:
- 支持单据头、费用行、事项明细行、预算分摊行的创建
- 支持会计/预算科目计算、校验规则、工作流启动、预算更新
- status如果是incomplete,会计算工作流,但是不会发消息
- status如果是submitted,会启动工作流,同时发消息
- status如果是approved,不启动工作流,但是会发消息
- 如果其他状态,不会启动工作流,也不会发消息
- 支持创建单据时校验预算是否超标
- 字段update_budget_then_validate的值等于"Y"
- 单据头参数字段status的值不等于"incomplete"
- 需预先配置好预算检查的校验规则:勾选‘校验接口传输内容’,而且校验对象不能为是‘费用头’或‘费用行’——建议新建校验规则,使用对应的‘单据头(新)’或‘单据行(新)’ (注:如果错误级别是'警告',则单据头参数字段ignore_warning不能等于"Y")
参数
请求参数
| 字段名称 | 字段类型 | 字段描述 | 是否必填 | 长度限制 |
|---|---|---|---|---|
| bizId | String | 唯一标识(UUID) | TRUE |
36 |
| timestamp | Long | 时间戳(ms) | TRUE |
13 |
| data | Object | 请求数据 | TRUE |
/ |
| data.header | Object | 单据头 | TRUE |
/ |
| data.header.claim_line | Array | 费用行 | FALSE |
/ |
| data.header.custom_line | Array | 事项明细行 | FALSE |
/ |
| data.header.budget_line | Array | 预算分摊行 | FALSE |
/ |
| data.header.budget_adjustment_line | Array | 预算调整行 | FALSE |
/ |
| data.header.budget_transfer_line | Array | 预算调拨行 | FALSE |
/ |
| data.header.budget_breakdown_line | Array | 预算分解行 | FALSE |
/ |
| data.enable_delivery_config | String | 启用根据纸单系统配置生成纸单, 生成纸单的节点在单据提交(Y/N) | FALSE |
/ |
| data.update_budget_then_validate | String | 启用在校验前更新预算-校验失败释放预算(Y/N) | FALSE |
/ |
是否必填:
TRUE表示必填,FALSE表示非必填,ONE-OFindex表示同一上标index的字段必填其一
单据头参数
以下字段需在 data.header 路径下传参
| 字段名称 | 字段类型 | 字段描述 | 是否必填 | 长度限制 |
|---|---|---|---|---|
| external_id | String | 外部系统单据号 | TRUE |
64 |
| header_type_code | String | 单据类型编码 | TRUE |
64 |
| status | String | 单据状态 | TRUE |
64 |
| created_by_code | String | 创建人员工号 | ONE-OF1 |
64 |
| created_by_user_name | String | 创建人用户名 | ONE-OF1 |
64 |
| submit_user_code | String | 提交人员工号(创建人有值时可不传,下同) | FALSE |
64 |
| submit_user_name | String | 提交人用户名 | FALSE |
64 |
| charge_user_code | String | 报销人员工号 | FALSE |
64 |
| charge_user_name | String | 报销人用户名 | FALSE |
64 |
| pay_user_code | String | 收款人员工号 | FALSE |
64 |
| pay_user_name | String | 收款人用户名 | FALSE |
64 |
| branch_code | String | 所属公司编码(取值依次为branch_code,charge_department_code,submit_department_code) | ONE-OF2 |
64 |
| charge_department_code | String | 费用承担部门编码 | ONE-OF2 |
64 |
| submit_department_code | String | 提交部门编码 | ONE-OF2 |
64 |
| customer_code | String | 客户编码 | FALSE |
64 |
| project_code | String | 项目编码 | FALSE |
64 |
| supplier_code | String | 供应商编码 | FALSE |
64 |
| period_name | String | 财年期间 | FALSE |
64 |
| absence_code | String | 请假类型编码 | FALSE |
64 |
| branch_account_code | String | 所属公司银行账号 | FALSE |
64 |
| customer_account_code | String | 客户银行账号 | FALSE |
64 |
| supplier_account_code | String | 供应商银行账号 | FALSE |
64 |
| user_account_code | String | 用户银行账号 | FALSE |
64 |
| external_person_code | String | 外部人员账号 | FALSE |
64 |
| external_person_account_code | String | 外部人员银行账号 | FALSE |
64 |
| asset_code | String | 资金编码 | FALSE |
64 |
| asset_type_code | String | 资金类型编码 | FALSE |
64 |
| asset_location_code | String | 资金地址编码 | FALSE |
64 |
| lease_asset_code | String | 租赁资产 | FALSE |
64 |
| submit_date | Long | 提交时间 | FALSE |
13 |
| start_datetime | Long | 开始时间 | FALSE |
13 |
| end_datetime | Long | 结束时间 | FALSE |
13 |
| due_date | Long | 借款到期时间 | FALSE |
13 |
| destination_city_name | String | 出发城市(中文名称,城市映射关系) | FALSE |
64 |
| destination_city_to_name | String | 到达城市(中文名称) | FALSE |
64 |
| destination_cities | String | 多到达城市(中文名称,使用英文,分隔) |
FALSE |
/ |
| ignore_warning | String | 忽略警告 | FALSE |
64 |
| pay_object | String | 支付对象(后续需要生成支付单时该字段必填) | FALSE |
1 |
| pay_status | String | 支付状态(支付单必传,待支付pending,支付中paying,已支付paid,支付错误error) |
FALSE |
16 |
| sub_type | String | 单据子类型 | FALSE |
64 |
| currency_code | String | branch_id对应的本位币缩写 |
FALSE |
64 |
| total_amount | Decimal | 总金额(本位币) | TRUE |
/ |
| total_claim_amount | Decimal | 总发生金额(本位币) | TRUE |
/ |
| total_pay_amount | Decimal | 总付款金额(本位币) | TRUE |
/ |
| total_net_amount | Decimal | 总不含税金额(本位币) | TRUE |
/ |
| total_tax_amount | Decimal | 总税额(本位币) | TRUE |
/ |
| total_pay_currency_amount | Decimal | 总支付金额(支付币种) | TRUE |
/ |
| advance_amount | Decimal | 总借款金额(本位币) | FALSE |
/ |
| description | String | 描述 | FALSE |
255 |
| long_description | String | 长描述 | FALSE |
/ |
| tmc_res_platform | String | 商旅产品平台 | FALSE |
255 |
| tmc_product_type | Array | 商旅产品类型 | FALSE |
/ |
| specific_feature | String | 特定要素 | FALSE |
255 |
| column1-150 | String | 自定义字段 | FALSE |
255 |
| attachments | Array | 默认附件区域 | FALSE |
/ |
| attachments.file_name | String | 默认附件区域-文件名 | FALSE |
255 |
| attachments.attachment_url | String | 默认附件区域-文件地址(远程文件上传) | FALSE |
/ |
| attachments.attachment_type_code | String | 附件类型编码 | FALSE |
无 |
| attachments1 | Array | 附件一区域 | FALSE |
/ |
| attachments1.file_name | String | 附件一区域-文件名 | FALSE |
255 |
| attachments1.attachment_url | String | 附件一区域-文件地址 | FALSE |
/ |
| attachments1.attachment_type_code | String | 附件类型编码 | FALSE |
无 |
| attachments2-49... | ||||
| attachments50 | Array | 附件五十区域 | FALSE |
/ |
| attachments50.file_name | String | 附件五十区域-文件名 | FALSE |
255 |
| attachments50.attachment_url | String | 附件五十区域-文件地址 | FALSE |
/ |
| attachments50.attachment_type_code | String | 附件类型编码 | FALSE |
无 |
| link_header_vos | Array | 支持单头、多头及头行(头行关联需同时传入claim_line.link_vo)关联关系,接口会根据系统前后序关联配置校验报文 |
FALSE |
/ |
| link_header_vos.external_id | String | 前序单据外部系统单据号 | ONE-OF |
64 |
| link_header_vos.document_num | String | 前序单据单据号 | ONE-OF |
64 |
| link_header_vos.header_type_code | String | 前序单据单据类型编码 | TRUE |
64 |
费用行参数
以下字段需在 data.header.claim_line 路径下传参
| 字段名称 | 字段类型 | 字段描述 | 是否必填 | 长度限制 |
|---|---|---|---|---|
| line_type_code | String | 费用类型 | TRUE |
64 |
| charge_user_code | String | 费用行-报销人员工号 | FALSE |
64 |
| charge_user_name | String | 费用行-报销人用户名 | FALSE |
64 |
| pay_user_code | String | 费用行-收款人员工号 | FALSE |
64 |
| pay_user_name | String | 费用行-收款人用户名 | FALSE |
64 |
| cost_center_code | String | 费用行-成本中心编码 | FALSE |
64 |
| customer_code | String | 费用行-客户编码 | FALSE |
64 |
| material_code | String | 费用行-物料编码 | FALSE |
64 |
| product_code | String | 费用行-商品编码 | FALSE |
64 |
| project_code | String | 费用行-项目编码 | FALSE |
64 |
| supplier_code | String | 费用行-供应商账号 | FALSE |
64 |
| unit_code | String | 费用行-单位编码 | FALSE |
64 |
| period_name | String | 费用行-财年期间 | FALSE |
64 |
| customer_account_code | String | 费用行-客户银行账号 | FALSE |
64 |
| supplier_account_code | String | 费用行-供应商银行账号 | FALSE |
64 |
| user_account_code | String | 费用行-用户银行账号 | FALSE |
64 |
| external_person_code | String | 外部人员账号 | FALSE |
64 |
| external_person_account_code | String | 外部人员银行账号 | FALSE |
64 |
| asset_code | String | 资金编码 | FALSE |
64 |
| asset_type_code | String | 资金类型编码 | FALSE |
64 |
| asset_location_code | String | 资金地址编码 | FALSE |
64 |
| lease_asset_code | String | 租赁资产 | FALSE |
64 |
| passenger_codes | Array | 费用行-同行人员工号 | FALSE |
/ |
| passenger_names | Array | 费用行-同行人用户名 | FALSE |
/ |
| destination_city_name | String | 费用行-出发城市(中文名称,城市映射关系) | FALSE |
64 |
| destination_city_to_name | String | 费用行-到达城市(中文名称) | FALSE |
64 |
| from_cities_name | Array | 费用行-来自城市列表(中文名称) | FALSE |
255 |
| to_cities_name | Array | 费用行-目的城市列表(中文名称) | FALSE |
255 |
| receipt_amount | Decimal | 费用行-发票金额 | TRUE |
/ |
| original_amount | Decimal | 费用行-原始发票金额 | FALSE |
/ |
| receipt_currency | String | 费用行-发票币种 | FALSE |
64 |
| claim_currency | String | 费用行-本位币种 | FALSE |
64 |
| exchange_rate | Decimal | 费用行-发票汇率(发票币种对本位币) | FALSE |
/ |
| claim_amount | Decimal | 费用行-发生金额(本位币)receipt_amount * exchange_rate |
TRUE |
/ |
| accumulation_type_id | Integer | 费用行-费用计算方式 | FALSE |
11 |
| accumulation_claim_amount | Decimal | 费用行-费用计算方式调整金额(本位币)claim_amount * accumulation_type.factor |
TRUE |
/ |
| tax_code | String | 费用行-税率编码 | FALSE |
64 |
| tax_amount | Decimal | 费用行-税额original_amount * exchange_rate * (tax_code.rate) / (1 + tax_code.rate) |
TRUE |
/ |
| net_amount | Decimal | 费用行-不含税金额claim_amount - tax_amount |
TRUE |
/ |
| pay_currency | String | 费用行-支付币种 | FALSE |
64 |
| pay_exchange_rate | Decimal | 费用行-支付汇率(发票币种对支付币种) | FALSE |
/ |
| pay_method_id | Integer | 费用行-支付方式 | FALSE |
11 |
| pay_amount | Decimal | 费用行-付款金额(发票币种)receipt_amount * pay_method.factor |
TRUE |
/ |
| pay_claim_amount | Decimal | 费用行-付款金额(本位币)claim_amount * pay_method.factor |
TRUE |
/ |
| pay_currency_amount | Decimal | 费用行-付款金额(支付币种)receipt_amount * pay_exchange_rate |
TRUE |
/ |
| quantity | Decimal | 费用行-数量 | FALSE |
/ |
| price | Decimal | 费用行-单价 | FALSE |
/ |
| net_price | Decimal | 费用行-不含税单价 | FALSE |
/ |
| offset_detail | Array | 费用行-偏移细节 | FALSE |
/ |
| expense_id | Integer | 费用行-消费记录ID(被其他单据占用时无法创建,单据状态为cancelled时解除占用) | FALSE |
11 |
| line_num | String | 费用行-行号(需要被行行关联时必填,同一张单据所有费用行之间行号不能相同) |
FALSE |
64 |
| pay_object | String | 费用行-支付对象(后续需要生成支付单时该字段必填) | FALSE |
1 |
| attachment_count | Integer | 费用行-发票张数 | FALSE |
10 |
| order_complete | String | 费用行-下单完成(Y/N) |
FALSE |
1 |
| claim_complete | String | 费用行-核销完成(Y/N) |
FALSE |
1 |
| receive_complete | String | 费用行-验收完成(Y/N) |
FALSE |
1 |
| invoice_complete | String | 费用行-收票完成(Y/N) |
FALSE |
1 |
| address | Object | 费用行-地址 | FALSE |
/ |
| comments | String | 费用行-描述 | FALSE |
255 |
| long_comments | String | 费用行-长描述 | FALSE |
/ |
| tmc_res_platform | String | 商旅产品平台 | FALSE |
255 |
| column1-150 | String | 费用行-自定义字段 | FALSE |
255 |
| attachments | Array | 费用行-默认附件区域 | FALSE |
/ |
| attachments.file_name | String | 费用行-默认附件区域-文件名 | FALSE |
255 |
| attachments.attachment_url | String | 费用行-默认附件区域-文件地址(远程文件上传) | FALSE |
/ |
| attachments1 | Array | 费用行-附件一区域 | FALSE |
/ |
| attachments1.file_name | String | 费用行-附件一区域-文件名 | FALSE |
255 |
| attachments1.attachment_url | String | 费用行-附件一区域-文件地址 | FALSE |
/ |
| attachments1.attachment_type_code | String | 附件类型编码 | FALSE |
无 |
| attachments2-9... | ||||
| attachments10 | Array | 费用行-附件十区域 | FALSE |
/ |
| attachments10.file_name | String | 费用行-附件十区域-文件名 | FALSE |
255 |
| attachments10.attachment_url | String | 费用行-附件十区域-文件地址 | FALSE |
/ |
| attachments10.attachment_type_code | String | 附件类型编码 | FALSE |
无 |
| link_vo | Object | 费用行-头行/行行关联关系(头行需同时传入header.link_header_vos) |
FALSE |
/ |
| link_vo.external_id | String | 费用行-前序单据外部系统单据号 | ONE-OF |
64 |
| link_vo.document_num | String | 费用行-前序单据单据号 | ONE-OF |
64 |
| link_vo.header_type_code | String | 费用行-前序单据类型 | TRUE |
64 |
| link_vo.line_num | String | 费用行-前序单据行行号,传值行号时关联关系为行行关联,未传值时为头行关联 |
FALSE |
64 |
| link_ledger_lines | Array | 费用行-关联台账行 | FALSE |
/ |
| link_ledger_lines.ledger_num | String | 台账号 | TRUE |
64 |
| link_ledger_lines.ledger_line_num | String | 台账行号 | TRUE |
64 |
| link_ledger_lines.ledger_config_code | String | 台账类型编码 | TRUE |
64 |
| link_ledger_lines.change_flag | String | 对台账操作类型(U:更新,C:变更,N:新增,D:删除) | FALSE |
64 |
事项明细行参数
以下字段需在 data.header.custom_line 路径下传参
| 字段名称 | 字段类型 | 字段描述 | 是否必填 | 长度限制 |
|---|---|---|---|---|
| custom_line_type_code | String | 事项明细行-类型 | TRUE |
64 |
| cost_center_code | String | 事项明细行-成本中心编码 | FALSE |
64 |
| customer_code | String | 事项明细行-客户编码 | FALSE |
64 |
| supplier_code | String | 事项明细行-供应商编码 | FALSE |
64 |
| charge_user_code | String | 事项明细行-人员员工号 | FALSE |
64 |
| charge_user_name | String | 事项明细行-人员用户名 | FALSE |
64 |
| passenger_codes | Array | 事项明细行-人员员工号列表 | FALSE |
/ |
| passenger_names | Array | 事项明细行-人员用户名列表 | FALSE |
/ |
| project_code | String | 事项明细行-项目编码 | FALSE |
64 |
| destination_city_name | String | 事项明细行-出发城市(中文名称,城市映射关系) | FALSE |
64 |
| destination_city_to_name | String | 事项明细行-到达城市(中文名称) | FALSE |
64 |
| destination_cities | String | 事项明细行-多到达城市(中文名称,英文,分隔) |
FALSE |
/ |
| start_datetime | Long | 事项明细行-开始时间 | FALSE |
13 |
| end_datetime | Long | 事项明细行-结束时间 | FALSE |
13 |
| attendee_number | Integer | 事项明细行-人数 | FALSE |
/ |
| duration_day | Decimal | 事项明细行-时长(天) | FALSE |
/ |
| duration_hour | Decimal | 事项明细行-时长(小时) | FALSE |
/ |
| duration_minute | Decimal | 事项明细行-时长(分钟) | FALSE |
/ |
| lease_asset_code | String | 事项明细行-租赁资产 | FALSE |
/ |
| comments | String | 事项明细行-描述 | FALSE |
255 |
| long_comments | String | 事项明细行-长描述 | FALSE |
/ |
| column1-100 | String | 事项明细行-自定义字段 | FALSE |
255 |
| attachments1 | Array | 事项明细行-附件一区域 | FALSE |
/ |
| attachments1.file_name | String | 事项明细行-附件一区域-文件名 | FALSE |
255 |
| attachments1.attachment_url | String | 事项明细行-附件一区域-文件地址(远程文件上传) | FALSE |
/ |
| attachments1.attachment_type_code | String | 附件类型编码 | FALSE |
无 |
| attachments2-9... | ||||
| attachments10 | Array | 事项明细行-附件十区域 | FALSE |
/ |
| attachments10.file_name | String | 事项明细行-附件十区域-文件名 | FALSE |
255 |
| attachments10.attachment_url | String | 事项明细行-附件十区域-文件地址 | FALSE |
/ |
| attachments10.attachment_type_code | String | 附件类型编码 | FALSE |
无 |
预算分摊行参数
以下字段需在 data.header.budget_line 路径下传参
| 字段名称 | 字段类型 | 字段描述 | 是否必填 | 长度限制 |
|---|---|---|---|---|
| period_name | String | 预算分摊行-财年期间编码 | FALSE |
64 |
| cost_center_code | String | 预算分摊行-成本中心编码 | FALSE |
64 |
| supplier_code | String | 预算分摊行-供应商编码 | FALSE |
64 |
| charge_department_code | String | 预算分摊行-部门编码 | FALSE |
64 |
| charge_user_code | String | 预算分摊行-人员员工号 | FALSE |
64 |
| charge_user_name | String | 预算分摊行-人员用户名 | FALSE |
64 |
| budget_amount | Decimal | 预算分摊行-分摊金额 | FALSE |
/ |
| budget_currency | String | 预算分摊行-分摊币种 | FALSE |
16 |
| ratio | Decimal | 预算分摊行-分摊比例(小数) | FALSE |
/ |
| column1-100 | String | 预算分摊行-自定义字段 | FALSE |
255 |
预算调整行参数
以下字段需在 data.budget_adjustment_line 路径下传参
| 字段名称 | 字段类型 | 字段描述 | 是否必填 | 长度限制 |
|---|---|---|---|---|
| period_name | String | 预算调整行-财年期间编码 | FALSE |
64 |
| budget_code | String | 预算调整行-预算科目编码 | FALSE |
64 |
| supplier_code | String | 预算调整行-供应商编码 | FALSE |
64 |
| department_code | String | 预算调整行-部门编码 | FALSE |
64 |
| user_code | String | 预算调整行-人员员工号 | FALSE |
64 |
| user_name | String | 预算调整行-人员用户名 | FALSE |
64 |
| project_code | String | 预算调整行-项目编码 | FALSE |
64 |
| adjustment_amount | Decimal | 预算调整行-分摊币种 | FALSE |
/ |
| comments | String | 预算调整行-描述 | FALSE |
255 |
| column1-10 | String | 预算调整行-自定义字段 | FALSE |
255 |
预算调拨行参数
以下字段需在 data.budget_transfer_line 路径下传参
| 字段名称 | 字段类型 | 字段描述 | 是否必填 | 长度限制 |
|---|---|---|---|---|
| period_name_in | String | 预算调拨行(转入)- 财年期间编码 | FALSE |
64 |
| budget_code_in | String | 预算调拨行(转入)- 预算科目编码 | FALSE |
64 |
| supplier_code_in | String | 预算调拨行(转入)- 供应商编码 | FALSE |
64 |
| department_code_in | String | 预算调拨行(转入)- 部门编码 | FALSE |
64 |
| user_code_in | String | 预算调拨行(转入)- 人员员工号 | FALSE |
64 |
| user_name_in | String | 预算调拨行(转入)- 人员用户名 | FALSE |
64 |
| project_code_in | String | 预算调拨行(转入)- 项目编码 | FALSE |
64 |
| period_name_out | String | 预算调拨行(转出)- 财年期间编码 | FALSE |
64 |
| budget_code_out | String | 预算调拨行(转出)- 预算科目编码 | FALSE |
64 |
| supplier_code_out | String | 预算调拨行(转出)- 供应商编码 | FALSE |
64 |
| department_code_out | String | 预算调拨行(转出)- 部门编码 | FALSE |
64 |
| user_code_out | String | 预算调拨行(转出)- 人员员工号 | FALSE |
64 |
| user_name_out | String | 预算调拨行(转出)- 人员用户名 | FALSE |
64 |
| project_code_out | String | 预算调拨行(转出)- 项目编码 | FALSE |
64 |
| adjustment_amount | Decimal | 预算调拨行 - 金额 | FALSE |
/ |
| column1-10 | String | 预算调拨行 - 自定义字段 | FALSE |
255 |
预算分解行参数
以下字段需在 data.budget_breakdown_line 路径下传参
| 字段名称 | 字段类型 | 字段描述 | 是否必填 | 长度限制 |
|---|---|---|---|---|
| period_name | String | 预算分解行-财年期间编码 | FALSE |
64 |
| budget_code | String | 预算分解行-预算科目编码 | FALSE |
64 |
| supplier_code | String | 预算分解行-供应商编码 | FALSE |
64 |
| department_code | String | 预算分解行-部门编码 | FALSE |
64 |
| user_code | String | 预算分解行-人员员工号 | FALSE |
64 |
| user_name | String | 预算分解行-人员用户名 | FALSE |
64 |
| project_code | String | 预算分解行-项目编码 | FALSE |
64 |
| adjustment_amount | Decimal | 预算分解行-分摊币种 | FALSE |
/ |
| comments | String | 预算分解行-描述 | FALSE |
255 |
| column1-10 | String | 预算分解行-自定义字段 | FALSE |
255 |
返回参数
| 字段名称 | 字段类型 | 字段描述 |
|---|---|---|
| resCode | Integer | 响应状态码 |
| resMsg | String | 返回信息描述 |
| data | Object | 返回数据 |
| data.error | String | 失败信息 |
示例
请求示例
1.
{
"bizId": "4aba2901-8b53-40f5-91fc-e8f375cddc84",
"timestamp": 1614053054469,
"data": {
"enable_delivery_config": "N",
"header": {
"external_id": "RVhQMDAwMDAwMDAwMQ==",
"header_type_code": "T014",
"status": "incomplete",
"created_by_code": "0101106",
"branch_code": "105",
"submit_department_code": "32006",
"charge_department_code": "32006",
"customer_account_number": "6217788314500000315",
"supplier_code": "100662",
"currency_code": "CNY",
"total_amount": 340.00,
"total_claim_amount": 340.00,
"total_net_amount": 300.88,
"total_tax_amount": 39.12,
"specific_feature": "01",
"tmc_res_platform": "didi",
"tmc_product_type": [
"taxi"
],
"column1": "300.88",
"column10": "0.00",
"column13": "CT02",
"column14": "光谷大道6号门",
"column15": "CON0223000021",
"column47": "PO0223000016",
"column48": "340.00",
"link_header_vos": [
{
"external_id": "UkVRMDAwMDAwMDAwMg==",
"header_type_code": "T014"
}
],
"attachments": [
{
"file_name": "file_name.png",
"attachment_url": "通过文件上传接口获取到的文件key.png",
"attachment_type_code": "test"
}
],
"attachments1": [
{
"file_name": "file_name1.png",
"attachment_url": "通过文件上传接口获取到的文件key.png",
"attachment_type_code": "test"
}
],
"attachments10": [
{
"file_name": "file_name10.png",
"attachment_url": "通过文件上传接口获取到的文件key.png",
"attachment_type_code": "test"
}
],
"customized_account_vo": {
"account_number": "12312313123",
"account_name": "测试银行",
"currency_code": [
"CNY"
],
"bank_name": "测试",
"bank_branch": "test",
"bank_swift_id": "2435",
"payment_type": [
"Bank draft"
],
"bank_address": "local",
"account_type": "private",
"state": "测试",
"city": "上海市"
},
"claim_line": [
{
"line_type_code": "T50",
"cost_center_code": "32006",
"project_code": "FD004.2",
"tax_code": "TAX_IN_13",
"receipt_currency": "CNY",
"receipt_amount": 340.00,
"claim_amount": 340.00,
"net_amount": 300.88,
"tax_amount": 39.12,
"tmc_res_platform": "didi",
"column1": "column1",
"column4": "1",
"column24": "119",
"column27": "0",
"column51": "column51",
"link_vo": {
"external_id": "8fb352f01a97",
"header_type_code": "RT014",
"line_num": "1"
},
"link_ledger_lines": [
{
"ledger_num": "314",
"ledger_line_num": "776",
"ledger_config_code": "90636",
"change_flag": "U"
}
],
"customized_account_vo": {
"account_number": "12312313123",
"account_name": "测试银行",
"currency_code": [
"CNY"
],
"bank_name": "测试",
"bank_branch": "test",
"bank_swift_id": "2435",
"payment_type": [
"Bank draft"
],
"bank_address": "local",
"account_type": "private",
"state": "测试",
"city": "上海市"
}
}
],
"custom_line": [
{
"custom_line_type_code": "T02",
"cost_center_code": "D1",
"customer_code": "MKS",
"supplier_code": "AK001",
"charge_user_name": "aaa@cloudpense.com",
"passenger_names": [
"aaa@cloudpense.com",
"bbb@cloudpense.com"
],
"project_code": "DRHG1",
"destination_city_name": "上海",
"destination_city_to_name": "北京",
"destination_cities": "上海,北京",
"start_datetime": 1681660800000,
"end_datetime": 1681747200000,
"attendee_number": 2,
"duration_day": 1.0,
"duration_hour": 24.0,
"duration_minute": 1440.0,
"comments": "comments",
"long_comments": "long_comments",
"column1": "100",
"column14": "1400"
}
],
"budget_line": [
{
"period_name": "2023年5月",
"cost_center_code": "C004300249",
"supplier_code": "0070002396",
"charge_department_code": "D1",
"charge_user_name": "test@cloudpense.com",
"project_code": "apipro003",
"budget_amount": 340.00,
"budget_currency": "CNY",
"ratio": 1.0,
"column1": "100",
"column51": "5100"
}
],
"budget_adjustment_line": [
{
"adjustment_amount": 501.00,
"period_name": "2024年11月份",
"budget_code": "002",
"department_code": "B0001",
"supplier_code": "191",
"project_code": "300201",
"column10": "B2"
}
],
"budget_transfer_line": [
{
"adjustment_amount": 501.00,
"period_name_in": "2024年11月份",
"budget_code_in": "002",
"department_code_in": "B0001",
"supplier_code_in": "191",
"project_code_in": "300201",
"period_name_out": "2024年12月份",
"budget_code_out": "003",
"supplier_code_out": "190",
"project_code_out": "300211",
"column10": "B2"
}
]
}
}
}
2. 提交单据创建时进行预算校验
参数字段update_budget_then_validate为'Y'; 单据头参数字段status为'submitted',即目标状态为‘已提交’。
参考返回示例3
{
"bizId": "4aba2901-8b53-40f5-91fc-e8f375cddfff",
"timestamp": 1761046729469,
"data":{
"enable_delivery_config": "N",
"update_budget_then_validate":"Y",
"header": {
"external_id":"ToTestValuleDoc04",
"header_type_code":"T001",
"user_account_code":"89732098309382323",
"total_amount":18,
"total_claim_amount":18,
"advance_amount":0,
"total_pay_amount":18,"total_net_amount":18,"total_tax_amount":0,"total_pay_currency_amount":18,
"currency_code":"CNY",
"status":"submitted",
"created_by_code":"89928323",
"charge_department_code":"YF002",
"submit_user_code":"89928323","charge_user_code":"89928323","pay_user_code":"89928323",
"claim_line":[
{
"line_type_code":"T023",
"receipt_amount":18,"receipt_currency":"CNY","claim_amount":18,"accumulation_claim_amount":18,"tax_amount":0,
"claim_currency":"CNY","exchange_rate":1,"pay_amount":18,
"pay_method_id":48946,
"created_by_code":"89928323",
"attendee_number":0,
"net_amount":18,"pay_claim_amount":18,"pay_currency_amount":18,
"accumulation_type_id":21,"cost_center_code":"YF002","period_name":"2025年-05",
"pay_currency":"CNY",
"pay_exchange_rate":1,
"adjust_point": 72,
"link_ledger_lines":[],"to_cities_name":[]
}
]
}
}
}
返回示例
1. 创建成功
{
"resCode": 200000,
"resMsg": "创建成功",
"data": {
"header": {
"header_id": 12204,
"company_id": 20387,
"document_id": 12204,
"document_num": "REQ0000001577",
"status": "approved",
"header_type_id": 155693,
"external_id": "e8f375cddc84",
"total_amount": 340.00,
"currency_code": "CNY",
"specific_feature": "01",
"tmc_res_platform": "didi",
"tmc_product_type": [
"taxi"
],
"column1": "300.88",
"column10": "0.00",
"column13": "CT02",
"column14": "光谷大道6号门",
"column15": "CON0223000021",
"column47": "PO0223000016",
"column48": "340.00"
}
}
}
2. 参数错误导致单据创建失败
{
"resCode": 500060,
"resMsg": "校验失败",
"data": {
"error": "header中单据类型header_type_code值ZD20错误"
}
}
3. 预算校验失败,单据创建但状态置为incomplete表示‘未提交’,并带上校验记录
{
"resCode": 200000,
"resMsg": "创建成功!",
"data": {
"header": {
"ledger1": 35216,
"ledger2": 35218,
"status": "incomplete",
"company_id": 17895,
"note": "",
"external_id": "ToTestValuleDoc04",
"header_id": 19299102,
"document_id": 19299102,
"document_num": "EXP0000003869",
"internal_type": "claim",
"total_amount": 18,
"total_claim_amount": 18,
"advance_amount": 0,
"total_pay_amount": 18,
"currency_code": "CNY",
"total_pay_currency_amount": 18,
"submit_date": 1761304085411,
"formula_description": "{\"amount_obj\": {\"value\": \"\", \"amount_column\": \"\"}, \"description\": \"\"}",
"branch_id": 104152,
"submit_department_id": 104153,
"charge_department_id": 104193,
"submit_user_id": 224129,
"charge_user_id": 224129,
"pay_user": 224129,
"user_account_id": 146835,
"header_type_id": 144555,
"column_json": "{}",
"created_by": 224129,
"creation_date": 1761304085411,
"last_updated_by": 224129,
"last_update_date": 1761304085411,
"total_net_amount": 18,
"total_tax_amount": 0
},
"valRuleResultList": [
{
"source": "NEXP",
"rule_id": 217753017,
"exception_level": 99,
"source_id": 19299102,
"header_id": 19299102,
"exception_message": "单据提交超预算,提交失败——请修改单据或确保预算充足后再次提交"
}
]
}
}