文档中心

- 大模型加速器
- 通用文档解析
- 通用文本向量
- 智能文档抽取
- 通用识别
- 通用文字识别
- 通用表格识别
- 手写签名识别
- 印章检测识别
- 二维码识别
- 图像智能处理
- 票据识别
- AI篡改检测
- 卡证识别
- 合同比对
- 合同抽取
- 财务相关API
查看文档
示例代码
API调试
功能描述
增值税发票
请求URL
https://api.textin.com/robot/v1.0/api/vat_invoice
HTTP请求方法
HTTP POST
请求头说明(Request Header)
请在HTTP请求中添加以下自定义Header。
header 名 | 值 |
---|---|
x-ti-app-id | 请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-app-id |
x-ti-secret-code | 请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-secret-code |
请求体说明(Request Body)
支持以下两种请求格式
1. Content-Type: application/octet-stream
要上传的图片,目前支持jpg, png, bmp, pdf(pdf只支持识别第一页), tiff, 单帧gif等大部分格式.
请注意,请求体的数据格式为本地文件的二进制流,非 FormData 或其他格式。文件大小不超过 10M,图像宽高须介于 20 和 10000(像素)之间。
2. Content-Type: text/plain
请求体的数据格式为文本,内容为在线文件的URL链接(支持http以及https协议)。在线文件大小不超过 10M,图像宽高须介于 20 和 10000(像素)之间。
响应体说明 (Response Data)
Content-Type: application/json
JSON结构说明如下:
字段名 | 类型 | 描述 |
---|---|---|
code | integer | 错误码,详见“错误码说明” |
message | string |
错误信息 |
result | object | |
+type | string |
票据类型, 当为other的时候,代表无法识别的图片
|
+type_description | string |
证件类型type中文描述 |
+image_angle | integer |
图片角度,指原图需要经过顺时针旋转多少度,才能得到正方向的图片 |
+rotated_image_width | integer |
正方向时图片的宽 |
+rotated_image_height | integer |
正方向时图片高 |
+kind | string |
票据用途
|
+kind_description | string |
票据用途中文描述 |
+item_list | array | |
++key | string |
识别的字段 |
++value | string |
识别的字段的值 |
++description | string |
识别的字段中文描述 |
++position | array |
识别的value在原图中的坐标, 是个长度为8的数组 [0,1,2,3,4,5,6,7]
|
item_list 中识别字段的说明
字段名 | 描述 |
---|---|
type | 类型 |
exist_manufacture_supervising_seal | 监制章存在性判断 |
exist_invoice_seal | 发票专用章存在性判断 |
digital_elec_invoice_number | 数电票号码 |
vat_invoice_cipher_field | 密码区 |
vat_invoice_correct_code | 校验码 |
vat_invoice_corrent_code_print | 打印校验码 |
vat_invoice_dai_kai_flag | 代开(非代开条目为空) |
vat_invoice_daima | 发票代码 |
vat_invoice_daima_print | 打印发票代码 |
vat_invoice_daima_right_side | 右侧打印发票代码 |
vat_invoice_drawer | 开票人 |
vat_invoice_elec_payment_id | 电子支付标识 |
vat_invoice_electrans_quantity | 数量明细 |
vat_invoice_electrans_unit | 单位明细 |
vat_invoice_electrans_unit_price | 单价明细 |
vat_invoice_goods_list | 货物或服务名称 |
vat_invoice_haoma | 发票号码 |
vat_invoice_haoma_large_size | 增值税发票No号码 |
vat_invoice_haoma_right_side | 右侧打印发票号码 |
vat_invoice_headline_page_number | 标题发票联 |
vat_invoice_issue_date | 开票日期 |
vat_invoice_issue_date_print | 右侧打印开票日期 |
vat_invoice_machine_no | 机器编号 |
vat_invoice_note_correct_code | 备注校验码 |
vat_invoice_page_number | 抵扣联/发票联 |
vat_invoice_payee | 收款人 |
vat_invoice_payer_addr_tell | 购买方地址、电话 |
vat_invoice_payer_bank_account | 购买方开户行及账号 |
vat_invoice_payer_name | 购买方名称 |
vat_invoice_plate_specific | 规格型号 |
vat_invoice_price_list | 金额明细 |
vat_invoice_qr_code | qr码 |
vat_invoice_rate_payer_id | 购买方纳税人识别号 |
vat_invoice_review | 复核 |
vat_invoice_seller_addr_tell | 销售方地址、电话 |
vat_invoice_seller_bank_account | 销售方开户行及账号 |
vat_invoice_seller_id | 销售方纳税人识别号 |
vat_invoice_seller_name | 销售方名称 |
vat_invoice_tax_list | 税额明细 |
vat_invoice_tax_rate | 税率 |
vat_invoice_tax_rate_list | 税率明细 |
vat_invoice_tax_total | 税额合计 |
vat_invoice_total | 合计 |
vat_invoice_total_cover_tax | 价税合计大写 |
vat_invoice_total_cover_tax_digits | 价税合计小写 |
vat_invoice_total_note | 备注 |
vat_invoice_total_print | 打印合计 |
vat_invoice_type | 发票类型 |
vat_invoice_zhuan_yong_flag | 专票/普票 |
exist_stample | 盖章存在性判断 |
vat_invoice_quandianfapiao_flag | 判断是否全电票 |
JSON结构示例
错误码说明
错误码 | 描述 |
---|---|
40101 | x-ti-app-id 或 x-ti-secret-code 为空 |
40102 | x-ti-app-id 或 x-ti-secret-code 无效,验证失败 |
40103 | 客户端IP不在白名单 |
40003 | 余额不足,请充值后再使用 |
40004 | 参数错误,请查看技术文档,检查传参 |
40007 | 机器人不存在或未发布 |
40008 | 机器人未开通,请至市场开通后重试 |
40301 | 图片类型不支持 |
40302 | 上传文件大小不符,文件大小不超过 10M |
40303 | 文件类型不支持 |
40304 | 图片尺寸不符,图像宽高须介于 20 和 10000(像素)之间 |
40305 | 识别文件未上传 |
40400 | 无效的请求链接,请检查链接是否正确 |
30203 | 基础服务故障,请稍后重试 |
500 | 服务器内部错误 |