跳转到主要内容

Endpoint

POST /v1/tool/invoiceOcr
分组: 工具 / 发票

Headers

  • Authorization: 必填 示例: Bearer sk-
  • Content-Type: 必填 示例: application/json

Responses

  • 200: 成功

OpenAPI specification

openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/tool/invoiceOcr:
    post:
      summary: 发票OCR识别
      deprecated: false
      description: ''
      tags:
        - 工具/发票
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: true
          example: Bearer sk-
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                base64:
                  type: string
                  description: >-
                    照片base64字符串,base64、pdfBase64、ofdBase64、url 必须提供一个,优先级 base64
                    > pdfBase64 > ofdBase64 > url
                  nullable: true
                url:
                  type: string
                  description: >-
                    照片 url,base64、pdfBase64、ofdBase64、url 必须提供一个,优先级 base64 >
                    pdfBase64 > ofdBase64 > url
                pdfBase64:
                  type: string
                  description: >-
                    pdf文件,base64编码后进行urlencode,要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px,base64、pdfBase64、ofdBase64、url
                    必须提供一个,优先级 base64 > pdfBase64 > ofdBase64 > url
                pdfFileNum:
                  type: string
                  description: 识别pdfBase64中对应的文件页,默认1
                  nullable: true
                type:
                  type: string
                  description: 识别的发票类型,默认normal , normal:可识别增值税普票、专票、电子发票 - roll:可识别增值税卷票
                  nullable: true
                ofdBase64:
                  type: string
                  description: >-
                    发票ofd文件base64字符串。base64、pdfBase64、ofdBase64、url 必须提供一个,优先级
                    base64 > pdfBase64 > ofdBase64 > url
                ofdFileNum:
                  type: string
                  description: 识别ofd文件对应的文件页,默认1
              required:
                - pdfBase64
                - url
                - ofdFileNum
                - ofdBase64
              x-apifox-orders:
                - base64
                - url
                - pdfBase64
                - pdfFileNum
                - type
                - ofdBase64
                - ofdFileNum
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example: "{\r\n    \"data\": {\r\n        \"amountInWords\": \"壹拾圆整\",//价税合计(大写)\r\n        \"invoiceTypeOrg\": \"\",//发票名称\r\n        \"machineNum\":\"\",//机打号码。仅增值税卷票含有此参数\r\n        \"agent\": \"否\",//是否代开\r\n        \"city\": \"\",//市\r\n        \"commodityNum\": [//数量\r\n             {\r\n                \"row\": \"\",//行号\r\n                \"word\":\"\"//内容\r\n            }\r\n        ],\r\n        \"sellerBank\": \"\",//销售方开户行及账号 \r\n        \"sellerName\": \"\",//销售方名称 \r\n        \"sellerAddress\": \"\",//销售方地址及电话 \r\n        \"checker\": \"\",//复核\r\n        \"purchaserAddress\": \"\",//购方地址及电话\r\n        \"totalTax\": \"***\",//合计税额\r\n        \"payee\": \"\",//收款人\r\n        \"password\": \"\",//密码区\r\n        \"province\": \"浙江\",//省\r\n        \"noteDrawer\": \"\",//开票人\r\n        \"invoiceType\": \"电子普通发票\",//发票种类。不同类型发票输出:普通发票、专用发票、电子普通发票、电子专用发票、通行费电子普票、区块链发票、通用机打电子发票、电子发票(专用发票)、电子发票(普通发票)\r\n        \"amountInFiguers\": \"10.00\",//价税合计(小写)\r\n        \"commodityPlateNum\": [//车牌号。仅通行费增值税电子普通发票含有此参数\r\n            {\r\n                \"row\": \"1\",//行号\r\n                \"word\": \"***\"//内容\r\n            }\r\n         ],\r\n        \"commodityTax\": [//税额\r\n            {\r\n                \"row\": \"1\",//行号\r\n                \"word\": \"***\"//内容\r\n            }\r\n        ],\r\n        \"purchaserBank\": \"\",//购方开户行及账号\r\n        \"machineCode\": \"\",//机器编号。仅增值税卷票含有此参数\r\n        \"invoiceNumConfirm\": \"\",//发票号码的辅助校验码\r\n        \"commodityStartDate\": [//通行日期起。仅通行费增值税电子普通发票含有此参数\r\n             {\r\n                \"row\": \"\",//行号\r\n                \"word\":\"\"//内容\r\n            }\r\n        ],\r\n        \"sellerRegisterNum\": \"\",//销售方纳税人识别号\r\n        \"commodityEndDate\": [//通行日期止。仅通行费增值税电子普通发票含有此参数\r\n             {\r\n                \"row\": \"\",//行号\r\n                \"word\":\"\"//内容\r\n            }\r\n         ],\r\n        \"sheetNum\": \"\",//联次信息。专票第一联到第三联分别输出:第一联:记账联、第二联:抵扣联、第三联:发票联;普通发票第一联到第二联分别输出:第一联:记账联、第二联:发票联\r\n        \"invoiceDate\": \"2021年11月12日\",//开票日期\r\n        \"commodityPrice\": [//单价\r\n             {\r\n                \"row\": \"\",//行号\r\n                \"word\":\"\"//内容\r\n            }\r\n         ],\r\n        \"invoiceCode\": \"\",//发票代码\r\n        \"onlinePay\": \"\",//电子支付标识。仅区块链发票含有此参数\r\n        \"commodityType\": [//规格型号\r\n             {\r\n                \"row\": \"\",//行号\r\n                \"word\":\"\"//内容\r\n            }\r\n        ],\r\n        \"invoiceNum\": \"\",//发票号码\r\n        \"purchaserName\": \"\",//购方名称\r\n        \"checkCode\": \"\",//校验码。增值税专票无此参数\r\n        \"totalAmount\": \"10.00\",//合计金额\r\n        \"commodityVehicleType\": [//类型。仅通行费增值税电子普通发票含有此参数\r\n            {\r\n                \"row\": \"1\",//行号\r\n                \"word\": \"***\"//内容\r\n            }\r\n        ],\r\n        \"commodityAmount\": [//金额\r\n            {\r\n                \"row\": \"1\",//行号\r\n                \"word\": \"10.00\"//内容\r\n            }\r\n        ],\r\n        \"purchaserRegisterNum\": \"\",//购方纳税人识别号\r\n        \"commodityTaxRate\": [//税率\r\n            {\r\n                \"row\": \"1\",//行号\r\n                \"word\": \"0%\"//内容\r\n            }\r\n        ],\r\n        \"commodityUnit\": [//单位\r\n             {\r\n                \"row\": \"\",//行号\r\n                \"word\":\"\"//内容\r\n            }\r\n        ],\r\n        \"invoiceCodeConfirm\": \"033002100611\",//发票代码的辅助校验码\r\n        \"remarks\": \"\",//备注\r\n        \"commodityName\": [//货物名称\r\n            {\r\n                \"row\": \"1\",//行号\r\n                \"word\": \"*餐饮服务*货物\"//内容\r\n            }\r\n        ]\r\n    },\r\n  \"code\": 200, // 详见code返回码说明\r\n  \"msg\": \"成功\", // code 对应的描述\r\n  \"taskNo\": \"30853523396532582768\",  // 本次请求号\r\n}"
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 工具/发票
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5443699/apis/api-297299411-run
components:
  schemas: {}
  securitySchemes: {}
servers: []
security: []