单据-会计资料创建

  • 接口:magneto/api/v1/documents/claim
  • Method:POST
  • 接口说明:创建会计资料单据(报销单、申请单等)
  • 其他补充信息:会计资料管理

参数:

请求头参数

  • Content-Type: application/json
  • token: 用户认证令牌(必填)

请求参数

字段名 类型 必填 长度限制 说明 备注
archive_ext_code String ≤100 档案编码 若传入则表明关联档案,档案已整理的时候不允许被关联
document_type_code String ≤20 会计资料类型编码 决定关联的子表类型
document_ext_num String ≤36 会计资料外部系统编号 确保唯一性,与source_code+archive_type_code组成业务主键
archive_type_code String ≤20 档案类型编码 电子会计档案分类标识
source_code String ≤20 来源代码 标识数据来源系统
document_sub_type String ≤64 会计资料子类型 单据类型、票据类型、附件类型等
document_num String ≤64 会计资料编号 单据号、发票号码、回单号等
document_desc String ≤255 描述 会计资料的详细描述
file_num_list Array - 文件编号列表 关联的文件编号数组
claim_num String ≤64 单据号 报销单、申请单等的编号
claim_type String ≤64 单据类型 区分不同类型的单据
submit_user_num String ≤64 提交人工号 单据提交人的员工编号
submit_user_name String ≤255 提交人姓名 单据提交人的姓名
submit_department_code String ≤100 提交部门编码 提交人所属部门编码
submit_department_name String ≤255 提交部门名称 提交人所属部门名称
fee_user_num String ≤64 费用人工号 费用承担人员工编号
fee_user_name String ≤255 费用人姓名 费用承担人姓名
fee_department_code String ≤100 费用承担部门编码 费用承担部门编码
fee_department_name String ≤255 费用承担部门名称 费用承担部门名称
branch_code String ≤100 公司编码 所属公司或分支机构编码
branch_name String ≤255 公司名称 所属公司或分支机构名称
pay_object_type String ≤64 支付对象类型 收款对象的类型分类
pay_user_code String ≤64 收款人编码 收款人的编码
pay_user_name String ≤255 收款人名称 收款人的姓名
supplier_code String ≤64 供应商编码 供应商的编码
supplier_name String ≤255 供应商名称 供应商的名称
submit_time Long - 提交日期 单据提交的时间(13位时间戳-毫秒)
preapproved_time Long - 业务审批通过日期 业务审批通过的时间(13位时间戳-毫秒)
checked_time Long - 财务审核通过日期 财务审核通过的时间(13位时间戳-毫秒)
approved_time Long - 审批通过日期 最终审批通过的时间(13位时间戳-毫秒)
gl_period String ≤64 预算期间 财务期间,如202410
total_amount Decimal (20,2) 总金额 单据的总金额,精度20位,小数2位
currency String ≤10 币种 金额的币种,如CNY、USD
project_code String ≤64 项目编码 关联的项目编码
project_name String ≤255 项目名称 关联的项目名称
external_person_code String ≤64 外部人员编码 外部人员的编码
external_person_name String ≤255 外部人员名称 外部人员的姓名
customer_code String ≤64 客户编码 客户的编码
customer_name String ≤255 客户名称 客户的名称
asset_code String ≤64 资产编码 资产的编码
asset_name String ≤255 资产名称 资产的名称
column1-column10 String ≤255 自定义字段1-10 扩展字段,可根据业务需要使用

返回参数

字段名称 字段类型 字段描述
resCode Integer 状态码(200000/500000)
resMsg String 返回信息描述(更新成功/更新失败)
bizId String 当前次接口同步的唯一标识
data String token值

示例:

请求数据

curl --location --request POST 'https://devapi.cloudpense.com/magneto/api/v1/documents/claim' \
--header 'token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjb21wYW55X2lkIjozODA5LCJleHAiOjE3NjM4MDY1MTksImNsaWVudF9pZCI6IkFyY2hpdmVFeHRlbnNpb24iLCJzb3VyY2VfbmFtZSI6IlNBUCJ9.8uqVNo9Mi0yc3lPIZMth7r1ERCDmdhOfj0Lek7d1j90' \
--header 'Content-Type: application/json' \
--data-raw '{
  "biz_id": "dbe1c496-0d51-415e-87a5-ed104dea597f",
  "timestamp": 1759295384729,
  "data": {
    "claim_num": "EXP202510211052",
    "claim_type": "EXPENSE_CLAIM",
    "submit_user_num": "EMP001",
    "submit_user_name": "李虎",
    "submit_department_code": "DEPT001",
    "submit_department_name": "财务部",
    "fee_user_num": "EMP001",
    "fee_user_name": "张三",
    "fee_department_code": "DEPT001",
    "fee_department_name": "财务部",
    "branch_code": "BRANCH001",
    "branch_name": "总部",
    "pay_object_type": "EMPLOYEE",
    "pay_user_code": "EMP001",
    "pay_user_name": "张三",
    "supplier_code": "SUP001",
    "supplier_name": "供应商A",
    "submit_time": 1735797754000,
    "preapproved_time": 1735797754000,
    "checked_time": 1735797754000,
    "approved_time": 1735797754000,
    "gl_period": "2025-01",
    "total_amount": 1000.5,
    "currency": "CNY",
    "project_code": "PRJ001",
    "project_name": "系统开发项目",
    "external_person_code": "EXT001",
    "external_person_name": "外部顾问",
    "customer_code": "CUST001",
    "customer_name": "客户A",
    "asset_code": "ASSET001",
    "asset_name": "固定资产A",
    "source_code": "S001",
    "document_ext_num": "EXP20251122xxn1",
    "document_type_code": "S001xxxx",
    "document_sub_type": "TRAVEL_EXPENSE",
    "document_num": "EXP202510211052",
    "document_desc": "差旅费报销单",
    "archive_type_code": "F003",
    "file_num_list": []
  }
}'

返回数据

{
  "resCode": 200000,
  "resMsg": "会计资料创建成功",
  "data": {
    "id": null,
    "document_ext_num": "EXP20251122xxn1"
  }
}

枚举值和字典说明

document_type_code(会计资料类型编码)

编码 说明 对应子表 备注
S001 记账凭证 无(仅主表) 会计凭证类文档
S002 会计资料单据 mag_document_claim 报销单、申请单等
S003 进项发票 mag_document_invoice 增值税进项发票
S004 销项发票 mag_document_invoice 增值税销项发票
S005 银行回单 mag_document_receipt 银行收付款凭证

archive_type_code(档案类型编码)

根据《电子会计档案管理办法》,电子会计档案分为4类:

编码 说明 备注
F003 电子会计凭证类 记账凭证、原始凭证等
KJZB 电子会计账簿 总账、明细账、日记账等
KJBG 电子财务会计报告 财务报表、财务分析等
QTZL 其他电子会计资料 银行对账单、税务文件等

常用币种代码(currency/invoice_currency/payment_currency)

代码 说明
CNY 人民币
USD 美元
EUR 欧元
JPY 日元
HKD 港币

results matching ""

    No results matching ""