采购管理类

    purchasereceipt/add


    目录

    1.接口说明

    1.1接口描述

         新增一张采购到货单

    1.2适用版本

         支持U8V12.0 及更高版本

    2.使用场景

    订购应用

    3.接口调用说明

    3.1请求说明

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

    参数 类型 参数路径 是否必填 描述
    code string 单据号
    purchasetypecode string 采购类型编码
    vendorcode string 供货单位编号
    departmentcode string 部门编号
    personcode string 业务员编码
    payconditioncode string 付款条件编码
    foreigncurrency string 币种
    foreigncurrencyrate number 汇率
    memory string 备注
    businesstype string 业务类型
    maker string 制单人
    idiscounttaxtype number 扣税类别
    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
    shipcode string 运输方式编码
    cvenpuomprotocol string 收付款协议编码
    warehousecode string entry 仓库编码
    inventorycode string entry 存货编码
    cinva_unit string entry 采购单位
    iinvexchrate number entry 换算率
    serial string entry 批号
    originaltaxedprice number entry 含税单价
    quantity number entry 数量
    number number entry 件数
    taxrate number entry 税率
    originalprice number entry 原币单价
    originaltaxedprice number entry 原币含税单价
    originalmoney number entry 原币金额
    originaltax number entry 原币税额
    originalsum number entry 原币价税合计
    price number entry 本币单价
    money number entry 本币金额
    tax number entry 本币税额
    sum 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
    free1 string entry 自由项1
    free2 string entry 自由项2
    free3 string entry 自由项3
    free4 string entry 自由项4
    free5 string entry 自由项5
    free6 string entry 自由项6
    free7 string entry 自由项7
    free8 string entry 自由项8
    free9 string entry 自由项9
    free10 string entry 自由项10
    ivouchrowno number entry 行号
    cbmemo string entry 表体备注

    3.4请求示例

    POST https://api.yonyouup.com/api/purchasereceipt/add?from_account=openapi_dev&to_account=openapi_ent&app_key=opa6fdd4bea98b95ad7&token=843d03f66e6544e19707ccec11030296&tradeid=c0f7288e77b811e591c702004c4f4f50
    
    POST 内容:
    {
    	"purchasereceipt":{
    		"cmodifydate":"",
    		"cvenpuomprotocolname":"",
    		"cauditdate":"2014-12-0300:00:00.0",
    		"ccloser":"",
    		"csysbarcode":"||pudh|0000000001",
    		"idiscounttaxtype":"0",
    		"cverifier":"demo3",
    		"creviser":"",
    		"entry":[
    			{
    				"iposid":"3",
    				"originalsum":"1800.0000",
    				"inventoryclasscode":"12",
    				"inventoryname":"进口配件",
    				"originalprice":"9.000000",
    				"quantity":"200.000000",
    				"originaltax":"",
    				"cbcloser":"",
    				"warehousename":"",
    				"cinva_unit":"",
    				"iinvexchrate":"",
    				"define29":"",
    				"define27":"",
    				"number":"0.000000",
    				"define28":"",
    				"originaltaxedprice":"9.000000",
    				"define33":"",
    				"define32":"",
    				"define31":"",
    				"define30":"",
    				"price":"9.000000",
    				"define37":"",
    				"tax":"",
    				"define36":"",
    				"define35":"",
    				"define34":"",
    				"inventorystd":"",
    				"originalmoney":"1800.0000",
    				"free1":"",
    				"free3":"",
    				"free2":"",
    				"free5":"",
    				"sum":"1800.0000",
    				"free4":"",
    				"free7":"",
    				"free6":"",
    				"free9":"",
    				"vouchstate":"0",
    				"free10":"",
    				"free8":"",
    				"closer":"",
    				"taxrate":"0.000000",
    				"define24":"",
    				"define23":"",
    				"define26":"",
    				"define25":"",
    				"unitid":"",
    				"define22":"",
    				"money":"1800.0000",
    				"inventoryaddcode":"",
    				"inventorycode":"fx01",
    				"cinvm_unit":"公斤",
    				"cbsysbarcode":"||IM25|0000000002|1",
    				"ivouchrowno":"",
    				"ccomunitcode":"0101",
    				"cordercode":"",
    				"cbmemo":"",
    				"serial":""
    			},
    			{
    				"iposid":"5",
    				"originalsum":"18000.0000",
    				"inventoryclasscode":"0107",
    				"inventoryname":"稳压二极管",
    				"originalprice":"90.000000",
    				"quantity":"200.000000",
    				"originaltax":"",
    				"cbcloser":"",
    				"warehousename":"",
    				"cinva_unit":"",
    				"iinvexchrate":"",
    				"define29":"",
    				"define27":"",
    				"number":"0.000000",
    				"define28":"",
    				"originaltaxedprice":"90.000000",
    				"define33":"",
    				"define32":"",
    				"define31":"",
    				"define30":"",
    				"price":"585.000000",
    				"define37":"",
    				"tax":"",
    				"define36":"",
    				"define35":"",
    				"define34":"",
    				"inventorystd":"wenyaerjiguan",
    				"originalmoney":"18000.0000",
    				"free1":"",
    				"free3":"",
    				"free2":"",
    				"free5":"",
    				"sum":"117000.0000",
    				"free4":"",
    				"free7":"",
    				"free6":"",
    				"free9":"",
    				"vouchstate":"0",
    				"free10":"",
    				"free8":"",
    				"closer":"",
    				"taxrate":"0.000000",
    				"define24":"",
    				"define23":"",
    				"define26":"",
    				"define25":"",
    				"unitid":"",
    				"define22":"",
    				"money":"117000.0000",
    				"inventoryaddcode":"",
    				"inventorycode":"0107001",
    				"cinvm_unit":"PCS",
    				"cbsysbarcode":"||IM25|0000000003|2",
    				"ivouchrowno":"",
    				"ccomunitcode":"0108",
    				"cordercode":"",
    				"cbmemo":"",
    				"serial":""
    			}
    		],
    		"cvenpuomprotocol":""
    	}
    }
    


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