库存管理类

    purchasein/add


    目录

    1.接口说明

    1.1接口描述

         新增一张采购入库单

    1.2适用版本

         支持U8V12.0 及更高版本

    2.使用场景

    办公用品领用

    3.接口调用说明

    3.1请求说明

    url https://api.yonyouup.com/api/purchasein/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 单据编号
    date date 制单日期
    maker string 制单人名称
    warehousecode string 仓库编码
    warehousename string 仓库名称
    vendorcode string 供货单位编码
    vendorabbname string 供货单位简称
    vendorname string 供货单位
    memory string 备注
    receivecode string 收发类型编码
    receivename string 收发类型
    departmentcode string 部门编码
    departmentname 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
    taxrate number 税率
    inventorycode string entry 存货编码
    inventoryname string entry 存货
    inventorystd string entry 规格型号
    quantity number entry 数量
    price number entry 本币单价
    cost number entry 本币金额
    ioritaxprice number entry 税额
    iorisum number entry 价税合计
    taxprice number entry 本币税额
    isum number entry 本币价税合计
    ioritaxcost number entry 含税单价,传入会自动重新计算相关价格及金额。
    ioricost number entry 单价,传入会自动重新计算相关价格及金额。如果传入了含税单价,以含税单价为准自动计算。
    iorimoney number entry 金额
    taxrate number entry 税率
    cmassunitname string entry 主计量单位名称
    serial string entry 批号
    makedate date entry 生产日期
    validdate date entry 失效日期
    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
    assitantunitname string entry 辅计量单位名称
    irate number entry 换算率
    number 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
    rowno number entry 行号

    3.4请求示例

    POST https://api.yonyouup.com/api/purchasein/add?from_account=openapi_dev&to_account=openapi_ent&app_key=opa6fdd4bea98b95ad7&token=843d03f66e6544e19707ccec11030296&biz_id=0971&ds_sequence=1
    
    POST 内容:
    {
    	"purchasein":{
    		"departmentcode":"0401",
    		"warehousename":"PC原材料仓",
    		"define1":"",
    		"maker":"demo",
    		"define2":"",
    		"define3":"",
    		"define4":"",
    		"define5":"",
    		"code":"0000000001",
    		"departmentname":"采购部",
    		"define6":"",
    		"define16":"",
    		"date":"2014-12-22",
    		"define7":"",
    		"receivename":"采购入库",
    		"define8":"",
    		"memory":"",
    		"receivecode":"11",
    		"define9":"",
    		"define15":"",
    		"warehousecode":"30",
    		"define14":"",
    		"define13":"",
    		"define12":"",
    		"define11":"",
    		"define10":"",
    		"entry":[
    			{
    				"inventorystd":"2Pin信号线/675mm",
    				"free1":"",
    				"free3":"",
    				"free2":"",
    				"rowno":"1",
    				"free5":"",
    				"free4":"",
    				"free7":"",
    				"free6":"",
    				"free9":"",
    				"free8":"",
    				"free10":"",
    				"cmassunitname":"PCS",
    				"id":"1000000009",
    				"define24":"",
    				"define23":"",
    				"define26":"",
    				"define25":"",
    				"inventoryname":"线材",
    				"define22":"",
    				"quantity":"500.0000000000",
    				"inventorycode":"01019002067",
    				"define29":"",
    				"define27":"",
    				"define28":"",
    				"cost":"705.0000",
    				"define33":"",
    				"define32":"",
    				"define31":"",
    				"price":"1.4100000000",
    				"define30":"",
    				"define37":"",
    				"define36":"",
    				"define35":"",
    				"define34":""
    			},
    			{
    				"inventorystd":"船形开关线/线长500MM/2Pin",
    				"free1":"",
    				"free3":"",
    				"free2":"",
    				"rowno":"2",
    				"free5":"",
    				"free4":"",
    				"free7":"",
    				"free6":"",
    				"free9":"",
    				"free8":"",
    				"free10":"",
    				"cmassunitname":"PCS",
    				"id":"1000000009",
    				"define24":"",
    				"define23":"",
    				"define26":"",
    				"define25":"",
    				"inventoryname":"线材",
    				"define22":"",
    				"quantity":"500.0000000000",
    				"inventorycode":"01019002068",
    				"define29":"",
    				"define27":"",
    				"define28":"",
    				"cost":"785.0000",
    				"define33":"",
    				"define32":"",
    				"define31":"",
    				"price":"1.5700000000",
    				"define30":"",
    				"define37":"",
    				"define36":"",
    				"define35":"",
    				"define34":""
    			}
    		]
    	}
    }
    


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