> ## Documentation Index
> Fetch the complete documentation index at: https://docs-claimagent.textin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 发票验真（税票）

> 增值税发票验真。直接调用底层验真 API，同步返回结果。

## 支持的发票类型

| 类型代码 | 发票类型              |
| ---- | ----------------- |
| 01   | 增值税专用发票           |
| 02   | 货运运输业增值税专用发票      |
| 03   | 机动车销售统一发票         |
| 04   | 增值税普通发票           |
| 10   | 增值税普通发票(电子)       |
| 11   | 增值税普通发票(卷式)       |
| 14   | 增值税普通发票(通行费)      |
| 15   | 二手车销售统一发票         |
| 20   | 增值税电子专用发票         |
| 31   | 电子发票(增值税专用发票)     |
| 32   | 电子发票(增值税普通发票)     |
| 51   | 电子发票(铁路电子客票)      |
| 61   | 电子发票(航空运输电子客票行程单) |
| 83   | 电子发票(机动车销售统一发票)   |
| 84   | 电子发票(二手车销售统一发票)   |
| 85   | 全电发票(纸质专用发票)      |
| 86   | 数电纸质发票(普通发票)      |
| 87   | 电子发票(通行费)         |

## 参数必填规则

### invoice\_code(发票代码)

全电发票(类型代码 31, 32, 51, 61, 83, 84, 87)时**非必填**，其他发票类型**必填**。

### invoice\_sum(金额)

发票类型代码为 01, 03, 15, 20, 31, 32, 51, 61, 83, 84, 85, 87 时**必填**，填写内容因类型而异：

| 适用类型代码                 | 填写内容  |
| ---------------------- | ----- |
| 01, 03, 20, 85         | 不含税金额 |
| 15, 84                 | 车价合计  |
| 31, 32, 51, 61, 83, 87 | 含税金额  |

### verify\_code(校验码)

发票类型代码为 04, 10, 11, 14, 86 时**必填**，取后六位。其中类型 86 填写密码区数电票号码后六位。

## 作废标志(invalid\_mark)

| 标志 | 含义   |
| -- | ---- |
| N  | 正常   |
| Y  | 已作废  |
| H  | 红冲   |
| 7  | 部分红冲 |
| 8  | 全额红冲 |

## 验证状态码与扣费说明

响应中 `data.result.code` 的含义如下：

| 错误码   | 说明                          | 是否扣费 |
| ----- | --------------------------- | ---- |
| 001   | 成功，验证为真                     | 是    |
| 002   | 此发票今日查询次数已达上限(5次)，请次日查询     | 否    |
| 005   | 请求不合法，请核对验真参数               | 否    |
| 006   | 发票信息不一致，请核对发票信息             | 是    |
| 009   | 查无此票，请核对发票信息                | 是    |
| 104   | 已超过最大查验量                    | 否    |
| 105   | 查询发票不规范，请核对发票信息             | 否    |
| 106   | 查验异常，国税局/发票查验地区升级维护，请稍后重试   | 否    |
| 107   | 鉴权失败                        | 否    |
| 108   | 参数不为空                       | 否    |
| 109   | 参数长度不正确                     | 否    |
| 110   | 参数 invoice\_code 的格式或取值范围错误 | 否    |
| 111   | 参数 invoice\_sum 的格式或取值范围错误  | 否    |
| 112   | 参数 verify\_code 的格式或取值范围错误  | 否    |
| 113   | 参数 invoice\_no 的格式或取值范围错误   | 否    |
| 114   | 校验码不正确，应为后六位                | 否    |
| 115   | 超过服务有效期限限制                  | 否    |
| 116   | 此发票今日查询次数已达上限(5次)，请次日查询     | 否    |
| 1005  | 请核对验真参数是否符合发票规范             | 是    |
| 1010  | 日期格式不正确(YYYYMMDD)           | 否    |
| 1011  | 请求参数不完整                     | 否    |
| 1021  | 查验异常，国税局/发票查验地区升级维护，请稍后重试   | 否    |
| 10014 | 日期当天不能查验                    | 否    |
| 10015 | 开票金额：不合法的格式                 | 否    |
| 10016 | 检验码：不能为空                    | 否    |
| 10017 | 超过五年的不能查验                   | 否    |
| 10018 | 检验码：不合法的长度                  | 否    |
| 10020 | 没有查验权限                      | 否    |


## OpenAPI

````yaml POST /doc-agent/api/v1/capability/vat-invoice/verify
openapi: 3.0.3
info:
  description: |-
    CapabilityService 独立子能力服务
     提供文件上传、图像质检、材料分类、材料抽取等独立能力，不依赖案件流程。
     通过 batch_id 和 material_id 串联各能力调用。

     ## 典型调用流程
     1. 上传文件 → UploadFiles，获得 batch_id 和 material_id 列表
     2. (可选)图像质检 → CheckImageQuality，可独立调用，也可用上传返回的 material_id
     3. (可选)材料分类 → ClassifyMaterial，可独立调用，也可用上传返回的 material_id
     4. 材料抽取 → ExtractMaterial，传入 material_id 列表，返回每个材料的状态和结果
     5. 轮询 → 重复调用 ExtractMaterial 直到所有材料完成，或等待 callback_url 回调
     注: 质检和分类可独立调用，不依赖抽取流程；抽取接口的 material_ids 必须来自上传接口。
     注: ExtractMaterial 幂等，已完成的材料不会重新抽取，失败的材料会自动重试。

     ## 错误响应
     所有接口错误均返回 HTTP 非 200 状态码，body 格式: {"code": 400, "msg": "错误描述"}
     常见错误码:
       400 — 参数校验失败(缺少必填字段、文件数超限等)
       403 — 认证失败(x-ti-app-id 或 x-ti-secret-code 缺失/无效)
       404 — 资源不存在(material_id / batch_id 无效)
       500 — 内部处理异常

     错误响应示例:
       {"code": 404, "msg": "material not found"}
       {"code": 404, "msg": "batch not found"}
       {"code": 400, "msg": "material_ids or batch_id is required"}
       {"code": 400, "msg": "material does not belong to the specified batch"}
       {"code": 400, "msg": "files or file_urls is required"}
       {"code": 400, "msg": "所有材料必须属于同一批次"}
       {"code": 403, "msg": "x-api-key 或 x-ti-app-id/x-ti-secret-code 不能为空"}
  title: CapabilityService API
  version: 0.0.1
servers:
  - url: https://agents.textin.com/
security: []
tags:
  - name: CapabilityService
paths:
  /doc-agent/api/v1/capability/vat-invoice/verify:
    post:
      tags:
        - CapabilityService
      description: 增值税发票验真。直接调用底层验真 API，同步返回结果。
      operationId: CapabilityService_VerifyVatInvoice
      parameters:
        - in: header
          name: x-ti-app-id
          required: true
          schema:
            type: string
        - in: header
          name: x-ti-secret-code
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            example:
              invoice_code: ''
              invoice_date: '20260202'
              invoice_no: '26330000009400012345'
              invoice_sum: '7282.03'
              verify_code: ''
            schema:
              $ref: '#/components/schemas/capability.v1.VerifyVatInvoiceRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                code: 200
                data:
                  result:
                    code: '001'
                    data:
                      all_tax: '436.92'
                      all_valorem_tax: '7718.95'
                      check_code: '26330000009400012345'
                      cyjgxx: 查验成功发票一致
                      detail_list:
                        - all_tax: '436.92'
                          detail_amount: '7282.03'
                          detail_no: '1'
                          goods_name: '*企业管理服务*市场管理'
                          row_no: '1'
                          tax_classify_code: '3040801990000000000'
                          tax_rate: '6'
                      inspection_amount: '5'
                      invalid_mark: 'N'
                      invoice_code: ''
                      invoice_date: '20260202'
                      invoice_money: '7282.03'
                      invoice_number: '26330000009400012345'
                      invoice_type: '31'
                      machine_code: ''
                      note: 购方开户银行：招商银行股份有限公司某某支行 银行账号：120919530XXXXXX
                      purchaser_bank_and_number: 购方开户银行：招商银行股份有限公司某某支行 银行账号：120919530XXXXXX
                      purchaser_name: 某某互联网科技有限公司
                      purchaser_taxpayer_number: 91440101MAXXXXXXX3
                      saler_address_or_phone: 浙江省杭州市滨江区某某路1750号某某中心2005室 138****8845
                      saler_bank_and_number: 销方开户银行：杭州银行股份有限公司滨江支行 银行账号：330104106000XXXXXXX
                      saler_name: 某某贸易有限公司
                      saler_taxpayer_number: 91330108MAXXXXXXX7
                      seller_unit_or_individual: 某某贸易有限公司
                    invalid_mark: 'N'
                    invoice_code: ''
                    invoice_date: '20260202'
                    invoice_number: '26330000009400012345'
                    invoice_type: '31'
                    message: 成功
                    purchaser_taxpayer_number: 91440101MAXXXXXXX3
                message: OK
              schema:
                properties:
                  code:
                    description: 业务状态码
                    example: 200
                    type: integer
                  data:
                    $ref: >-
                      #/components/schemas/capability.v1.VerifyVatInvoiceResponse
                  message:
                    description: 状态说明
                    example: OK
                    type: string
                type: object
          description: OK
components:
  schemas:
    capability.v1.VerifyVatInvoiceRequest:
      properties:
        invoice_code:
          description: 发票代码，全电发票（发票类型代码为 31, 32, 51, 61, 83, 84, 87）时非必填，其他发票类型必填
          type: string
        invoice_date:
          description: '开票日期（必填，格式: yyyyMMdd，如 "20190203"）'
          type: string
        invoice_no:
          description: 发票号码（必填）
          type: string
        invoice_sum:
          description: |-
            金额，非必填。发票类型代码为 01, 03, 15, 20, 31, 32, 51, 61, 85, 83, 84, 87 时必填:
               - 为 01, 03, 20, 85 时填写发票不含税金额
               - 为 15, 84 时填写发票车价合计
               - 为 31, 32, 51, 61, 83, 87 时填写含税金额
               - 其它可为空
          type: string
        verify_code:
          description: |-
            机器验证码，非必填，取后六位。发票类型代码为 04, 10, 11, 14, 86 时必填（填写密码区数电票号码后六位），
             发票类型代码为 86 时填写密码区数电票号码后六位，其他发票种类可为空
          type: string
      type: object
    capability.v1.VerifyVatInvoiceResponse:
      properties:
        result:
          allOf:
            - $ref: '#/components/schemas/common.VatInvoiceVerifyResult'
          description: 增值税发票验真结果
      type: object
    common.VatInvoiceVerifyResult:
      description: 增值税发票验真结果
      properties:
        code:
          description: 验真返回码(001=成功)
          type: string
        data:
          allOf:
            - $ref: '#/components/schemas/common.VatInvoiceData'
          description: 发票详细信息
        invalid_mark:
          description: 作废标志(N=正常, Y=作废, H=红冲, 7=部分红冲, 8=全额红冲)
          type: string
        invoice_code:
          description: 发票代码
          type: string
        invoice_date:
          description: 开票日期
          type: string
        invoice_number:
          description: 发票号码
          type: string
        invoice_type:
          description: 发票类型代码
          type: string
        message:
          description: 返回信息
          type: string
        purchaser_taxpayer_number:
          description: 购方税号
          type: string
      type: object
    common.VatInvoiceData:
      description: 增值税发票详细数据
      properties:
        after_tax_code:
          description: 完税凭证号码
          type: string
        all_tax:
          description: 税额
          type: string
        all_valorem_tax:
          description: 价税合计
          type: string
        blue_invoice_code:
          description: 蓝字发票代码(红冲时)
          type: string
        blue_invoice_no:
          description: 蓝字发票号码(红冲时)
          type: string
        brand_version:
          description: 厂牌型号
          type: string
        business_unit:
          description: 经营/拍卖单位
          type: string
        business_unit_tax_no:
          description: 经营/拍卖单位纳税人识别号
          type: string
        busmess_unit_address:
          description: 经营/拍卖单位地址
          type: string
        busmess_unit_bank_and_account:
          description: 经营/拍卖单位开户行及账号
          type: string
        busmess_unit_phone:
          description: 经营/拍卖单位电话
          type: string
        car_price:
          description: 车价合计
          type: string
        car_type:
          description: 车辆类型
          type: string
        car_type_and_number:
          description: 车种车号
          type: string
        carframe_code:
          description: 车辆识别代号/车架号
          type: string
        carrier_name:
          description: |-
            ===== 货物运输发票专用 =====
             承运人名称
          type: string
        carrier_tax_no:
          description: 承运人识别号
          type: string
        check_code:
          description: 校验码
          type: string
        consignor_name:
          description: 发货人名称
          type: string
        consignor_tax_no:
          description: 发货人识别号
          type: string
        cyjgxx:
          description: 查验结果描述
          type: string
        detail_list:
          description: '===== 明细列表 ====='
          items:
            $ref: '#/components/schemas/common.VatInvoiceDetailItem'
          type: array
        drawee_name:
          description: 受票方名称
          type: string
        drawee_tax_no:
          description: 受票方识别号
          type: string
        elec_ticket_num:
          description: 电子客票号码
          type: string
        engine_code:
          description: 发动机号
          type: string
        id_card:
          description: |-
            ===== 机动车销售发票专用 =====
             身份证号/组织机构代码
          type: string
        import_license:
          description: 进口证明书号
          type: string
        inspection_amount:
          description: 查验次数
          type: string
        inspection_number:
          description: 商检单号
          type: string
        invalid_mark:
          description: 作废标志
          type: string
        invoice_code:
          description: 发票代码
          type: string
        invoice_date:
          description: 开票日期(YYYYMMDD)
          type: string
        invoice_money:
          description: 不含税金额
          type: string
        invoice_number:
          description: 发票号码
          type: string
        invoice_type:
          description: |-
            ===== 基本信息 =====
             发票类型代码
          type: string
        lemon_market:
          description: 二手车市场
          type: string
        lemon_market_address:
          description: 二手车市场地址
          type: string
        lemon_market_bank_and_account:
          description: 二手车市场开户行及账号
          type: string
        lemon_market_phone:
          description: 二手车市场电话
          type: string
        lemon_market_tax_no:
          description: 二手车市场纳税人识别号
          type: string
        license_code:
          description: 合格证号
          type: string
        license_plate:
          description: |-
            ===== 二手车发票专用 =====
             车牌照号
          type: string
        limit_amount:
          description: 限乘人数
          type: string
        machine_code:
          description: 机器编号
          type: string
        note:
          description: |-
            ===== 其他基本字段 =====
             备注
          type: string
        producing_area:
          description: 产地
          type: string
        purchaser_address_or_phone:
          description: 购方地址电话
          type: string
        purchaser_bank_and_number:
          description: 购方开户行及账号
          type: string
        purchaser_name:
          description: |-
            ===== 购方信息 =====
             购方名称
          type: string
        purchaser_phone:
          description: 买方电话
          type: string
        purchaser_taxpayer_number:
          description: 购方纳税人识别号
          type: string
        purchaser_unit_or_individual:
          description: 买方单位/个人
          type: string
        purchaser_unit_or_individual_address:
          description: 买方单位/个人住址
          type: string
        purchaser_unitcode_or_id_no:
          description: 买方单位代码/身份证号
          type: string
        receive_name:
          description: 收货人名称
          type: string
        receive_tax_no:
          description: 收货人识别号
          type: string
        registration_no:
          description: 登记证号
          type: string
        saler_address:
          description: 销方地址
          type: string
        saler_address_or_phone:
          description: 销方地址电话
          type: string
        saler_bank_account:
          description: 销方银行账号
          type: string
        saler_bank_and_number:
          description: 销方开户行及账号
          type: string
        saler_bank_name:
          description: 销方银行名称
          type: string
        saler_name:
          description: |-
            ===== 销方信息 =====
             销方名称
          type: string
        saler_phone:
          description: 销方电话
          type: string
        saler_taxpayer_number:
          description: 销方纳税人识别号
          type: string
        seller_phone:
          description: 卖方电话
          type: string
        seller_unit_code_or_idno:
          description: 卖方单位代码/身份证号
          type: string
        seller_unit_or_individual:
          description: 卖方单位/个人
          type: string
        seller_unit_or_individual_address:
          description: 卖方单位/个人住址
          type: string
        tax_disk_number:
          description: 税控盘号
          type: string
        tax_rate:
          description: 税率
          type: string
        tax_unit_code:
          description: 主管税务机关代码
          type: string
        tax_unit_name:
          description: 主管税务机关名称
          type: string
        through_address:
          description: 起运地、经由、到达地
          type: string
        traffic_fee_flag:
          description: |-
            ===== 通行费专用 =====
             通行费标志(Y/N)
          type: string
        transferred_vehicle_office:
          description: 转入地车辆管理所名称
          type: string
        transport_goods_info:
          description: 运输货物信息
          type: string
        unit:
          description: 吨位
          type: string
        vehicle_tonnage:
          description: 车辆吨位
          type: string
        zero_tax_rate_flag:
          description: 零税率标识
          type: string
      type: object
    common.VatInvoiceDetailItem:
      description: 增值税发票明细行
      properties:
        all_tax:
          description: 税额
          type: string
        board_date:
          description: 乘车日期
          type: string
        business_type:
          description: |-
            ===== 其他 =====
             业务类型(0=销售, 1=退货)
          type: string
        carriage:
          description: 车厢
          type: string
        carrier:
          description: 承运人
          type: string
        carrier_date:
          description: |-
            ===== 航空电子客票专用 =====
             承运日期
          type: string
        detail_amount:
          description: 金额
          type: string
        detail_no:
          description: 明细序号
          type: string
        document_num:
          description: |-
            ===== 铁路电子客票专用 =====
             单据号
          type: string
        end_station:
          description: 到达站
          type: string
        expense_item:
          description: |-
            ===== 货物运输专用 =====
             费用项目
          type: string
        flight_number:
          description: 航班号
          type: string
        flight_time:
          description: 起飞时间
          type: string
        goods_name:
          description: 货物或应税劳务名称
          type: string
        kttz:
          description: 空调特征
          type: string
        leg:
          description: 航段
          type: string
        name:
          description: 乘车人姓名
          type: string
        net_value:
          description: 不含税单价
          type: string
        num:
          description: 数量
          type: string
        plate_no:
          description: 车牌号
          type: string
        row_no:
          description: |-
            ===== 通用字段 =====
             行号
          type: string
        seat_level:
          description: 座位等级
          type: string
        standard:
          description: 规格型号
          type: string
        start_station:
          description: 出发站
          type: string
        start_time:
          description: 开车时间
          type: string
        tax_classify_code:
          description: 税收分类编码
          type: string
        tax_detail_amount:
          description: 含税金额
          type: string
        tax_rate:
          description: 税率
          type: string
        tax_unit_price:
          description: 含税单价
          type: string
        ticked_level:
          description: 客票级别
          type: string
        traffic_date_end:
          description: 通行日期止
          type: string
        traffic_date_start:
          description: 通行日期起
          type: string
        train_num:
          description: 车次
          type: string
        type:
          description: |-
            ===== 通行费专用 =====
             类型
          type: string
        unit:
          description: 单位
          type: string
        xb:
          description: 席别
          type: string
        xw:
          description: 席位
          type: string
      type: object

````