API中心

  1. 采购管理
  2. 采购订单
返回

采购订单新增

接口所在U8C版本:U8 cloud2.7以及更高版本
详细描述:用于采购订单新增
API视频讲解API详情补丁列表常见问题参考
接口地址
请求方式
请求参数header
请求参数body
返回类型参数
代码示例
请求参数示例
正确返回示例
错误返回示例
接口地址:http://ip:port/u8cloud/api/pu/order/insert

参数填写指南

请求方式:POST

请求参数(header):

参数填写指南
参数名必填描述默认值
Content-Type请求体数据类型application/json
usercode用户
password密码
trantype翻译类型,按编码为code,不需要翻译为pkcode
system系统参数
uniquekey幂等唯一key

请求参数(body):

全量参数自制最简来源请购单直运来源销售订单借入转采购来源库存借入单来源采购合同带统计型自定义项带备注型自定义项
参数名类型是否数组必填描述默认值示例值
puordervo采购订单聚合实体

返回类型参数:

参数名类型是否数组必填描述默认值
puordervo采购订单聚合返回实体
childrenvo采购订单查询结果子实体
arrvcorp_namestring收货公司名称
arrvstoorg_namestring收货库存组织名称
blargessstring是否赠品
bodycodestring组织编码
breceiveplanstring存在到货计划
btransclosedstring是否运输关闭
cassistunitstring辅计量单位
cassistunit_namestring辅计量单位名称
cbaseidstring存货基础ID
ccloseuser_namestring关闭人名称
ccloseuseridstring关闭人
ccontractidstring合同头ID
ccontractrowidstring合同行ID
ccorrectrowidstring修正行ID
ccurrencytype_namestring原币币种名称
ccurrencytypeidstring原币币种ID
cdevaddridstring收发货地点
cdevareaidstring收发货地区
cmang_namestring存货管理名称
cmangidstring存货管理ID
coperate_namestring操作员名称
coperatorstring操作员ID
corder_bidstring采购订单行ID
corderidstring采购订单表头_主键
corp_namestring公司名称
cpriceaudit_bb1idstring价格审批单存货子子表ID
cpriceaudit_bidstring价格审批单存货子表ID
cpriceauditidstring价格审批单ID
cproject_namestring项目名称
cprojectidstring项目ID
cprojectphase_namestring项目阶段名称
cprojectphaseidstring项目阶段ID
cqpbaseschemeidstring优质优价主体方案ID
creqwareid_namestring收货库存组织名称
crownostring行号
csourcebillidstring来源单据ID
csourcebilltypestring来源单据类型
csourcerowidstring来源单据行ID
cupsourcebillidstring上层来源单据ID
cupsourcebillrowidstring上层来源单据行ID
cupsourcebilltypestring上层来源单据类型
cusedept_namestring使用部门名称
cusedeptidstring使用部门ID
cvenddevaddridstring供应商收发货地点
cvenddevareaidstring供应商收发货地区
cwarehouse_namestring收货仓库名称
cwarehouseidstring收货仓库ID
dclosedatestring关闭日期
dconfirmdatestring确认日期
dcorrectdatestring修正日期
deptcodestring使用部门编码
dplanarrvdatestring计划到货日期
forderrowstatusstring订单行状态
idiscounttaxtypestring扣税类别
iisactivestring是否激活
iisreplenishstring补货标志
invoicecorp_namestring收票公司名称
jobcodestring项目编码
jobphasecodestring项目阶段编码
naccumarrvnumstring累计到货数量
naccumdevnumstring累计运输数量
naccuminvoicenumstring累计发票数量
naccumrpnumstring累计到货计划数量
naccumstorenumstring累计入库数量
naccumwastnumstring累计途耗数量
nassistnumstring辅计量数量
nbackarrvnumstring累计退货数量
nbackstorenumstring累计退库数量
nconfirmnumstring确认数量
ndiscountratestring扣率
nexchangeotobratestring扣率
nmoneystring本币金额
nordernumstring订货数量
norgnettaxpricestring原币净含税单价
norgtaxpricestring原币含税单价
noriginalcurmnystring原币净无税金额
noriginalcurpricestring原币无税单价
noriginalnetpricestring原币净无税单价
noriginaltaxmnystring原币税额
noriginaltaxpricemnystring原币价税合计
ntaxmnystring本币税额
ntaxpricemnystring本币价税合计
ntaxratestring税率
pk_arrvcorpstring收货公司
pk_arrvstoorgstring收货库存组织
pk_corpstring公司主键
pk_creqwareidstring收货库存组织
pk_defdoc1string自定义项1
pk_defdoc10string自定义项10
pk_defdoc11string自定义项11
pk_defdoc12string自定义项12
pk_defdoc13string自定义项13
pk_defdoc14string自定义项14
pk_defdoc15string自定义项15
pk_defdoc16string自定义项16
pk_defdoc17string自定义项17
pk_defdoc18string自定义项18
pk_defdoc19string自定义项19
pk_defdoc2string自定义项2
pk_defdoc20string自定义项20
pk_defdoc3string自定义项3
pk_defdoc4string自定义项4
pk_defdoc5string自定义项5
pk_defdoc6string自定义项6
pk_defdoc7string自定义项7
pk_defdoc8string自定义项8
pk_defdoc9string自定义项9
pk_invoicecorpstring收票公司
pk_reqcorpstring需求公司
pk_reqstoorgstring需求库存组织
psncodestring关闭人编码
reqcorp_namestring需求公司名称
reqstoorg_namestring需求库存组织名称
shortnamestring辅计量单位编码
storcodestring收货仓库编码
termidstring原币币种编码
tsstring时间戳
unitcodestring公司编码
user_codestring操作员编码
vfree1string自由项1
vfree2string自由项2
vfree3string自由项3
vfree4string自由项4
vfree5string自由项5
vmemostring备注
vpriceauditcodestring价格审批单号
vproducenumstring批次号
vreceiveaddressstring收发货地址
vvenddevaddrstring供应商收发货地址
vvendinventorycodestring对应存货编码
vvendinventorynamestring对应存货名称
vvendorordercodestring对方订单号
vvendororderrowstring对方订单行号
parentvo采购订单查询结果主实体
bankdoccodestring开户银行编码
bislateststring是否最新版本
breturnstring是否退货
bsocooptomestring是否由销售订单协同生成
busicodestring业务类型编码
caccountbank_namestring开户银行名称
caccountbankidstring开户银行
caccountyearstring会计年度
cauditpsnstring审批人ID
cauditpsn_namestring审批人名称
cbiztypestring业务类型
cbiztype_namestring业务类型名称
ccurrencytypeidstring整单币种
cdept_namestring采购部门名称
cdeptidstring采购部门
cemployee_namestring采购员名称
cemployeeidstring采购员
cgiveinvoicevendorstring发票方
cgiveinvoicevendor_namestring发票方名称
codestring采购组织编码
coperatorstring制单人ID
coperator_namestring制单人名称
corderidstring采购订单ID
corp_namestring公司名称
cproject_namestring项目名称
cprojectidstring项目
cpurorganizationstring采购组织
cpurorganization_namestring采购组织名称
crecieverstring收货方
creciever_namestring收货方名称
crevisepsnstring修订人
crevisepsn_namestring修订人名称
ctermprotocol_namestring付款协议名称
ctermprotocolidstring付款协议
ctransmode_namestring运输方式名称
ctransmodeidstring运输方式
cunfreezestring解冻人ID
cunfreeze_namestring解冻人名称
currtype_codestring整单编码
currtype_namestring整单名称
custcodestring收货方编码
cvendormangidstring供应商管理档案ID
dauditdatestring审批日期
deptcodestring采购部门编码
dorderdatestring订单日期
drevisiondatestring修订日期
forderstatusstring订单状态
iprintcountstring打印次数
jobcodestring项目编码
nexchangeotobratestring整单折本汇率
nprepaymaxmnystring本币预付款限额
nprepaymnystring本币预付款
nversionstring版本信息
pk_corpstring公司
pk_defdoc1string自定义项1
pk_defdoc10string自定义项10
pk_defdoc11string自定义项11
pk_defdoc12string自定义项12
pk_defdoc13string自定义项13
pk_defdoc14string自定义项14
pk_defdoc15string自定义项15
pk_defdoc16string自定义项16
pk_defdoc17string自定义项17
pk_defdoc18string自定义项18
pk_defdoc19string自定义项19
pk_defdoc2string自定义项2
pk_defdoc20string自定义项20
pk_defdoc3string自定义项3
pk_defdoc4string自定义项4
pk_defdoc5string自定义项5
pk_defdoc6string自定义项6
pk_defdoc7string自定义项7
pk_defdoc8string自定义项8
pk_defdoc9string自定义项9
psncodestring采购员编码
sendcodestring运输方式编码
taudittimestring审批时间
termidstring付款协议编码
tlastmaketimestring最后修改时间
tmaketimestring制单时间
trevisiontimestring修订时间
tsstring时间戳
unitcodestring公司编码
user_codestring审批人编码
vcoopordercodestring对方订单号
vmemostring备注
vordercodestring订单编号

请求参数示例:

自制最简来源请购单直运来源销售订单借入转采购来源库存借入单来源采购合同带统计型自定义项带备注型自定义项

复制代码

{"puordervo":[{"childrenvo":[{"cmangid":"0901","nordernum":"1","noriginalcurprice":"10","norgtaxprice":"12"}],"parentvo":{"cbiztype":"pu01","cdeptid":"777","coperator":"apiwjh","cpurorganization":"1234","cvendormangid":"CU2023","pk_corp":"2401"}}]}

正确返回示例:

复制代码

{"status":"success","data":"[{\"parentvo\":{\"pk_corp\":\"1005\",\"unitcode\":\"2401\",\"corp_name\":\"wjh石油天然气集团有限公司\",\"cbiztype\":\"1005F4100000000011TW\",\"busicode\":\"pu01\",\"cbiztype_name\":\"采购-到货-入库\",\"cpurorganization\":\"0001F410000000040YMQ\",\"code\":\"1234\",\"cpurorganization_name\":\"w采购组织\",\"cdeptid\":\"1005F4100000000011TA\",\"deptcode\":\"777\",\"cdept_name\":\"w部门\",\"coperator\":\"0001A11000000002QQ4J\",\"user_code\":\"apiwjh\",\"coperator_name\":\"wjh\",\"corderid\":\"1005ZZ10000000002HI9\",\"dorderdate\":\"2023-09-01\",\"forderstatus\":\"0\",\"vordercode\":\"CD0013\",\"nversion\":\"1\",\"tmaketime\":\"2023-09-01 10:35:30\",\"breturn\":false,\"bislatest\":true,\"cvendormangid\":\"0001F410000000040YN3\",\"custcode\":\"CU2023\",\"cvendormang_name\":\"w供应商\",\"bisreplenish\":false,\"cvendorbaseid\":\"0001F410000000040YMY\",\"ccurrencytypeid\":\"00010000000000000001\",\"currtype_code\":\"CNY\",\"currtype_name\":\"人民币\",\"nexchangeotobrate\":\"1.00000000\"},\"childrenvo\":[{\"ccurrencytypeid\":\"00010000000000000001\",\"termid\":\"CNY\",\"ccurrencytype_name\":\"人民币\",\"cmangid\":\"0001F410000000044TSE\",\"invcode\":\"0901\",\"cmang_name\":\"大数量存货\",\"pk_invoicecorp\":\"1005\",\"unitcode\":\"2401\",\"invoicecorp_name\":\"wjh石油天然气集团有限公司\",\"pk_arrvcorp\":\"1005\",\"pk_corp\":\"1005\",\"corp_name\":\"wjh石油天然气集团有限公司\",\"corder_bid\":\"1005ZZ10000000002HIA\",\"corderid\":\"1005ZZ10000000002HI9\",\"crowno\":\"10\",\"nexchangeotobrate\":\"1.00000000\",\"nordernum\":\"1\",\"norgtaxprice\":\"11.30\",\"noriginalcurprice\":\"10\",\"ntaxrate\":\"13.00000000\",\"iisactive\":\"0\",\"idiscounttaxtype\":\"1\",\"forderrowstatus\":\"0\",\"cbaseid\":\"0001F410000000044TSB\",\"breceiveplan\":false}]}]","taskNumber":"202309010009"}

错误返回示例:

普通错误返回示例

复制代码

{
status: "falied",
errorcode: "-32000",
errormsg: "[第 1张采购订单的表头属性 coperator 的值不能为空。, 第 1张采购订单的表头属性 pk_corp 的值不能为空。, 第 1张采购订单的表头属性 cbiztype 的值不能为空。, 第 1张采购订单的表头属性 cpurorganization 的值不能为空。, 第 1张采购订单的表头属性 cvendormangid 的值不能为空。, 第 1张采购订单的表头属性 cdeptid 的值不能为空。, 第 1张采购订单, 第 1 行表体的属性 pk_invoicecorp 的值不能为空。, 第 1张采购订单, 第 1 行表体的属性 nordernum 的值不能为空。, 第 1张采购订单, 第 1 行表体的属性 ccurrencytypeid 的值不能为空。, 第 1张采购订单, 第 1 行表体的属性 nexchangeotobrate 的值不能为空。, 第 1张采购订单, 第 1 行表体的属性 cbaseid 的值不能为空。, 第 1张采购订单, 第 1 行表体的属性 cmangid 的值不能为空。]"
}