文档中心
API调试

功能描述

税收完税证明

请求URL

https://api.textin.com/ai/service/v1/tax_payment_certificate

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)

Content-Type: application/octet-stream

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

请注意,请求体的数据格式为文件的二进制流,非 FormData 或其他格式。文件大小不超过 10M,图像宽高须介于 20 和 10000(像素)之间。

响应体说明(Response Data)

Content-Type: application/json

JSON结构说明如下:

字段名 类型 描述
code integer 错误码,详见“错误码说明”
message string

错误信息

result object
+ type string

识别结果类型/分类

+ rotated_image_width integer

正方向时图片的宽

+ rotated_image_height integer

正方向时图片高

+ image_angle integer

图片顺时针旋转角度

+ item_list array
   ++ key string

完税证明结构化识别的字段

  • certificate_number 完税证明号
  • tax_authority 税务机关
  • issue_date 填发日期
  • tax_payer_id 纳税人识别号
  • tax_payer_name 纳税人名称
  • amounts_capital 金额合计(大写)
  • amounts_lowercase 金额合计(小写)
  • seal 印章
  • filler_name 填票人
  • remark 备注
   ++ value string

完税证明识别字段对应的值

   ++ position array

识别的字段在旋转后图中的坐标, 是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
   ++ description string

结构化识别字段的中文描述

+ table_list array
   ++ key string

列表字段

  • source_document_number 原凭证号
  • tax_type 税种
  • tax_item_name 品目名称
  • tax_period 税款所属时期
  • payment_date 入(退)库日期
  • payment_amounts 实缴(退)金额
   ++ value string

列表字段对应的值

   ++ position array

识别的字段在旋转后图中的坐标, 是个长度为8的数组 [0,1,2,3,4,5,6,7]

  • (0, 1) 左上角坐标
  • (2, 3) 右上角坐标
  • (4, 5) 右下角坐标
  • (6, 7) 左下角坐标
   ++ description string

列表字段的中文描述

item_list 中识别字段的说明

字段名 描述
certificate_number 完税证明号
tax_authority 税务机关
issue_date 填发日期
tax_payer_id 纳税人识别号
tax_payer_name 纳税人名称
amounts_capital 金额合计(大写)
amounts_lowercase 金额合计(小写)
seal 印章
filler_name 填票人
remark 备注

JSON结构示例

{
  "code": 200,
  "message": "success",
  "result": {
    "image_angle": 270,
    "rotated_image_width": 1184,
    "rotated_image_height": 817,
    "type": "tax_payment_certificate",
    "item_list": [
      {
        "key": "certificate_number",
        "value": "20931885190238",
        "position": [
          242,
          407,
          435,
          410,
          435,
          423,
          242,
          421
        ],
        "description": "完税证明号"
      }
    ],
    "table_list": [
      [
        {
          "key": "tax_type",
          "value": "车船税",
          "position": [
            242,
            407,
            435,
            410,
            435,
            423,
            242,
            421
          ],
          "description": "税种"
        }
      ]
    ]
  }
}

错误码说明

错误码 描述
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 识别文件未上传
30203 基础服务故障,请稍后重试
500 服务器内部错误
官方社群
体验中心

联系我们