API中心

  1. 总账
  2. 凭证
返回

凭证新增

接口所在U8C版本:U8 cloud2.7以及更高版本
详细描述:(不同账簿不同公司凭证不能一起传)
API视频讲解API详情补丁列表常见问题参考
接口地址
请求方式
请求参数header
请求参数body
返回类型参数
代码示例
请求参数示例
正确返回示例
错误返回示例
接口地址:http://ip:port/u8cloud/api/gl/voucher/insert

参数填写指南

请求方式:POST

请求参数(header):

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

请求参数(body):

全量参数制单最简带辅助核算带现金流量不允许修改示例
参数名类型是否数组必填描述默认值示例值
voucher凭证实体(不同账簿不同公司凭证不能一起传)
attachmentint附单据数
details分录
ass辅助核算
checktypecodestring辅助核算类型编码
checkvaluecodestring辅助核算的值编码
cashflow现金流量
memostring备注(v5.1开始支持)
moneystring原币金额
moneyassstring辅币(v5.1开始支持)
moneymainstring主币(v5.1开始支持)
pk_cashflowstring现金流量表项编码
pk_currtypestring现金流量币种编码
creditamountstring原币贷方金额(必填,没有就传0就行了)如果是两位小数建议带上英文双引号,即当作字符串类型传
creditquantitystring贷方数量
debitamountstring原币借方金额(必填,没有就传0就行了)如果是两位小数建议带上英文双引号,即当作字符串类型传
debitquantitydouble借方数量
detailindexint分录号
excrate2double汇率(2.7版本及以前版本不支持外面传进来,需要在外币汇率节点设置)
explanationstring摘要
free1string核销号
free2string核销日期
freevalue10string分录自定义项10
freevalue11string分录自定义项11
freevalue12string分录自定义项12
freevalue13string分录自定义项13
freevalue14string分录自定义项14
freevalue15string分录自定义项15
freevalue2string分录自定义项2
freevalue3string分录自定义项3
freevalue4string分录自定义项4
freevalue5string分录自定义项5
freevalue6string分录自定义项6
freevalue7string分录自定义项7
freevalue8string分录自定义项8
freevalue9string分录自定义项9
localcreditamountstring本币贷方金额(必填,没有就传0就行了)如果是两位小数建议带上英文双引号,即当作字符串类型传
localdebitamountstring本币借方金额(必填,没有就传0就行了)如果是两位小数建议带上英文双引号,即当作字符串类型传
modifyflagstring修改标志(不允许修改时传是16个N)
pk_accsubjstring科目
pk_currtypestring币种编码
pricedouble单价
explanationstring凭证摘要
hasCashflowModifiedstring凭证是否手动修改了现金流量分析(如果传现金流量此属性传Y,如果没有现金流量分析,此属性不传或传N)
isdifflagboolean是否差异凭证
modifyflagstring修改标志(当不想让界面修改时传三个N)
noint凭证号
pk_corpstring公司
pk_glorgbookstring账簿
pk_preparedstring制单人编码
pk_vouchertypestring凭证类别简称
prepareddatestring制单日期(格式示例:2021-04-27))
voucherkindint凭证类型0

返回类型参数:

参数名类型是否数组必填描述默认值
vouchervo凭证_返回
casher_codestring出纳人编码
casher_namestring出纳人名称
checked_codestring审核人编码
checked_namestring审核人名称
checkeddatestring审核日期
corp_codestring公司编码
corp_namestring公司名称
detailstring分录
details分录_返回
accsubj_codestring科目编码
accsubj_namestring科目名称
ass辅助核算内容
checktypecodestring辅助核算类型编码
checktypenamestring辅助核算类型名称
checkvaluecodestring辅助核算值编码
checkvaluenamestring辅助核算值名称
pk_checktypestring辅助核算类型
pk_checkvaluestring辅助核算值
assesstring辅助核算_返回
cashflowstring现金流量
cashflows现金流量_返回
cashflow_codestring现金流量表项编码
cashflow_namestring现金流量表项名称
currtype_codestring现金流量币种编码
currtype_namestring现金流量币种名称
moneystring金额
pk_cashflowstring现金流量表项
pk_cashflowcasestring主键
pk_currtypestring现金流量币种
creditamountstring原币贷方发生额
creditquantitystring贷方数量
currtype_codestring币种编码
currtype_namestring币种名称
debitamountstring原币借方发生额
debitquantitystring借方数量
detailindexstring分录号
excrate1string本币汇率
explanationstring摘要
freevalue1string分录自定义项1(3.5版本开始支持)
freevalue10string分录自定义项10(3.5版本开始支持)
freevalue11string分录自定义项11(3.5版本开始支持)
freevalue12string分录自定义项12(3.5版本开始支持)
freevalue13string分录自定义项13(3.5版本开始支持)
freevalue14string分录自定义项14(3.5版本开始支持)
freevalue15string分录自定义项15(3.5版本开始支持)
freevalue16string分录自定义项16(3.5版本开始支持)
freevalue17string分录自定义项17(3.5版本开始支持)
freevalue18string分录自定义项18(3.5版本开始支持)
freevalue19string分录自定义项19(3.5版本开始支持)
freevalue2string分录自定义项2(3.5版本开始支持)
freevalue20string分录自定义项20(3.5版本开始支持)
freevalue21string分录自定义项21(3.5版本开始支持)
freevalue22string分录自定义项22(3.5版本开始支持)
freevalue23string分录自定义项23(3.5版本开始支持)
freevalue24string分录自定义项24(3.5版本开始支持)
freevalue25string分录自定义项25(3.5版本开始支持)
freevalue26string分录自定义项26(3.5版本开始支持)
freevalue27string分录自定义项27(3.5版本开始支持)
freevalue28string分录自定义项28(3.5版本开始支持)
freevalue29string分录自定义项29(3.5版本开始支持)
freevalue3string分录自定义项3(3.5版本开始支持)
freevalue30string分录自定义项30(3.5版本开始支持)
freevalue4string分录自定义项4(3.5版本开始支持)
freevalue5string分录自定义项5(3.5版本开始支持)
freevalue6string分录自定义项6(3.5版本开始支持)
freevalue7string分录自定义项7(3.5版本开始支持)
freevalue8string分录自定义项8(3.5版本开始支持)
freevalue9string分录自定义项9(3.5版本开始支持)
localcreditamountstring本币贷方发生额
pk_accsubjstring科目
pk_currtypestring币种
pk_detailstring分录主键
pk_voucherstring凭证主键
pricestring单价
discardflagstring是否作废
explanationstring摘要
glorgbook_codestring主题账簿编码
glorgbook_namestring主题账簿名称
manager_codestring记账人编码
manager_namestring记账人名称
nostring凭证号
periodstring会计期间
pk_casherstring出纳人
pk_checkedstring审核人
pk_corpstring公司
pk_glorgbookstring主体账簿
pk_managerstring记账人
pk_preparedstring制单人
pk_systemstring制单系统
pk_voucherstring凭证主键
pk_vouchertypestring凭证类别
prepared_codestring制单人编码
prepared_namestring制单人名称
prepareddatestring制单日期
signdatestring签字日期
signflagstring是否签字
tallydatestring记账日期
totalcreditstring贷方本币金额合计
totaldebitstring借方本币金额合计
vouchertype_codestring凭证类别编码
vouchertype_namestring凭证类别名称
yearstring会计年度

请求参数示例:

制单最简带辅助核算带现金流量不允许修改示例

复制代码

{"voucher":[{"details":[{"explanation":"测试1","pk_accsubj":"1001","pk_currtype":"CNY","debitamount":10},{"explanation":"测试1","pk_accsubj":"6001","pk_currtype":"CNY","creditamount":10}],"pk_corp":"876","pk_glorgbook":"1202-2018E","pk_prepared":"demo1","pk_vouchertype":"234"}]}

正确返回示例:

复制代码

{"status":"success","data":"[{\"pk_glorgbook\":\"00011110000000001G58\",\"glorgbook_code\":\"1000-0003\",\"glorgbook_name\":\"天海总公司报告账簿\",\"pk_voucher\":\"000114100000000027OT\",\"no\":\"2\",\"year\":\"2018\",\"period\":\"06\",\"prepareddate\":\"2018-06-26\",\"pk_prepared\":\"000111100000000000VI\",\"prepared_code\":\"14444444002\",\"prepared_name\":\"李鑫\",\"pk_vouchertype\":\"0001DEFAULT000000001\",\"vouchertype_code\":\"记账\",\"vouchertype_name\":\"记账凭证\",\"explanation\":\"SDK测试ZZ\",\"totaldebit\":100,\"totalcredit\":100,\"pk_system\":\"XX\",\"signflag\":false,\"discardflag\":false,\"detail\":[{\"pk_detail\":\"10011410000000000DY9\",\"pk_voucher\":\"000114100000000027OT\",\"detailindex\":\"1\",\"explanation\":\"SDK测试ZZ\",\"pk_accsubj\":\"00011110000000001G62\",\"accsubj_code\":\"1221\",\"accsubj_name\":\"其他应收款\",\"pk_currtype\":\"00010000000000000001\",\"currtype_code\":\"CNY\",\"currtype_name\":\"人民币\",\"price\":0,\"excrate1\":0,\"debitquantity\":0,\"debitamount\":100,\"localdebitamount\":100,\"creditquantity\":0,\"creditamount\":0,\"localcreditamount\":0,\"ass\":[{\"pk_checktype\":\"00010000000000000001\"}]},{\"pk_detail\":\"10011410000000000DYA\",\"pk_voucher\":\"000114100000000027OT\",\"detailindex\":\"2\",\"explanation\":\"SDK测试ZZ\",\"pk_accsubj\":\"00011110000000001G62\",\"accsubj_code\":\"1221\",\"accsubj_name\":\"其他应收款\",\"pk_currtype\":\"00010000000000000001\",\"currtype_code\":\"CNY\",\"currtype_name\":\"人民币\",\"price\":0,\"excrate1\":0,\"debitquantity\":0,\"debitamount\":0,\"localdebitamount\":0,\"creditquantity\":0,\"creditamount\":100,\"localcreditamount\":100,\"ass\":[{\"pk_checktype\":\"00010000000000000001\"}]}],\"pk_corp\":\"1001\",\"corp_code\":\"1000\",\"corp_name\":\"天海总公司\"}]"}

错误返回示例:

复制代码

{"status":"falied","errorcode":"-32000","errormsg":"下面的档案无法翻译:档案类型:凭证类别,档案编码:记账1,可能的原因是当前单据使用的公司没有启用单据所在的模块或者档案没有分配到当前使用的公司!"}