RecognizeRollTicket - 增值税发票卷票识别

支持对卷票上包括发票代码、发票号码、开票日期、发票金额、校验码、大写金额、销售方税号、购买方税号等关键字段结构化识别输出。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ocr:RecognizeRollTicket
  • 全部资源
    *

请求参数

名称类型必填描述示例值
Urlstring

图片链接(长度不超 2048 字节,不支持 base64)

https://img.alicdn.com/tfs/TB1Y2ryJKT2gK0jSZFvXXXnFXXa-438-934.png
bodybyte

图片二进制文件,最大 10MB,与 URL 二选一。 使用 HTTP 方式调用,把图片二进制文件放到 HTTP body 中上传即可。 使用 SDK 的方式调用,把图片放到 SDK 的 body 中即可。

图片二进制文件

支持的图片格式

  • PNG、JPG、JPEG、BMP、GIF、TIFF、WebP、PDF、OFD

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

请求唯一 ID

43A29C77-405E-4CC0-BC55-EE694AD00655
Datastring

返回数据

{ "data": { "title": "用增值税普通发票(卷票)", "invoiceCode": "041001800107", "invoiceNumber": "04594258", "machineCode": "661718338084", "sellerName": "中国石化销售有限公司河南许昌石油分公司第二经营部", "sellerTaxNumber": "914110237241033719", "purchaserName": "上海恒企教育培训有限公司许昌许都广场分公司", "purchaserTaxCode": "212", "invoiceDate": "2019年4月27日", "cashier": "安冬梅", "totalAmountInWords": "陆佰元整", "totalAmount": "600.00", "checkCode": "65584298472538424744", "invoiceDetails": [{ "itemName": "*预付卡销售*加油卡充值款", "quantity": "1.00", "unitPrice": "600.00", "amount": "600.00" }, { "itemName": "*预付卡销售*积分*预付卡销售*积分", "quantity": "1.0", "unitPrice": "13.78", "amount": "13.78" }] }, "height": 934, "orgHeight": 934, "orgWidth": 438, "prism_keyValueInfo": [{ "key": "title", "keyProb": 95, "value": "用增值税普通发票(卷票)", "valuePos": [{ "x": 89, "y": 61 }, { "x": 90, "y": 23 }, { "x": 435, "y": 40 }, { "x": 434, "y": 78 }], "valueProb": 95 }, { "key": "invoiceCode", "keyProb": 99, "value": "041001800107", "valuePos": [{ "x": 130, "y": 199 }, { "x": 132, "y": 175 }, { "x": 304, "y": 187 }, { "x": 303, "y": 210 }], "valueProb": 99 }, { "key": "invoiceNumber", "keyProb": 99, "value": "04594258", "valuePos": [{ "x": 132, "y": 230 }, { "x": 133, "y": 210 }, { "x": 247, "y": 216 }, { "x": 245, "y": 237 }], "valueProb": 99 }, { "key": "machineCode", "keyProb": 100, "value": "661718338084", "valuePos": [{ "x": 294, "y": 254 }, { "x": 294, "y": 238 }, { "x": 394, "y": 243 }, { "x": 393, "y": 258 }], "valueProb": 100 }, { "key": "sellerName", "keyProb": 100, "value": "中国石化销售有限公司河南许昌石油分公司第二经营部", "valuePos": [{ "x": 124, "y": 290 }, { "x": 125, "y": 260 }, { "x": 370, "y": 266 }, { "x": 369, "y": 297 }], "valueProb": 100 }, { "key": "sellerTaxNumber", "keyProb": 98, "value": "914110237241033719", "valuePos": [{ "x": 139, "y": 323 }, { "x": 140, "y": 310 }, { "x": 293, "y": 312 }, { "x": 293, "y": 326 }], "valueProb": 98 }, { "key": "purchaserName", "keyProb": 100, "value": "上海恒企教育培训有限公司许昌许都广场分公司", "valuePos": [{ "x": 125, "y": 349 }, { "x": 365, "y": 349 }, { "x": 365, "y": 382 }, { "x": 125, "y": 382 }], "valueProb": 100 }, { "key": "purchaserTaxCode", "keyProb": 70, "value": "212", "valuePos": [{ "x": 138, "y": 394 }, { "x": 138, "y": 410 }, { "x": 38, "y": 411 }, { "x": 37, "y": 396 }], "valueProb": 70 }, { "key": "invoiceDate", "keyProb": 100, "value": "2019年4月27日", "valuePos": [{ "x": 106, "y": 345 }, { "x": 107, "y": 329 }, { "x": 217, "y": 331 }, { "x": 217, "y": 348 }], "valueProb": 100 }, { "key": "cashier", "keyProb": 100, "value": "安冬梅", "valuePos": [{ "x": 274, "y": 348 }, { "x": 275, "y": 332 }, { "x": 324, "y": 333 }, { "x": 324, "y": 350 }], "valueProb": 100 }, { "key": "totalAmountInWords", "keyProb": 100, "value": "陆佰元整", "valuePos": [{ "x": 120, "y": 804 }, { "x": 190, "y": 800 }, { "x": 191, "y": 818 }, { "x": 120, "y": 821 }], "valueProb": 100 }, { "key": "totalAmount", "keyProb": 100, "value": "600.00", "valuePos": [{ "x": 121, "y": 785 }, { "x": 181, "y": 783 }, { "x": 182, "y": 796 }, { "x": 121, "y": 799 }], "valueProb": 100 }, { "key": "checkCode", "keyProb": 96, "value": "65584298472538424744", "valuePos": [{ "x": 95, "y": 827 }, { "x": 283, "y": 817 }, { "x": 284, "y": 831 }, { "x": 96, "y": 841 }], "valueProb": 96 }, { "key": "invoiceDetails", "keyProb": 100, "value": "[{\"itemName\":\"*预付卡销售*加油卡充值款\",\"quantity\":\"1.00\",\"unitPrice\":\"600.00\",\"amount\":\"600.00\"},{\"itemName\":\"*预付卡销售*积分*预付卡销售*积分\",\"quantity\":\"1.0\",\"unitPrice\":\"13.78\",\"amount\":\"13.78\"}]", "valueProb": 100 }], "width": 438 }
Codestring

状态码

200
Messagestring

详细信息

message

中英文字段映射

invoiceCode          发票代码
invoiceNumber          发票号码
invoiceDate          开票日期
checkCode          校验码
sellerName          销售方名称
sellerTaxNumber          销售方税号
purchaserName          购买方名称
purchaserTaxCode          购买方税号
title          标题
IGNORE          机打号码
machineCode          机器编号
cashier          收款员
totalAmountInWords          合计金额(大写)
totalAmount          合计金额(小写)
invoiceDetails          发票详单
itemName            项目
quantity            数量
unitPrice            单价
amount            金额

示例

正常返回示例

JSON格式

{
  "RequestId": "43A29C77-405E-4CC0-BC55-EE694AD00655",
  "Data": "{ \t\"data\": { \t\t\"title\": \"用增值税普通发票(卷票)\", \t\t\"invoiceCode\": \"041001800107\", \t\t\"invoiceNumber\": \"04594258\", \t\t\"machineCode\": \"661718338084\", \t\t\"sellerName\": \"中国石化销售有限公司河南许昌石油分公司第二经营部\", \t\t\"sellerTaxNumber\": \"914110237241033719\", \t\t\"purchaserName\": \"上海恒企教育培训有限公司许昌许都广场分公司\", \t\t\"purchaserTaxCode\": \"212\", \t\t\"invoiceDate\": \"2019年4月27日\", \t\t\"cashier\": \"安冬梅\", \t\t\"totalAmountInWords\": \"陆佰元整\", \t\t\"totalAmount\": \"600.00\", \t\t\"checkCode\": \"65584298472538424744\", \t\t\"invoiceDetails\": [{ \t\t\t\"itemName\": \"*预付卡销售*加油卡充值款\", \t\t\t\"quantity\": \"1.00\", \t\t\t\"unitPrice\": \"600.00\", \t\t\t\"amount\": \"600.00\" \t\t}, { \t\t\t\"itemName\": \"*预付卡销售*积分*预付卡销售*积分\", \t\t\t\"quantity\": \"1.0\", \t\t\t\"unitPrice\": \"13.78\", \t\t\t\"amount\": \"13.78\" \t\t}] \t}, \t\"height\": 934, \t\"orgHeight\": 934, \t\"orgWidth\": 438, \t\"prism_keyValueInfo\": [{ \t\t\"key\": \"title\", \t\t\"keyProb\": 95, \t\t\"value\": \"用增值税普通发票(卷票)\", \t\t\"valuePos\": [{ \t\t\t\"x\": 89, \t\t\t\"y\": 61 \t\t}, { \t\t\t\"x\": 90, \t\t\t\"y\": 23 \t\t}, { \t\t\t\"x\": 435, \t\t\t\"y\": 40 \t\t}, { \t\t\t\"x\": 434, \t\t\t\"y\": 78 \t\t}], \t\t\"valueProb\": 95 \t}, { \t\t\"key\": \"invoiceCode\", \t\t\"keyProb\": 99, \t\t\"value\": \"041001800107\", \t\t\"valuePos\": [{ \t\t\t\"x\": 130, \t\t\t\"y\": 199 \t\t}, { \t\t\t\"x\": 132, \t\t\t\"y\": 175 \t\t}, { \t\t\t\"x\": 304, \t\t\t\"y\": 187 \t\t}, { \t\t\t\"x\": 303, \t\t\t\"y\": 210 \t\t}], \t\t\"valueProb\": 99 \t}, { \t\t\"key\": \"invoiceNumber\", \t\t\"keyProb\": 99, \t\t\"value\": \"04594258\", \t\t\"valuePos\": [{ \t\t\t\"x\": 132, \t\t\t\"y\": 230 \t\t}, { \t\t\t\"x\": 133, \t\t\t\"y\": 210 \t\t}, { \t\t\t\"x\": 247, \t\t\t\"y\": 216 \t\t}, { \t\t\t\"x\": 245, \t\t\t\"y\": 237 \t\t}], \t\t\"valueProb\": 99 \t}, { \t\t\"key\": \"machineCode\", \t\t\"keyProb\": 100, \t\t\"value\": \"661718338084\", \t\t\"valuePos\": [{ \t\t\t\"x\": 294, \t\t\t\"y\": 254 \t\t}, { \t\t\t\"x\": 294, \t\t\t\"y\": 238 \t\t}, { \t\t\t\"x\": 394, \t\t\t\"y\": 243 \t\t}, { \t\t\t\"x\": 393, \t\t\t\"y\": 258 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"sellerName\", \t\t\"keyProb\": 100, \t\t\"value\": \"中国石化销售有限公司河南许昌石油分公司第二经营部\", \t\t\"valuePos\": [{ \t\t\t\"x\": 124, \t\t\t\"y\": 290 \t\t}, { \t\t\t\"x\": 125, \t\t\t\"y\": 260 \t\t}, { \t\t\t\"x\": 370, \t\t\t\"y\": 266 \t\t}, { \t\t\t\"x\": 369, \t\t\t\"y\": 297 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"sellerTaxNumber\", \t\t\"keyProb\": 98, \t\t\"value\": \"914110237241033719\", \t\t\"valuePos\": [{ \t\t\t\"x\": 139, \t\t\t\"y\": 323 \t\t}, { \t\t\t\"x\": 140, \t\t\t\"y\": 310 \t\t}, { \t\t\t\"x\": 293, \t\t\t\"y\": 312 \t\t}, { \t\t\t\"x\": 293, \t\t\t\"y\": 326 \t\t}], \t\t\"valueProb\": 98 \t}, { \t\t\"key\": \"purchaserName\", \t\t\"keyProb\": 100, \t\t\"value\": \"上海恒企教育培训有限公司许昌许都广场分公司\", \t\t\"valuePos\": [{ \t\t\t\"x\": 125, \t\t\t\"y\": 349 \t\t}, { \t\t\t\"x\": 365, \t\t\t\"y\": 349 \t\t}, { \t\t\t\"x\": 365, \t\t\t\"y\": 382 \t\t}, { \t\t\t\"x\": 125, \t\t\t\"y\": 382 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"purchaserTaxCode\", \t\t\"keyProb\": 70, \t\t\"value\": \"212\", \t\t\"valuePos\": [{ \t\t\t\"x\": 138, \t\t\t\"y\": 394 \t\t}, { \t\t\t\"x\": 138, \t\t\t\"y\": 410 \t\t}, { \t\t\t\"x\": 38, \t\t\t\"y\": 411 \t\t}, { \t\t\t\"x\": 37, \t\t\t\"y\": 396 \t\t}], \t\t\"valueProb\": 70 \t}, { \t\t\"key\": \"invoiceDate\", \t\t\"keyProb\": 100, \t\t\"value\": \"2019年4月27日\", \t\t\"valuePos\": [{ \t\t\t\"x\": 106, \t\t\t\"y\": 345 \t\t}, { \t\t\t\"x\": 107, \t\t\t\"y\": 329 \t\t}, { \t\t\t\"x\": 217, \t\t\t\"y\": 331 \t\t}, { \t\t\t\"x\": 217, \t\t\t\"y\": 348 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"cashier\", \t\t\"keyProb\": 100, \t\t\"value\": \"安冬梅\", \t\t\"valuePos\": [{ \t\t\t\"x\": 274, \t\t\t\"y\": 348 \t\t}, { \t\t\t\"x\": 275, \t\t\t\"y\": 332 \t\t}, { \t\t\t\"x\": 324, \t\t\t\"y\": 333 \t\t}, { \t\t\t\"x\": 324, \t\t\t\"y\": 350 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"totalAmountInWords\", \t\t\"keyProb\": 100, \t\t\"value\": \"陆佰元整\", \t\t\"valuePos\": [{ \t\t\t\"x\": 120, \t\t\t\"y\": 804 \t\t}, { \t\t\t\"x\": 190, \t\t\t\"y\": 800 \t\t}, { \t\t\t\"x\": 191, \t\t\t\"y\": 818 \t\t}, { \t\t\t\"x\": 120, \t\t\t\"y\": 821 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"totalAmount\", \t\t\"keyProb\": 100, \t\t\"value\": \"600.00\", \t\t\"valuePos\": [{ \t\t\t\"x\": 121, \t\t\t\"y\": 785 \t\t}, { \t\t\t\"x\": 181, \t\t\t\"y\": 783 \t\t}, { \t\t\t\"x\": 182, \t\t\t\"y\": 796 \t\t}, { \t\t\t\"x\": 121, \t\t\t\"y\": 799 \t\t}], \t\t\"valueProb\": 100 \t}, { \t\t\"key\": \"checkCode\", \t\t\"keyProb\": 96, \t\t\"value\": \"65584298472538424744\", \t\t\"valuePos\": [{ \t\t\t\"x\": 95, \t\t\t\"y\": 827 \t\t}, { \t\t\t\"x\": 283, \t\t\t\"y\": 817 \t\t}, { \t\t\t\"x\": 284, \t\t\t\"y\": 831 \t\t}, { \t\t\t\"x\": 96, \t\t\t\"y\": 841 \t\t}], \t\t\"valueProb\": 96 \t}, { \t\t\"key\": \"invoiceDetails\", \t\t\"keyProb\": 100, \t\t\"value\": \"[{\\\"itemName\\\":\\\"*预付卡销售*加油卡充值款\\\",\\\"quantity\\\":\\\"1.00\\\",\\\"unitPrice\\\":\\\"600.00\\\",\\\"amount\\\":\\\"600.00\\\"},{\\\"itemName\\\":\\\"*预付卡销售*积分*预付卡销售*积分\\\",\\\"quantity\\\":\\\"1.0\\\",\\\"unitPrice\\\":\\\"13.78\\\",\\\"amount\\\":\\\"13.78\\\"}]\", \t\t\"valueProb\": 100 \t}], \t\"width\": 438 }",
  "Code": "200",
  "Message": "message"
}

错误码

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2021-08-17OpenAPI 入参发生变更查看变更详情