本文档为您介绍增值税发票识别RecognizeVATInvoice的语法及示例。
功能描述
RecognizeVATInvoice可以识别增值税发票(电子发票和纸质发票)关键字段内容,包括:校验码、复核人、开票人、发票代码、收款人等。
前提条件
输入限制
- 图片格式:PDF、JPG。
- 图片大小:大小不超过10M。
- 图片分辨率:不限制图片分辨率,但图片分辨率太高可能会导致API识别超时,超时时间为5秒。
- URL地址中不能包含中文字符。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | RecognizeVATInvoice |
要执行的操作。取值:RecognizeVATInvoice。 |
FileType | String | 是 | jpg |
输入的图片格式。 |
FileURL | String | 是 | https://viapi-test.oss-cn-shanghai.aliyuncs.com/test/ant_ai/vat_invoice/2019041500152001020003743286_0.jpg |
图片URL地址。当前仅支持上海地域的OSS链接,如何生成URL请参见生成URL。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Struct |
返回的结果数据内容。 |
|
Box | Struct |
发票关键字位置框。 |
|
Checkers | List | 589,1003,662,1033 |
复核人位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
Clerks | List | 986,1003,1060,1033 |
开票人位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
InvoiceAmounts | List | 1364, 776,1438,804 |
价税合计位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
InvoiceCodes | List | 1378,41,1520,68 |
发票代码位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
InvoiceDates | List | 1376,115,1596,145 |
开票日期位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
InvoiceFakeCodes | List | 1376,153,1640,181 |
校验码位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
InvoiceNoes | List | 1377,78,1478,105 |
发票号码位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
PayeeAddresses | List | 355,909,734,939 |
购买方地址及电话位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
PayeeBankNames | List | 354,947,938,977 |
购买方开户行及账号位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
PayeeNames | List | 356,833,633,865 |
购买方名称位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
PayeeRegisterNoes | List | 356,873,571,902 |
销售方纳税人识别号位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
Payees | List | 189,1003,264,1033 |
收款人位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
PayerAddresses | List | 0,0,0,0 |
销售方地址及电话位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
PayerBankNames | List | 0,0,0,0 |
销售方开户行及账号位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
PayerNames | List | 354,222,700,255 |
购买方名称位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
PayerRegisterNoes | List | 358,262,567,290 |
购买方纳税人识别号位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
SumAmounts | List | 32,774,629,805 |
价税合计位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
TaxAmounts | List | 1606,721,1658,748 |
合计税额位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
WithoutTaxAmounts | List | 1265,721,1339,749 |
合计金额位置框信息,格式为【左上角点x坐标,左上角点y坐标,右上角点x坐标,右上角点y坐标】。 |
Content | Struct |
合计金额识别发票各项结果。 |
|
AntiFakeCode | String | 02702870934284730434 |
校验码。 |
Checker | String | 赵弯弯 |
复核人。 |
Clerk | String | 赵弯弯 |
开票人。 |
InvoiceAmount | String | 200.00 |
价税合计(小写)。 |
InvoiceCode | String | 031001600311 |
发票代码。 |
InvoiceDate | String | 20190415 |
开票日期。 |
InvoiceNo | String | 80625433 |
发票号码。 |
Payee | String | 赵弯弯 |
收款人。 |
PayeeAddress | String | 上海虹桥机场迎宾二路161号22342185 |
销售方地址、电话。 |
PayeeBankName | String | 上海浦东发展银行空港支行076389-98910158000000030-22 |
销售方开户行及账号。 |
PayeeName | String | 上海机场(集团)有限公司 |
销售方名称。 |
PayeeRegisterNo | String | 91310000132284295X |
销售方纳税人识别号。 |
PayerAddress | String | xxx |
购买方地址、电话。 |
PayerBankName | String | xxx |
购买方开户行及账号。 |
PayerName | String | 百特医疗用品贸易(上海)有限公司 |
购买方名称。 |
PayerRegisterNo | String | 91310000607402073L |
购买方纳税人识别号。 |
SumAmount | String | 200.00 |
价税合计(大写)。 |
TaxAmount | String | 9.52 |
合计税额。 |
WithoutTaxAmount | String | 190.48 |
合计金额。 |
RequestId | String | 20926BD9-7B2A-48D3-8B05-99F380791271 |
请求ID。 |
示例
请求示例
http(s)://ocr.cn-shanghai.aliyuncs.com/?Action=RecognizeVATInvoice
&FileType=jpg
&FileURL=https://viapi-test.oss-cn-shanghai.aliyuncs.com/test/ant_ai/vat_invoice/2019041500152001020003743286_0.jpg
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>20926BD9-7B2A-48D3-8B05-99F380791271</RequestId>
<Data>
<Content>
<Checker>赵弯弯</Checker>
<PayeeAddress>上海虹桥机场迎宾二路161号22342185</PayeeAddress>
<PayeeName>上海机场(集团)有限公司</PayeeName>
<PayerAddress/>
<AntiFakeCode>02702870934284730434</AntiFakeCode>
<PayerBankName/>
<InvoiceNo>80625433</InvoiceNo>
<PayerRegisterNo>91310000607402073L</PayerRegisterNo>
<PayerName>百特医疗用品贸易(上海)有限公司</PayerName>
<WithoutTaxAmount>190.48</WithoutTaxAmount>
<InvoiceAmount>200.00</InvoiceAmount>
<TaxAmount>9.52</TaxAmount>
<PayeeBankName>上海浦东发展银行空港支行076389-98910158000000030-22</PayeeBankName>
<Clerk>赵弯弯</Clerk>
<InvoiceCode>031001600311</InvoiceCode>
<PayeeRegisterNo>91310000132284295X</PayeeRegisterNo>
<InvoiceDate>20190415</InvoiceDate>
<SumAmount>200.00</SumAmount>
<Payee>赵弯弯</Payee>
</Content>
<Box>
<PayerRegisterNoes>358</PayerRegisterNoes>
<PayerRegisterNoes>262</PayerRegisterNoes>
<PayerRegisterNoes>567</PayerRegisterNoes>
<PayerRegisterNoes>290</PayerRegisterNoes>
<PayerAddresses>0</PayerAddresses>
<PayerAddresses>0</PayerAddresses>
<PayerAddresses>0</PayerAddresses>
<PayerAddresses>0</PayerAddresses>
<InvoiceAmounts>1364</InvoiceAmounts>
<InvoiceAmounts>776</InvoiceAmounts>
<InvoiceAmounts>1438</InvoiceAmounts>
<InvoiceAmounts>804</InvoiceAmounts>
<InvoiceDates>1376</InvoiceDates>
<InvoiceDates>115</InvoiceDates>
<InvoiceDates>1596</InvoiceDates>
<InvoiceDates>145</InvoiceDates>
<PayeeAddresses>355</PayeeAddresses>
<PayeeAddresses>909</PayeeAddresses>
<PayeeAddresses>734</PayeeAddresses>
<PayeeAddresses>939</PayeeAddresses>
<Clerks>986</Clerks>
<Clerks>1003</Clerks>
<Clerks>1060</Clerks>
<Clerks>1033</Clerks>
<WithoutTaxAmounts>1265</WithoutTaxAmounts>
<WithoutTaxAmounts>721</WithoutTaxAmounts>
<WithoutTaxAmounts>1339</WithoutTaxAmounts>
<WithoutTaxAmounts>749</WithoutTaxAmounts>
<Checkers>589</Checkers>
<Checkers>1003</Checkers>
<Checkers>662</Checkers>
<Checkers>1033</Checkers>
<InvoiceCodes>1378</InvoiceCodes>
<InvoiceCodes>41</InvoiceCodes>
<InvoiceCodes>1520</InvoiceCodes>
<InvoiceCodes>68</InvoiceCodes>
<TaxAmounts>1606</TaxAmounts>
<TaxAmounts>721</TaxAmounts>
<TaxAmounts>1658</TaxAmounts>
<TaxAmounts>748</TaxAmounts>
<SumAmounts>532</SumAmounts>
<SumAmounts>774</SumAmounts>
<SumAmounts>629</SumAmounts>
<SumAmounts>805</SumAmounts>
<PayerNames>354</PayerNames>
<PayerNames>222</PayerNames>
<PayerNames>700</PayerNames>
<PayerNames>255</PayerNames>
<InvoiceFakeCodes>1376</InvoiceFakeCodes>
<InvoiceFakeCodes>153</InvoiceFakeCodes>
<InvoiceFakeCodes>1640</InvoiceFakeCodes>
<InvoiceFakeCodes>181</InvoiceFakeCodes>
<PayeeNames>356</PayeeNames>
<PayeeNames>833</PayeeNames>
<PayeeNames>633</PayeeNames>
<PayeeNames>865</PayeeNames>
<PayeeBankNames>354</PayeeBankNames>
<PayeeBankNames>947</PayeeBankNames>
<PayeeBankNames>938</PayeeBankNames>
<PayeeBankNames>977</PayeeBankNames>
<Payees>189</Payees>
<Payees>1003</Payees>
<Payees>264</Payees>
<Payees>1033</Payees>
<InvoiceNoes>1377</InvoiceNoes>
<InvoiceNoes>78</InvoiceNoes>
<InvoiceNoes>1478</InvoiceNoes>
<InvoiceNoes>105</InvoiceNoes>
<PayerBankNames>0</PayerBankNames>
<PayerBankNames>0</PayerBankNames>
<PayerBankNames>0</PayerBankNames>
<PayerBankNames>0</PayerBankNames>
<PayeeRegisterNoes>356</PayeeRegisterNoes>
<PayeeRegisterNoes>873</PayeeRegisterNoes>
<PayeeRegisterNoes>571</PayeeRegisterNoes>
<PayeeRegisterNoes>902</PayeeRegisterNoes>
</Box>
</Data>
JSON
格式
{
"RequestId": "20926BD9-7B2A-48D3-8B05-99F380791271",
"Data": {
"Content": {
"Checker": "赵弯弯",
"PayeeAddress": "上海虹桥机场迎宾二路161号22342185",
"PayeeName": "上海机场(集团)有限公司",
"PayerAddress": "",
"AntiFakeCode": "02702870934284730434",
"PayerBankName": "",
"InvoiceNo": "80625433",
"PayerRegisterNo": "91310000607402073L",
"PayerName": "百特医疗用品贸易(上海)有限公司",
"WithoutTaxAmount": "190.48",
"InvoiceAmount": "200.00",
"TaxAmount": "9.52",
"PayeeBankName": "上海浦东发展银行空港支行076389-98910158000000030-22",
"Clerk": "赵弯弯",
"InvoiceCode": "031001600311",
"PayeeRegisterNo": "91310000132284295X",
"InvoiceDate": "20190415",
"SumAmount": "200.00",
"Payee": "赵弯弯"
},
"Box": {
"PayerRegisterNoes": [
358,
262,
567,
290
],
"PayerAddresses": [
0,
0,
0,
0
],
"InvoiceAmounts": [
1364,
776,
1438,
804
],
"InvoiceDates": [
1376,
115,
1596,
145
],
"PayeeAddresses": [
355,
909,
734,
939
],
"Clerks": [
986,
1003,
1060,
1033
],
"WithoutTaxAmounts": [
1265,
721,
1339,
749
],
"Checkers": [
589,
1003,
662,
1033
],
"InvoiceCodes": [
1378,
41,
1520,
68
],
"TaxAmounts": [
1606,
721,
1658,
748
],
"SumAmounts": [
532,
774,
629,
805
],
"PayerNames": [
354,
222,
700,
255
],
"InvoiceFakeCodes": [
1376,
153,
1640,
181
],
"PayeeNames": [
356,
833,
633,
865
],
"PayeeBankNames": [
354,
947,
938,
977
],
"Payees": [
189,
1003,
264,
1033
],
"InvoiceNoes": [
1377,
78,
1478,
105
],
"PayerBankNames": [
0,
0,
0,
0
],
"PayeeRegisterNoes": [
356,
873,
571,
902
]
}
}
}
错误码
关于增值税发票识别的错误码,详情请参见常见错误码。
SDK参考
阿里云视觉AI能力支持使用SDK调用,具体可参见SDK总览下载安装。
安全声明
- 请确保上传的图片或文件来源符合相应的法律法规。
- 通过体验调试上传的临时文件有效期为1小时,在24小时后会被系统自动清理删除。
在文档使用中是否遇到以下问题
更多建议
匿名提交