发票-会计资料创建

  • 接口:magneto/api/v1/documents/invoice
  • 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 - 文件编号列表 关联的文件编号数组
in_out_flag Integer - 收支类型 1-进项,2-销项
invoice_type String ≤100 发票类型 增值税专用发票、普通发票等
invoice_code String ≤100 发票代码 税务局分配的发票代码
invoice_num String ≤255 发票号码 发票的唯一号码
invoice_date Long - 发票日期 发票开具日期(13位时间戳-毫秒)
invoice_amount Decimal (20,2) 合计金额 发票的合计金额
invoice_tax_amount Decimal (20,2) 税额 发票的税额
invoice_currency String ≤10 发票币种 发票金额的币种
buyer_name String ≤255 购买方名称 发票购买方名称
seller_name String ≤255 销售方名称 发票销售方名称
invoice_note String ≤255 发票备注 发票的备注信息
claim_num String ≤64 单据号 关联的单据号

返回参数

字段名 类型 说明
resCode Integer 响应代码,200000表示成功
resMsg String 响应消息
data Object 响应数据对象
document_ext_num String 会计资料外部系统编号

示例:

请求数据


curl --location --request POST 'https://devapi.cloudpense.com/magneto/api/v1/documents/invoice' \
--header 'token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjb21wYW55X2lkIjozODA5LCJleHAiOjE3NjM4MDY1MTksImNsaWVudF9pZCI6IkFyY2hpdmVFeHRlbnNpb24iLCJzb3VyY2VfbmFtZSI6IlNBUCJ9.8uqVNo9Mi0yc3lPIZMth7r1ERCDmdhOfj0Lek7d1j90' \
--header 'Content-Type: application/json' \
--data-raw '{
  "biz_id": "abe2c497-1d52-426f-98b6-fe205efb698e",
  "timestamp": 1759295385729,
  "data": {
    "in_out_flag": 2,
    "invoice_type": "VAT_INVOICE",
    "invoice_code": "25222000000053533133",
    "invoice_num": "25222000000053533133",
    "invoice_date": 1735787400000,
    "invoice_amount": 284,
    "invoice_tax_amount": 2.81,
    "invoice_currency": "CNY",
    "buyer_name": "上海云简软件科技有限公司",
    "seller_name": "高新技术产业开发区和满楼餐饮店(个体工商户)",
    "invoice_note": "",
    "source_code": "S001",
    "document_ext_num": "25222000000053533133-04",
    "document_type_code": "S003",
    "document_sub_type": "VAT_SPECIAL",
    "document_num": "INV0000001003",
    "document_desc": "增值税专用发票",
    "archive_type_code": "F003"
  }
}'

返回数据

成功示例

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

枚举值和字典说明

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 其他电子会计资料 银行对账单、税务文件等

in_out_flag(收支类型)

说明 适用范围
1 进项 增值税进项发票
2 销项 增值税销项发票

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

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

results matching ""

    No results matching ""