POST
/
cci_ai
/
service
/
v1
/
receipt_crop_and_recog_multi
国内通用票据v2接口识别
curl --request POST \
  --url https://api.textin.com/cci_ai/service/v1/receipt_crop_and_recog_multi \
  --header 'Content-Type: application/octet-stream' \
  --header 'x-ti-app-id: <api-key>' \
  --header 'x-ti-secret-code: <api-key>'
{
  "code": 200,
  "message": "success",
  "pageNum": 1,
  "pages": [
    {
      "result": {
        "object_list": [
          {
            "type": "other",
            "type_description": "增值税普通发票",
            "image_angle": 0,
            "rotated_image_width": 1000,
            "rotated_image_height": 3000,
            "kind": "other",
            "kind_description": "交通",
            "position": [
              100,
              100,
              200,
              100,
              200,
              200,
              100,
              200
            ],
            "item_list": [
              {
                "key": "title",
                "value": "True",
                "position": [
                  100,
                  100,
                  200,
                  100,
                  200,
                  200,
                  100,
                  200
                ],
                "description": "标题"
              }
            ],
            "stamp_list": [
              [
                {}
              ]
            ],
            "qr_code_list": [
              [
                {}
              ]
            ]
          }
        ]
      },
      "duration": 7700,
      "page_number": 0,
      "ppi": 0
    }
  ]
}

Authorizations

x-ti-app-id
string
header
required

登录Textin后前往 "工作台-账号设置-开发者信息" 查看 x-ti-app-id

x-ti-secret-code
string
header
required

登录Textin后前往 "工作台-账号设置-开发者信息" 查看 x-ti-secret-code

Query Parameters

coord_restore
enum<integer>
default:0

调整各字段的返回坐标逻辑,1代表坐标以原图为基准,0代表坐标以票据切图为基准,默认为0

Available options:
0,
1
specific_pages
string

指定多页样本中需要识别的样本,可以使用"1,3,2"形式来逐页选择,或"2-4"形式来连续选择,返回结果会重新排序以遵照源文件顺序,默认为空,识别所有页面

Example:

"3-5,1"

crop_complete_image
enum<integer>
default:0

选择是否需要输出各票据图片,1为输出各票据切片base64编码,0为不输出各票据图片,默认为0

Available options:
0,
1
crop_value_image
enum<integer>
default:0

选择是否返回关键字段切图图片,1为输出字段图片,0为不输出字段图片,默认为0

Available options:
0,
1
merge_digital_elec_invoice
enum<integer>
default:0

支持将多页全电票的结果合并为一页,1为合并,0为不合并,默认为0 当且仅当一份多页样本的每一页都是全电票,且每张发票的发票号码都一致时才可合并。

Available options:
0,
1
return_ppi
enum<integer>
default:0

返回pdf解码ppi

Available options:
0,
1

Body

application/octet-stream · file

要上传的图片,目前支持jpg, png, bmp, pdf, tiff, ofd, webp, 单帧gif等大部分格式.

The body is of type file.

Response

200 - application/json
code
enum<integer>
required

错误码

  • 200: OK
  • 40301: 没有 http body
  • 40600: 图片解码失败,请检查图片格式是否正确。
  • 40400: 识别失败
  • 90001: 其他错误, 详情见 message
Available options:
200,
40301,
40600,
40400,
90001
Example:

200

message
string
required

错误信息

Example:

"success"

pageNum
integer

总页数

Example:

1

pages
object[]

样本每页的识别结果