# 企业用餐申请单接口

# 1 企业用餐申请单同步

# 1.1 接入说明

美团企业版为客户提供了用餐申请、报备、审批等功能,如果企业客户希望在内部系统完成用餐申请,在用餐申请单内部审批通过后,在美团企业版用餐支付前关联企业内部用餐申请单,则可以通过本文档进行接口对接。流程如下

  1. 企业内部完成用餐申请,在审批通过后,通过调用接口将用餐申请单信息同步给美团企业版
  2. 企业员工进入美团企业版餐饮页面,选择餐厅进行消费
  3. 企业员工支付前的消费报备页面,关联用餐申请单
  4. 美团企业版验证企业内部用餐申请单的有效性校验,判断员工是否可进行餐饮消费

# 1.2 接口说明

名称 描述
功能 创建用餐申请单
HTTP方法 POST
请求方 第三方渠道
响应方 美团企业版平台
uri /repast/apply/sync
method repast.apply.sync

# 1.3 公共参数

详见:公共参数说明-公共请求参数

# 1.4 业务请求参数

名称 类型 是否非空 说明
outRepastApplyList List<OutRepastApply> 同步的用餐申请列表,单次最多同步10单

OutRepastApply 字段说明

名称 类型 是否非空 说明
sceneType Integer 用餐场景(1-商务宴请;3-商务差旅;4-工作餐;5-团建用餐)
outRepastApplyNo String 外部用餐申请单号
submitStaff StaffInfo 提交人信息
repastApplyName String 申请单主题/名称(限制:64个字符以内)
startTime Long 有效期开始时间(ms时间戳)
endTime Long 有效期结束时间(ms时间戳)
reason String 用餐原因(限制:100个字符以内)
limitAmount String 可用额度(元)示例:51542.50
assistantStaffList List<StaffInfo> 协办人信息列表(协办人为可下单员工)
innerStaffList List<StaffInfo> 内部参与人列表
guestList List<GuestInfo> 外部参与人列表
costCenterList List<CostCenterInfo> 成本中心列表
repastCityList List<RepastCity> 用餐城市列表
invoiceInfo InvoiceInfo 发票信息

StaffInfo 字段说明

名称 类型 是否非空 示例 说明
staffId Long 10001 美团企业版员工staffId(优先取staffId)
name String 张三 员工姓名
entStaffNum String C20210322 企业对该员工的唯一标识

GuestInfo 字段说明

名称 类型 是否非空 示例 说明
name String 张三 外部人员姓名
company String 北京三快在线科技有限公司 外部出行人所在公司全名
department String 北京三快在线科技有限公司 外部人员所属部门
phone String 13000000000 外部出行人手机号, 手机号和证件信息必须有一个存在
outGuestId String GUEST01 企业外部人员唯一标识

CostCenterInfo 字段说明

名称 类型 是否非空 示例 说明
costNo String CC01 成本中心编码
costName String 成本中心01 成本中心名称
ratio String C20210322 成本分摊比例,例如 0.50 表示百分之五十
customField1 String 扩展字段1 扩展字段1
customField2 String 扩展字段2 扩展字段2
customField3 String 扩展字段3 扩展字段3
customField4 String 扩展字段4 扩展字段4
customField5 String 扩展字段5 扩展字段5

RepastCity 字段说明

名称 类型 是否非空 示例 说明
cityId String 110100 城市编码(国标),枚举数据详见:行政区划查询接口,且仅支持市级城市,如:北京市-110000
cityName String 北京市 城市名称

InvoiceInfo 字段说明
额外说明:唯一标识为①(税号)、②(发票Id),两种唯一标识不允许同时为空。

名称 类型 是否非空 示例 说明
invoiceTitle String 北京三快在线科技有限公司 发票抬头
taxNum String 税号 税号
invoiceId String 企业内部发票Id 企业内部发票Id

# 1.5 业务响应

名称 类型 说明
status Integer 0: 调用成功,其他值均为: 调用失败
msg String 失败时的错误描述
data List<RepastApplySyncResult.Body> 请求成功时的响应数据,具体为申请单ID映射列表

RepastApplySyncResult.Body 字段说明

名称 类型 是否非空 说明
outRepastApplyNo String 外部用餐申请单号
result Integer 0: 同步成功,其他值均为: 同步失败
msg String 同步成功或失败描述
repastApplyNo String 美团企业版用餐申请单号(开启生成美团企业版用餐申请单才有此值返回)

# 1.6 示例

业务请求参数

{
    "method":"repast.apply.sync",
    "ts":1512963578,
    "entId":1,
    "outRepastApplyList":[
        {
            "sceneType": 1,
            "outRepastApplyNo": "TEST001",
            "submitStaff": {
                "name": "小美",
                "entStaffNum": "525"
            },
            "repastApplyName": "TEST",
            "startTime": 1622476800000,
            "endTime": 1633017600000,
            "reason": "商务宴请",
            "limitAmount": "100.00",
            "innerStaffList": [
                {
                    "name": "小美",
                    "entStaffNum": "525"
                }
            ],
            "assistantStaffList": [
                {
                    "name": "小美",
                    "entStaffNum": "525"
                }
            ],
            "guestList": [
                {
                    "outGuestId": "guest001",
                    "name": "guest001",
                    "company": "公司",
                    "department": "部门",
                    "phone": "13800138000"
                }
            ],
            "costCenterList": [
                {
                    "costNo": "1",
                    "costName": "测试成本中心",
                    "ratio": "1.0000",
                    "customField1": "COA1",
                    "customField2": null,
                    "customField3": null,
                    "customField4": null,
                    "customField5": null
                }
            ],
            "repastCityList": [
                {
                    "cityId": 110000,
                    "cityName": "北京市"
                }
            ],
            "invoiceInfo": {
                "invoiceTitle": "北京",
                "taxNum": "110",
                "invoiceId": "226"
            }
        }
    ]
}

业务响应

{
    "msg": null,
    "data": [
        {
            "repastApplyNo": null,
            "outRepastApplyNo": "TEST001",
            "result": 0,
            "msg": null
        }
    ],
    "status": 0
}

# 2 查询用餐申请详情列表

# 2.1 接入说明

美团企业版为客户提供了用餐申请、审批功能,如果企业客户希望在美团企业版完成用餐申请,但是需要通过接口查询用餐申请单信息的功能,则可以通过本文档进行对接。流程如下:

  1. 企业内部系统发起对美团企业版的接口调用。
  2. 美团企业版组装用餐申请业务数据,返回给企业。

# 2.2 接口说明

名称 描述
功能 查询用餐申请详情列表
HTTP方法 POST
请求方 第三方渠道
响应方 美团企业版平台
uri /repast/apply/query/detail/page
method repast.apply.detail.query.page

# 2.3 公共参数

详见:公共参数说明-公共请求参数

# 2.4 业务请求参数

名称 类型 是否非空 说明
pageNum Integer 当前页数
pageSize Integer 每页条数
repastApplyNoList List 美团企业版用餐申请单号列表
outRepastApplyNoList List 外部关联申请单号列表
createdTimeStart Long 创建时间开始(ms时间戳)
createdTimeEnd Long 创建时间终止(ms时间戳)
sqtOrderId Long 美团企业版订单ID(不推荐使用)

# 2.5 业务响应

名称 类型 是否非空 说明
status Integer 请求响应码
msg String 请求响应信息
data String 请求响应数据,内部是Json格式数据

Json格式数据说明

名称 类型 是否非空 说明
pageNum int 当前页码
pageSize int 当前页大小
totalPages int 结果集总页数
totalCount long 结果集数据总量
result List<RepastApplyDetailDTO> 行程数据列表

RepastApplyDetailDTO 字段说明

名称 类型 是否非空 说明
repastApplyNo String 美团企业版用餐申请单号
sceneType String 用餐场景(1-商务宴请;3-商务差旅;4-工作餐;5-团建用餐)
sceneTypeDesc String 用餐场景描述
outRepastApplyNo String 外部用餐申请单号
applyStatus Integer 申请单状态(0-进行中;10-已支付;20-审批中;30-已完成;40-已取消)
applyStatusDesc String 申请单状态描述
createdTime Long 创建时间(ms时间戳)
submitStaff StaffInfo 提交人信息
repastApplyName String 申请单主题/名称
startTime Long 有效期开始时间(ms时间戳)
endTime Long 有效期结束时间(ms时间戳)
reason String 用餐原因(限制:100个字符以内)
limitAmount String 可用额度(元)示例:51542.50
innerStaffList List<StaffInfo> 内部参与人列表
guestList List<GuestInfo> 外部参与人列表
costCenterList List<CostCenterInfo> 成本中心列表
repastCityList List<RepastCity> 用餐城市列表
receiptFileList List<FileInfo> 收据文件列表
sqtBizOrderIdList List 美团企业版订单ID列表

FileInfo 字段说明

名称 类型 是否非空 示例 说明
fileId String 123 文件ID
fileName String 测试文件 文件名称
filePath String http://xxxxx 文件路径

# 2.6 示例

业务请求参数

{
  "method":"repast.apply.detail.query.page",
  "ts":1512963578,
  "entId":1,
  "pageNum": 2,
    "pageSize": 10,
    "repastApplyNoList": [],
    "outRepastApplyNoList": [],
    "createdTimeStart": null,
    "createdTimeEnd": null,
    "sqtOrderId": null
}

业务响应

{
    "msg": null,
    "data": {
        "pageNum": 2,
        "pageSize": 10,
        "totalCount": 11,
        "result": [
            {
                "entId": 111,
                "repastApplyNo": "RA001",
                "sceneType": 1,
                "sceneTypeDesc": "商务宴请",
                "outRepastApplyNo": "TEST001",
                "applyStatus": 30,
                "applyStatusDesc": "已完成",
                "createdTime": 1622739191000,
                "submitStaff": {
                    "staffId": 111,
                    "name": "美团-小美",
                    "entStaffNum": "525"
                },
                "repastApplyName": null,
                "startTime": null,
                "endTime": null,
                "reason": null,
                "limitAmount": null,
                "innerStaffList": [
                    {
                        "staffId": 111,
                        "name": "小美",
                        "entStaffNum": "525"
                    }
                ],
                "guestList": [
                    {
                        "guestId": null,
                        "name": "guest-1",
                        "company": null,
                        "department": "部门1",
                        "phone": null,
                        "outGuestId": null
                    },
                    {
                        "guestId": null,
                        "name": "guest-2",
                        "company": null,
                        "department": "部门2",
                        "phone": null,
                        "outGuestId": null
                    },
                    {
                        "guestId": null,
                        "name": "guest-3",
                        "company": null,
                        "department": "部门3",
                        "phone": null,
                        "outGuestId": null
                    }
                ],
                "costCenterList": [
                    {
                        "costNo": "mt-cc-1",
                        "costName": "mt-cc-1",
                        "ratio": "0.2500",
                        "costSource": 3,
                        "customField1": "COA1",
                        "customField2": null,
                        "customField3": null,
                        "customField4": null,
                        "customField5": null
                    },
                    {
                        "costNo": "mt-cc-2",
                        "costName": "mt-cc-2",
                        "ratio": "0.2500",
                        "costSource": 3,
                        "customField1": "COA2",
                        "customField2": null,
                        "customField3": null,
                        "customField4": null,
                        "customField5": null
                    },
                    {
                        "costNo": "mt-cc-3",
                        "costName": "mt-cc-3",
                        "ratio": "0.5000",
                        "costSource": 3,
                        "customField1": "COA3",
                        "customField2": null,
                        "customField3": null,
                        "customField4": null,
                        "customField5": null
                    }
                ],
                "repastCityList": [],
                "receiptFileList": [],
                "sqtBizOrderIdList": [
                    12345
                ]
            }
        ],
        "totalPages": 2,
        "pageNo": 2
    },
    "status": 0
}

# 3 作废用餐申请单

# 3.1 接入说明

美团企业版为客户提供了用餐申请、报备、审批等功能,如果企业客户已经同步企业内部的用餐申请单,但之后需要作废已导入的单据(作废单据可见但不可继续使用),则可以通过本文档进行接口对接。流程如下:

  1. 企业内部系统发起对美团企业版的接口调用。
  2. 美团企业版组返回单据作废结果给企业。

# 3.2 接口说明

名称 描述
功能 作废用餐申请单
HTTP方法 POST
请求方 第三方渠道
响应方 美团企业版平台
uri /repast/apply/cancel
method repast.apply.cancel

# 3.3 公共参数

详见:公共参数说明-公共请求参数

# 3.4 业务请求参数

名称 类型 是否非空 说明
cancelOutRepastApplyList List<CancelOutRepastApply> 外部关联申请单号列表,单次最多作废10单

CancelOutRepastApply 字段说明

名称 类型 是否非空 说明
sceneType Integer 用餐场景(1-商务宴请;3-商务差旅;4-工作餐;5-团建用餐)
outRepastApplyNo String 外部用餐申请单号

# 3.5 业务响应

名称 类型 说明
status Integer 0: 调用成功,其他值均为: 调用失败
msg String 失败时的错误描述
data List<RepastApplyCancelResult.Body> 请求成功时的响应数据,具体为申请单ID映射列表

RepastApplyCancelResult.Body 字段说明

名称 类型 是否非空 说明
outRepastApplyNo String 外部用餐申请单号
result Integer 0: 作废成功,其他值均为: 作废失败
msg String 作废成功或失败描述

# 3.6 示例

业务请求参数

{
  "method":"repast.apply.cancel",
  "ts":1512963578,
  "entId":1,
  "cancelOutRepastApplyList": [
        {
            "outRepastApplyNo": "TEST001",
            "sceneType": 1
        }
    ]
}

业务响应

{
    "msg": null,
    "data": [
        {
            "outRepastApplyNo": "TEST001",
            "result": 0,
            "msg": null
        }
    ],
    "status": 0
}
上次更新: 4/22/2024, 4:15:08 PM