支持包括发票代码、发票号码、销售方名称、销售方识别号、购买方名称、购买方识别号、合计金额等关键字段结构化识别输出。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
ocr:RecognizeCommonPrintedInvoice | get |
|
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
Url | string | 否 | 图片链接(长度不超 2048 字节,不支持 base64) | https://img.alicdn.com/imgextra/i2/O1CN01XU9dTh1O4CdHxXhMw_!!6000000001651-0-tps-1437-909.jpg |
body | byte | 否 | 图片二进制字节流,最大 10MB | 图片二进制 |
返回参数
中英文映射字段
title 标题
formType 发票联次
invoiceCode 发票代码
invoiceNumber 发票号码
printedInvoiceCode 发票代码-机打
printedInvoiceNumber 发票号码-机打
invoiceDate 开票日期
totalAmount 合计金额
sellerName 销售方名称
sellerTaxNumber 销售方纳税人识别号
purchaserName 购买方名称
purchaserTaxNumber 购买方纳税人识别号
drawer 开票人
recipient 收款人
remarks 备注
invoiceDetails 发票详单
itemName 项目名称
unit 单位
quantity 数量
unitPrice 单价
amount 总值
ftype 是否是复印件(1:是,0:否)
示例
正常返回示例
JSON
格式
{
"RequestId": "43A29C77-405E-4CC0-BC55-EE694AD00655",
"Data": "{\n \"angle\": 0,\n \"data\": {\n \"title\": \"浙江通用机打发票\",\n \"formType\": \"发票联\",\n \"invoiceCode\": \"133041930432\",\n \"invoiceNumber\": \"01488558\",\n \"printedInvoiceCode\": \"\",\n \"printedInvoiceNumber\": \"\",\n \"invoiceDate\": \"2019-11-19\",\n \"totalAmount\": \"170.00\",\n \"sellerName\": \"嘉兴市南湖区余新镇瘦汁味餐饮店\",\n \"sellerTaxNumber\": \"92330402MA28B4LL4B\",\n \"purchaserName\": \"阿里巴巴俪人购(上海)电子商务有限公司\",\n \"purchaserTaxNumber\": \"91310114312356647G\",\n \"drawer\": \"高伟\",\n \"recipient\": \"\",\n \"remarks\": \"\",\n \"invoiceDetails\": [\n {\n \"itemName\": \"餐饮费\",\n \"unit\": \"\",\n \"quantity\": \"1\",\n \"unitPrice\": \"170.00\",\n \"amount\": \"170.00\"\n }\n ]\n },\n \"ftype\": 0,\n \"height\": 909,\n \"orgHeight\": 909,\n \"orgWidth\": 1437,\n \"prism_keyValueInfo\": [\n {\n \"key\": \"title\",\n \"keyProb\": 100,\n \"value\": \"浙江通用机打发票\",\n \"valuePos\": [\n {\n \"x\": 431,\n \"y\": 68\n },\n {\n \"x\": 843,\n \"y\": 62\n },\n {\n \"x\": 843,\n \"y\": 125\n },\n {\n \"x\": 431,\n \"y\": 130\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"formType\",\n \"keyProb\": 100,\n \"value\": \"发票联\",\n \"valuePos\": [\n {\n \"x\": 507,\n \"y\": 154\n },\n {\n \"x\": 767,\n \"y\": 152\n },\n {\n \"x\": 768,\n \"y\": 214\n },\n {\n \"x\": 508,\n \"y\": 215\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"invoiceCode\",\n \"keyProb\": 100,\n \"value\": \"133041930432\",\n \"valuePos\": [\n {\n \"x\": 990,\n \"y\": 134\n },\n {\n \"x\": 1283,\n \"y\": 131\n },\n {\n \"x\": 1283,\n \"y\": 167\n },\n {\n \"x\": 991,\n \"y\": 171\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"invoiceNumber\",\n \"keyProb\": 100,\n \"value\": \"01488558\",\n \"valuePos\": [\n {\n \"x\": 999,\n \"y\": 195\n },\n {\n \"x\": 1197,\n \"y\": 193\n },\n {\n \"x\": 1198,\n \"y\": 234\n },\n {\n \"x\": 999,\n \"y\": 235\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"printedInvoiceCode\",\n \"keyProb\": 100,\n \"value\": \"\",\n \"valueProb\": 100\n },\n {\n \"key\": \"printedInvoiceNumber\",\n \"keyProb\": 100,\n \"value\": \"\",\n \"valueProb\": 100\n },\n {\n \"key\": \"invoiceDate\",\n \"keyProb\": 100,\n \"value\": \"2019-11-19\",\n \"valuePos\": [\n {\n \"x\": 153,\n \"y\": 280\n },\n {\n \"x\": 351,\n \"y\": 278\n },\n {\n \"x\": 351,\n \"y\": 309\n },\n {\n \"x\": 154,\n \"y\": 312\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"totalAmount\",\n \"keyProb\": 100,\n \"value\": \"170.00\",\n \"valuePos\": [\n {\n \"x\": 300,\n \"y\": 752\n },\n {\n \"x\": 461,\n \"y\": 749\n },\n {\n \"x\": 462,\n \"y\": 786\n },\n {\n \"x\": 300,\n \"y\": 788\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"sellerName\",\n \"keyProb\": 100,\n \"value\": \"嘉兴市南湖区余新镇瘦汁味餐饮店\",\n \"valuePos\": [\n {\n \"x\": 220,\n \"y\": 455\n },\n {\n \"x\": 612,\n \"y\": 450\n },\n {\n \"x\": 612,\n \"y\": 482\n },\n {\n \"x\": 221,\n \"y\": 488\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"sellerTaxNumber\",\n \"keyProb\": 97,\n \"value\": \"92330402MA28B4LL4B\",\n \"valuePos\": [\n {\n \"x\": 224,\n \"y\": 511\n },\n {\n \"x\": 476,\n \"y\": 509\n },\n {\n \"x\": 477,\n \"y\": 537\n },\n {\n \"x\": 225,\n \"y\": 539\n }\n ],\n \"valueProb\": 97\n },\n {\n \"key\": \"purchaserName\",\n \"keyProb\": 98,\n \"value\": \"阿里巴巴俪人购(上海)电子商务有限公司\",\n \"valuePos\": [\n {\n \"x\": 213,\n \"y\": 327\n },\n {\n \"x\": 714,\n \"y\": 324\n },\n {\n \"x\": 715,\n \"y\": 359\n },\n {\n \"x\": 214,\n \"y\": 363\n }\n ],\n \"valueProb\": 98\n },\n {\n \"key\": \"purchaserTaxNumber\",\n \"keyProb\": 100,\n \"value\": \"91310114312356647G\",\n \"valuePos\": [\n {\n \"x\": 221,\n \"y\": 406\n },\n {\n \"x\": 480,\n \"y\": 402\n },\n {\n \"x\": 481,\n \"y\": 432\n },\n {\n \"x\": 221,\n \"y\": 435\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"drawer\",\n \"keyProb\": 100,\n \"value\": \"高伟\",\n \"valuePos\": [\n {\n \"x\": 680,\n \"y\": 819\n },\n {\n \"x\": 680,\n \"y\": 850\n },\n {\n \"x\": 627,\n \"y\": 850\n },\n {\n \"x\": 627,\n \"y\": 819\n }\n ],\n \"valueProb\": 100\n },\n {\n \"key\": \"recipient\",\n \"keyProb\": 100,\n \"value\": \"\",\n \"valueProb\": 100\n },\n {\n \"key\": \"remarks\",\n \"keyProb\": 100,\n \"value\": \"\",\n \"valueProb\": 100\n },\n {\n \"key\": \"invoiceDetails\",\n \"keyProb\": 100,\n \"value\": \"[{\\\"itemName\\\":\\\"餐饮费\\\",\\\"unit\\\":\\\"\\\",\\\"quantity\\\":\\\"1\\\",\\\"unitPrice\\\":\\\"170.00\\\",\\\"amount\\\":\\\"170.00\\\"}]\",\n \"valueProb\": 100\n }\n ],\n \"sliceRect\": {\n \"x0\": 0,\n \"y0\": 7,\n \"x1\": 1416,\n \"y1\": 0,\n \"x2\": 1421,\n \"y2\": 907,\n \"x3\": 0,\n \"y3\": 904\n },\n \"width\": 1437\n}",
"Code": "noPermission",
"Message": "You are not authorized to perform this operation."
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|
暂无变更历史