票据识别与查验同步 (本地文件)

  • url:/common/InvoiceOCR/ocrSync/local
  • method:post
  • 数据格式:form-data

说明

  • 该接口使用前需找产品开发票识别的子账号
  • 子账号识别限制1张文件不超过3张发票数据

请求参数

字段名称 字段类型 字段描述 是否必填 长度限制 说明
bizId String 业务唯一识别码 true 36
timestamp Long 当前次接口同步时间对应的时间戳 true 13
file MultipartFile 文件 true NA
purchase_invoice String 是否采购发票 true NA Y/N(默认)
create_expense Object 是否创建消费记录 true NA Y/N(默认)
user_code String 工号 false NA 当create_expense为Y时必传

返回参数 (当不需创建消费记录时)

字段名称 字段类型 字段描述
resCode Integer 响应状态码(见附录)
resMsg String 返回信息描述
data.ocrResult Object 识别返回
data.checkResult Object 查验返回

返回字段详情见发票明细查询

返回参数 (当需要创建消费记录时)

字段名称 字段类型 字段描述
resCode Integer 响应状态码(见附录)
resMsg String 返回信息描述
data.expense_id Long 此次请求产生的expense id
data.invoice_message String 业务校验产生的错误信息
data.invoice_message_code String 业务校验产生的错误信息编码
data.invoice_status String 票据状态: Y(已验真),F(查验失败),C(待查验),R(识别中),U(无法识别),I(已识别)

返回字段详情见票据创建

请求示例

{
  "bizId": "xx",
  "timestamp": 123,
  "data": {
    "attachment_url": "xx.pdf",
    "purchase_invoice": "N",
    "create_expense": "Y",
    "user_code": "xx"
  }
}

返回示例 (当不需创建消费记录时)

{
  "resCode": 200000,
  "resMsg": "success",
  "bizId": "xx",
  "data": [
    {
      "ocrResult": {
        "attachment_url": "xx",
        "batch_id": "xx",
        "original_data": "xx",
        "data": "xx",
        "source": "interface",
        "source_file": "Y",
        "invoice_input": "xx",
        "invoice_type": "10",
        "invoice_status": "R",
        "invoice_attachments": "xx",
        "invoice_code": "xx",
        "invoice_num": "xx",
        "invoice_serial": "xx",
        "amount": 996.00,
        "currency": "CNY",
        "invoice_detail": "xx",
        "tax_amount": 82.24,
        "receipt_date": 1712678400000,
        "buyer_name": "xx",
        "buyer_tax_code": "xx",
        "buyer_bank_account": "xx",
        "buyer_addr_tel": "xx-83096666",
        "seller_name": "xx",
        "seller_tax_code": "xx",
        "seller_bank_account": "xx",
        "seller_addr_tel": "xx",
        "pretax_amount": 0,
        "remark": "",
        "name": "xx",
        "shop_name": "xx",
        "pay_method_id": 1,
        "status": 0,
        "abnormal_status": "0",
        "valid_amount": 0,
        "highway_flag": "xx",
        "items": "xx"
      },
      "checkResult": {
        "result": 1,
        "invoiceType": "10",
        "invoiceCode": "xx",
        "invoiceNum": "xx",
        "receiptDate": 1712707200000,
        "checkCode": "xx",
        "totalAmount": 996.00,
        "amount": 913.76,
        "taxAmount": 82.24,
        "remark": "",
        "buyerName": "xx",
        "buyerTaxCode": "xx",
        "buyerAddressPhone": "xx 0518-83096666",
        "buyerAccount": "xx",
        "sellerName": "xx",
        "sellerTaxCode": "xx",
        "sellerAddressPhone": "xx",
        "sellerAccount": "xx",
        "cancellationMark": "N",
        "detailList": [
          {
            "name": "xx",
            "specification": "xx",
            "unit": "xx",
            "amount": 913.76,
            "price": 152.293333,
            "quantity": 6
          }
        ],
        "logId": 0
      }
    }
  ]
}

返回示例 (当需创建消费记录时)

{
  "resCode": 200000,
  "resMsg": "success",
  "bizId": "1659685478833",
  "data":[{
    "expense_id": 41981033,
    "invoice_message": "发票已导入",
    "invoice_message_code": 907002,
    "invoice_status": "F"
  }]
}

results matching ""

    No results matching ""