应收应付类

    pay/add


    目录

    1.接口说明

    1.1接口描述

         新增一张付款单

    1.2适用版本

         支持U8V12.0 及更高版本

    2.使用场景

    办公用品领用

    3.接口调用说明

    3.1请求说明

    url https://api.yonyouup.com/api/pay/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请求体参数说明

    参数 类型 参数路径 是否必填 描述
    vouchcode string 付款单号
    vouchdate date 单据日期
    vouchtype string 单据类型(48=收款单;49=付款单)
    customercode string 客商编码
    customername string 客商名称
    customerabbname string 客商简称
    departmentcode string 部门编码
    departmentname string 部门名称
    personcode string 人员编码
    personname string 人员
    amount number 本币金额
    originalamount number 原币金额
    digest string 摘要
    balancecode string 结算方式编码
    balancename string 结算方式
    balanceitemcode string 结算科目编码
    itemclasscode string 项目大类编号
    itemcode string 项目编码
    checkman string 审核人
    operator string 录入人
    itemname string 项目名称
    oppositebankname string 对方单位银行名称
    oppositebankcode string 对方单位银行帐号
    bankname string 本单位银行名称
    bankaccount string 本单位银行帐号
    define1 string 单据头自定义项1
    define2 string 单据头自定义项2
    define3 string 单据头自定义项3
    define4 date 单据头自定义项4
    define5 number 单据头自定义项5
    define6 date 单据头自定义项6
    define7 number 单据头自定义项7
    define8 string 单据头自定义项8
    define9 string 单据头自定义项9
    define10 string 单据头自定义项10
    define11 string 单据头自定义项11
    define12 string 单据头自定义项12
    define13 string 单据头自定义项13
    define14 string 单据头自定义项14
    define15 number 单据头自定义项15
    define16 number 单据头自定义项16
    customercode string entry 客商编码
    customerabbname string entry 客商简称
    departmentcode string entry 部门编码
    departmentname string entry 部门名称
    personcode string entry 人员编码
    personname string entry 人员
    digest string entry 摘要
    project string entry 项目编号
    projectclass string entry 项目大类编号
    itemcode string entry 科目
    itemname string entry 项目名称
    amount number entry 本币金额
    originalamount number entry 原币金额
    iamt_s number entry 数量
    iramt_s number entry 剩余数量
    define22 string entry 单据体自定义项1
    define23 string entry 单据体自定义项2
    define24 string entry 单据体自定义项3
    define25 string entry 单据体自定义项4
    define26 number entry 单据体自定义项5
    define27 number entry 单据体自定义项6
    define28 string entry 单据体自定义项7
    define29 string entry 单据体自定义项8
    define30 string entry 单据体自定义项9
    define31 string entry 单据体自定义项10
    define32 string entry 单据体自定义项11
    define33 string entry 单据体自定义项12
    define34 number entry 单据体自定义项13
    define35 number entry 单据体自定义项14
    define36 date entry 单据体自定义项15
    define37 date entry 单据体自定义项16

    3.4请求示例

    POST https://api.yonyouup.com/api/pay/add?from_account=openapi_dev&to_account=openapi_ent&app_key=opa6fdd4bea98b95ad7&token=843d03f66e6544e19707ccec11030296&biz_id=0971&ds_sequence=1
    
    POST 内容:
    {
    	"pay":{
    		"bankaccount":"",
    		"vendorname":"KMSMEDIA",
    		"define1":"孙亮",
    		"define2":"",
    		"originalamount":"802.5000",
    		"define3":"",
    		"balancecode":"3",
    		"define4":"",
    		"digest":"",
    		"define5":"",
    		"oppositebankcode":"",
    		"define6":"",
    		"define16":"",
    		"define7":"0.0",
    		"itemcode":"",
    		"define8":"",
    		"define9":"",
    		"amount":"802.5000",
    		"itemname":"",
    		"oppositebankname":"",
    		"itemclasscode":"",
    		"balancename":"银行汇票",
    		"vouchdate":"2014-12-31",
    		"departmentcode":"0401",
    		"bankname":"",
    		"vendorabbname":"KMSMEDIA",
    		"departmentname":"采购部",
    		"vendorcode":"10001",
    		"define15":"",
    		"define14":"",
    		"define13":"",
    		"define12":"",
    		"define11":"",
    		"personcode":"00056",
    		"define10":"",
    		"entry":[
    			{
    				"iramt_s":"0.0",
    				"originalamount":"2000.0000",
    				"itemcode":"1122",
    				"define24":"",
    				"iamt_s":"0.0",
    				"amount":"12600.0000",
    				"define23":"",
    				"define26":"",
    				"define25":"",
    				"itemname":"",
    				"define22":"",
    				"departmentcode":"0302",
    				"vendorabbname":"",
    				"define29":"",
    				"define27":"",
    				"departmentname":"销售部",
    				"define28":"",
    				"mainid":"1000000001",
    				"define33":"",
    				"vendorcode":"0601",
    				"define32":"",
    				"project":"",
    				"projectclass":"",
    				"define31":"",
    				"define30":"",
    				"define37":"",
    				"personcode":"00042",
    				"define36":"",
    				"define35":"",
    				"define34":"",
    				"personname":"徐海"
    			},
    			{
    				"iramt_s":"0.0",
    				"originalamount":"2000.0000",
    				"itemcode":"1122",
    				"define24":"",
    				"iamt_s":"0.0",
    				"amount":"12600.0000",
    				"define23":"",
    				"define26":"",
    				"define25":"",
    				"itemname":"",
    				"define22":"",
    				"departmentcode":"0302",
    				"vendorabbname":"",
    				"define29":"",
    				"define27":"",
    				"departmentname":"销售部",
    				"define28":"",
    				"mainid":"1000000002",
    				"define33":"",
    				"vendorcode":"0601",
    				"define32":"",
    				"project":"",
    				"projectclass":"",
    				"define31":"",
    				"define30":"",
    				"define37":"",
    				"personcode":"00042",
    				"define36":"",
    				"define35":"",
    				"define34":"",
    				"personname":"徐海"
    			}
    		],
    		"vouchcode":"0000000001",
    		"personname":"孙亮",
    		"balanceitemcode":"100201"
    	}
    }
    


    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下载