Finance API文档

0. 公共部分

请求url
  • {apiRoot}/{method}?ver={version}&appkey={appkey}&sign={sign}
参数名说明示例
apiRoot根地址http://localhost:9000
method方法名/voucher/save
version版本号1.0
appkeyAppKeyFinanceClient
sign签名5D3AA349E953AF0C15E38C147B15EE35
参数
参数名必选类型说明
ContentContent内容
Tokenstring鉴权令牌,登录后获取
返回
参数名必选类型说明
Resultint结果码
ErrMsgstring错误描述
Solutionstring解决建议
结果码
结果码描述说明
0SUCCESS成功
1000NULL_DTL没有导入的实现
1001FILE_NOT_EXISST文件不存在
1002RECORD_NOT_EXIST记录不存在
1003RECORD_EXIST记录已存在
1004IMPERFECT_DATA不完美的数据
1005SERVICE_TIMEOUT超时
1006NULL空的请求
1007INCORRECT_STATE当前状态不符合预期
1008AMMOUNT_IMBALANCE借贷不平衡
1009LINKED_DATA有关联的业务
3000NOT_SUPPORT不支持
3001SYSTEM_ERROR未知的系统错误
3002AUTHENTICATION_ERROR无效的签名
签名算法
string SignRequest(string body){ StringBuilder query = new StringBuilder(Secret); query.Append(body); query.Append(Secret); MD5 md5 = MD5.Create(); byte[] bytes = md5.ComputeHash(Encoding.UTF8.GetBytes(query.ToString())); StringBuilder result = new StringBuilder(); for (int i = 0; i < bytes.Length; i++) { result.Append(bytes[i].ToString("X2")); } return result.ToString();}

1. 保存凭证

方法
  • /voucher/save
请求方式
  • POST
参数
  • Content
参数名必选类型说明
headerVoucherHeader表头
entriesList 分录
udefentiesMap<string,<string,object>>自定义扩展字段
  • VoucherHeader
参数名必选类型说明
idintID(为0即为新增,否则为修改的内码)
wordstring凭证字:“记”
notestring备注
referencestring参考信息
yearint年度
periodint期间
businessDatedateTime业务日期(2019-03-05T00:00:00)
datedateTime日期(2019-03-05T00:00:00)
creatTimedateTime创建时间(2019-03-05T00:00:00)
createrint创建人
cashierstring出纳
agentstring经办人
  • VoucherEntry
参数名必选类型说明
indexint分录号
accountSubjectNostring科目代号
explanationstring摘要
amountdecimal金额
directionint方向:1(借方),-1(贷方 )
uniqueKeystring唯一码(uuid),作为自定义内容的键值
返回
参数名必选类型说明
Id条件int如果成功,返回凭证内码
示例
{ "Content" : { "header" : { "id" : 0, "word" : "记", "note" : null, "reference" : "参考信息", "year" : 2019, "period" : 3, "businessDate" : "2019-03-05T00:00:00", "date" : "2019-03-05T00:00:00", "creatTime" : "2019-03-05T23:46:01", "creater" : 13594, "cashier" : "出纳", "agent" : "经办" }, "entries" : [{ "index" : 1, "accountSubjectNo" : "1001", "explanation" : "摘要", "amount" : 200.0, "direction" : 1, "uniqueKey": "afffc876a94049afaa7275c7c7d8d76f" }, { "index" : 2, "accountSubjectNo" : "1002", "explanation" : "摘要", "amount" : 200.0, "direction" : -1, "uniqueKey": "7761b2300fdb48bd991e570c0f8fc39f" } ], "udefenties": { "afffc876a94049afaa7275c7c7d8d76f": { "cust": "", "price": 4.0, "qty": 78.0 }, "7761b2300fdb48bd991e570c0f8fc39f": { "cust": null, "price": 0.0, "qty": 0.0 } } }, "Token" : "3AIavxSAoaJhuBB1o4hc6fw4hNlpC4KoXgfT1mpu1hyQiA_lqKNKOkNDtC_mKdHiWEAHooTE1vZAtsYhz4g_jNoNR5JBkp9UHXZSYFbSuj0j38muKaMbFhTRMEZ_xqd4znSY_Fcp8V96hto4VpLWqh0__yHKFoRZQ0DGS5HcrpQ="}
  • 返回

    { "id" : 233, "Result" : 0, "ErrMsg" : null, "Solution" : null}

相关文章