接口简介
检测单张新车发票图片信息 ,返回 OCR 识别结果
注意
- 接口超时时间为 30 秒
- 资源的 Mime 文件格式仅支持图片类型:image/*,如:image/jpeg、image/png。
- 请求接口为标准的HTTP/HTTPS 协议。
请求语法
POST /ocr/new_car HTTP/1.1
Host: ocr-new-car.qiniuapi.com
Content-Type: application/json
Authorization: QiniuToken
头部信息
头部名称 |
必填 |
说明 |
Host |
是 |
固定为 ocr-new-car.qiniuapi.com |
Content-Type |
是 |
固定为 application/json |
Authorization |
是 |
该参数应严格按照管理凭证格式进行填充,否则会返回 401 错误码。一个合法的 Authorization 值应类似于:Qiniu QNJi_bYJlmO5LeY08FfoNj9w_r7... |
请求body
字段 |
是否必填 |
类型 |
说明 |
image |
Y |
string |
base64编码的图片数据, JPG 或 PNG 格式 |
uuid |
N |
string |
唯一会话 id |
返回
字段 |
类型 |
说明 |
uuid |
string |
请求中的 uuid 字符串,如果请求 中没有发送 uuid 参数,那么这里 的值为空字符串 |
errorcode |
int |
返回状态码 |
items |
jsonObject |
OCR 结果 |
items
字段 |
类型 |
说明 |
print_code |
string |
机打代码 |
print_no |
string |
机打号码 |
machine_no |
string |
机器编号 |
invoice_date |
string |
开票日期 |
invoice_code |
string |
发票代码 |
invoice_no |
string |
发票号码 |
tax_code |
string |
税控码 |
buyer_name |
string |
购方名称 |
buyer_id |
string |
购买方身份证号或组织机构代码 |
buyer_tax_no |
string |
购方纳税人识别号 |
vehicle_type |
string |
车辆类型 |
brand |
string |
厂牌型号 |
production_addr |
string |
产地 |
cert_no |
string |
合格证号 |
import_no |
string |
进口证明书号 |
test_no |
string |
商检单号 |
engine_no |
string |
发动机号码 |
vin |
string |
车辆识别代码 |
amount_big |
string |
价税合计大写 |
amount_small |
string |
价税合计小写 |
seller_name |
string |
销方名称 |
seller_tax_no |
string |
销方纳税人识别号 |
seller_address |
string |
销方地址 |
seller_phone |
string |
销方电话 |
seller_bank_account |
string |
销方账号 |
seller_bank |
string |
销方开户行 |
tax_amount |
string |
增值税税额 |
tax_rate |
string |
增值税税率 |
pretax_amount |
string |
不含价税小写 |
tax_gov_name |
string |
主管税务机关 |
tax_gov_no |
string |
主管税务机关代码 |
示例
POST /ocr/new_car HTTP/1.1
Host: ocr-new-car.qiniuapi.com
Authorization: Qiniu aWQ6lF1Zxxse43jB6V7lsdfaadf:7cWZPxxxxxasdffed60zkI8=
Content-Type: application/json
{
"image": IMAGE_DATA
}
返回示例
{
'errorcode': 0,
'errormsg': 'success',
'session_id': '7800000015836645854820154824909',
'items': {
'print_code': {
'chinese_key': '机打代码',
'words': '145******06'
},
'print_no': {
'chinese_key': '机打号码',
'words': ''
},
'machine_no': {
'chinese_key': '机器编号',
'words': '4999*****268'
},
'invoice_date': {
'chinese_key': '开票日期',
'words': '2018-01-17'
},
'invoice_code': {
'chinese_key': '发票代码',
'words': '145***1206'
},
'invoice_no': {
'chinese_key': '发票号码',
'words': '008**51'
},
'tax_code': {
'chinese_key': '税控码',
'words': ''
},
'buyer_name': {
'chinese_key': '购方名称',
'words': '覃 XX'
},
'buyer_id': {
'chinese_key': '购买方身份证号或组织机构代码',
'words': '452********15'
},
'buyer_tax_no': {
'chinese_key': '购方纳税人识别号',
'words': ''
},
'vehicle_type': {
'chinese_key': '车辆类型',
'words': '多用途乘用车'
},
'brand': {
'chinese_key': '厂牌型号',
'words': '五菱牌'
},
'production_addr': {
'chinese_key': '产地',
'words': 'XX 市'
},
'cert_no': {
'chinese_key': '合格证号',
'words': 'WDS****47'
},
'import_no': {
'chinese_key': '进口证明书号',
'words': ''
},
'test_no': {
'chinese_key': '商检单号',
'words': ''
},
'engine_no': {
'chinese_key': '发动机号码',
'words': 'UHA****24'
},
'vin': {
'chinese_key': '车辆识别代码',
'words': 'LZ********3899'
},
'amount_big': {
'chinese_key': '价税合计大写',
'words': '肆万**圆整'
},
'amount_small': {
'chinese_key': '价税合计小写',
'words': '¥4 ** 00.00 '
},
'seller_name': {
'chinese_key': '销方名称',
'words': 'XXXX 汽车贸易有限公司 '
},
'seller_tax_no': {
'chinese_key': '销方纳税人识别号',
'words': '450*****585'
},
'seller_address': {
'chinese_key': '销方地址',
'words': '玉林市***** 路口'
},
'seller_phone': {
'chinese_key': '销方电话',
'words': '0775-37**8'
},
'seller_bank_account': {
'chinese_key': '销方账号',
'words': '450******85'
},
'seller_bank': {
'chinese_key': '销方开户行',
'words': '建设银行 xx 支'
'tax_amount': {
'chinese_key': '增值税税额',
'words': '¥7***.95'
},
'tax_rate': {
'chinese_key': '增值税税率',
'words': '17%'
},
'pretax_amount': {
'chinese_key': '不含价税小写',
'words': '¥4 ** ** .05 '
},
'tax_gov_name': {
'chinese_key': '主管税务机关',
'words': '兴业县国家税务局石南税务分局 '
},
'tax_gov_no': {
'chinese_key': '主管税务机关代码',
'words': '145092401'
},
}
错误码
错误码 |
错误信息 |
HTTP code |
0 |
识别正常 |
200 |
10002 |
表示对输入的图片解码错误 |
400 |
10003 |
表示遇到了其他错误,无法正确返回结果 |
400 |
10004 |
表示服务器正忙 |
500 |
10005 |
输入参数错误 |
500 |