网上报销类

    expensesclaim/add


    目录

    1.接口说明

    1.1接口描述

         新增一张费用报销单

    1.2适用版本

         支持U8V12.0 及更高版本

    2.使用场景

    移动报销、报销应用

    3.接口调用说明

    3.1请求说明

    url https://api.yonyouup.com/api/expensesclaim/add
    格式 JSON
    https请求方式 POST
    编码类型 UTF-8


    3.2url参数说明

    参数 类型 是否必填 描述
    from_account string 是 调用方id
    to_account string 是 提供方id
    app_key string 是 应用编码
    token string 是 api调用唯一识别码
    tradeid string 是 交易唯一识别码,tradeid与biz_id只能传入一个
    ds_sequence number 否 数据源序号(默认取应用的第一个数据源)
    biz_id string 是 上游id,需要保证biz_id与ERP主键唯一对应关系,tradeid与biz_id只能传入一个
    sync number 否 0=异步新增(默认);1=同步新增;


    3.3请求体参数说明

    参数 类型 参数路径 是否必填 描述
    operationtypecode string 是 单据类型编码
    typename string 否 单据类型
    code string 否 单据编号
    expensedate date 是 报销日期
    expenserid string 是 报销人编码
    cpsn_name string 否 报销人
    deptid string 是 部门
    cdepname string 否 部门名称
    expensemoney number 是 报销金额
    budgetitemid string 否 预算项目编码
    cbgitemname string 否 预算项目
    currency string 否 币种
    agentid string 否 经办人
    auditorid string 否 审核人
    auditdate date 否 审核日期
    cuscode string 否 客户编码
    ccusname string 否 客户名称
    ccusabbname string 否 客户简称
    vencode string 否 供应商编码
    cvenname string 否 供应商名称
    cvenabbname string 否 供应商简称
    auditdatetime date 否 审核日期时间
    auditstate number 否 审核状态
    paystate number 否 支付状态
    vouchstate number 否 单据状态
    used string 是 用途
    exchangerate number 否 汇率
    itemclassid string 否 项目大类
    itemid string 否 头项目
    citem_name string 否 项目大类名称
    citemname string 否 头项目
    spreaddeptid string 否 头分摊部门
    spreaddepname string 否 部门名称
    cdefine1 string 否 自定义项1
    cdefine2 string 否 自定义项2
    cdefine3 string 否 自定义项3
    cdefine4 date 否 自定义项4
    cdefine5 number 否 自定义项5
    cdefine6 date 否 自定义项6
    cdefine7 number 否 自定义项7
    cdefine8 string 否 自定义项8
    cdefine9 string 否 自定义项9
    cdefine10 string 否 自定义项10
    cdefine11 string 否 自定义项11
    cdefine12 string 否 自定义项12
    cdefine13 string 否 自定义项13
    cdefine14 string 否 自定义项14
    cdefine15 number 否 自定义项15
    cdefine16 number 否 自定义项16
    costapplycode string 否 申请单号
    begindate date entry 否 起始日期
    enddate date entry 否 终止日期
    begintime string entry 否 起始时间
    emdtime string entry 否 终止时间
    beginzero string entry 否 起始地点
    endzero string entry 否 达到地点
    vehiclecode string entry 否 交通工具编码
    vehiclename string entry 否 交通工具
    attachmentnum number entry 否 附单据数
    costitemid string entry 否 费用项目编码
    cexpname string entry 否 费用项目
    deptid string entry 否 部门编码
    subdepname string entry 否 部门名称
    expenserid string entry 否 报销人编码
    subpsn_name string entry 否 报销人
    itemclassid string entry 否 项目大类编码
    subcitem_name string entry 否 项目大类名称
    itemid string entry 是 项目编码
    subcitemname string entry 否 项目名称
    expensemoney number entry 是 报销金额
    localmoney number entry 是 本币金额
    number number entry 否 数量
    quota number entry 否 定额
    vouchmoney number entry 否 单据金额
    overquotarate number entry 否 超定额比率
    rate number entry 否 百分比
    spreaddeptid string entry 否 费用承担部门编码
    spreaddepname string entry 否 费用承担部门
    memo string entry 否 说明
    budgetitemid string entry 否 预算项目编码
    subbgitemname string entry 否 预算项目
    cdefine22 string entry 否 自定义项22
    cdefine23 string entry 否 自定义项23
    cdefine24 string entry 否 自定义项24
    cdefine25 string entry 否 自定义项25
    cdefine26 number entry 否 自定义项26
    cdefine27 number entry 否 自定义项27
    cdefine28 string entry 否 自定义项28
    cdefine29 string entry 否 自定义项29
    cdefine30 string entry 否 自定义项30
    cdefine31 string entry 否 自定义项31
    cdefine32 string entry 否 自定义项32
    cdefine33 string entry 否 自定义项33
    cdefine34 number entry 否 自定义项34
    cdefine35 number entry 否 自定义项35
    cdefine36 date entry 否 自定义项36
    cdefine37 date entry 否 自定义项37

    3.4请求示例

    POST https://api.yonyouup.com/api/expensesclaim/add?from_account=openapi_dev&to_account=openapi_ent&app_key=opa6fdd4bea98b95ad7&token=843d03f66e6544e19707ccec11030296&biz_id=0971&ds_sequence=1
    
    POST 内容:
    {
    	"expensesclaim":{
    		"expensemoney":"1500",
    		"expenserid":"00001",
    		"operationtypecode":"3002",
    		"used":"报销用途说明...",
    		"user_id":"demo",
    		"deptid":"0302",
    		"entry":[
    			{
    				"costitemid":"04",
    				"deptid":"0302",
    				"expensemoney":"1500",
    				"expenserid":"00001",
    				"rowno":"1"
    			}
    		]
    	}
    }
    


    3.5返回参数说明

    参数说明 类型 描述
    errcode string 错误码,0 为正常。
    errmsg string 错误信息。
    id string 新增成功后返回新单据编号。
    tradeid string 新增成功后返回交易唯一识别码

    3.6正确返回示例

    JSON示例:

    {
        "tradeid": "158f3f05730711e591c702004c4f4f50",
        "ping_after": "3",
        "url": "https://api.yonyouup.com/result?requestid=158f3f05730711e591c702004c4f4f50"
    }
    上述 api 请求返回信息表示建议客户端 3 秒钟后向 https://api.yonyouup.com/result?requestid=158f3f05730711e591c702004c4f4f50 发送 GET 请求获取真正的 api 调用结果,结果格式如下:
    {
      "errcode" : "0", 
      "errmsg" : "", 
      "id" : "883",
      "tradeid" : "158f3f05730711e591c702004c4f4f50"
    }  
    

    3.7错误返回示例

    application/json;charset=UTF-8
    {
    	"errcode" : "30021",
    	"errmsg" : "此应用未上线"
    } 

    4.API测试

    API测试 SDK下载