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

# 查询国内通用票据抽取任务结果

> 根据 task_id 查询国内通用票据抽取任务状态和结果。



## OpenAPI

````yaml /api-reference/preset-domestic-bills.yaml get /open/agentic_doc_processor/{tenant_name}/v1/app/doc/extract/query/task/{task_id}
openapi: 3.1.0
info:
  title: 国内通用票据
  version: 1.0.0
  description: ADP 预置应用接口，适用于国内通用票据抽取场景。
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp.laiye.com
    description: ADP 生产环境
security: []
tags:
  - name: 国内通用票据抽取
    description: 抽取国内通用票据字段。
  - name: 国内发票验真
    description: 根据发票要素查验国内发票。
paths:
  /open/agentic_doc_processor/{tenant_name}/v1/app/doc/extract/query/task/{task_id}:
    get:
      tags:
        - 国内通用票据抽取
      summary: 查询国内通用票据抽取任务结果
      description: 根据 task_id 查询国内通用票据抽取任务状态和结果。
      operationId: queryDomesticBillExtractTask
      parameters:
        - $ref: '#/components/parameters/TenantName'
        - $ref: '#/components/parameters/TaskId'
      responses:
        '200':
          $ref: '#/components/responses/DocumentExtractResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    TenantName:
      name: tenant_name
      in: path
      required: true
      description: 租户名称，默认 laiye。
      schema:
        type: string
        default: laiye
    TaskId:
      name: task_id
      in: path
      required: true
      description: 任务 ID。
      schema:
        type: string
  responses:
    DocumentExtractResponse:
      description: 抽取结果。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocumentExtractResponse'
          examples:
            invoiceVerification:
              summary: 包含发票验真字段的抽取结果
              value:
                code: success
                message: ''
                tips: null
                data:
                  task_id: ''
                  file_url: ''
                  status: 4
                  extraction_result:
                    - field_key: vat_electronic_special_invoice_new
                      field_name: 电子发票增值税专用发票
                      object_values:
                        - document_type: vat_electronic_special_invoice_new
                          pages:
                            - 0
                          extraction_result:
                            - field_key: fpVerification
                              field_name: 查验结果
                              field_values:
                                - field_value: ''
                                  confidence: 0
                            - field_key: fpVerificationMsg
                              field_name: 查验报错信息
                              field_values:
                                - field_value: ''
                                  confidence: 0
                            - field_key: fpIsVoided
                              field_name: 作废标志
                              field_values:
                                - field_value: ''
                                  confidence: 0
    ValidationError:
      description: 参数校验错误。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleResponse'
  schemas:
    DocumentExtractResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              type: object
              additionalProperties: true
              properties:
                task_id:
                  type: string
                file_url:
                  type: string
                status:
                  type: integer
                doc_recognize_result:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                extraction_result:
                  type: array
                  items:
                    $ref: '#/components/schemas/ExtractionResult'
                classify_result:
                  type: object
                  additionalProperties: true
    SimpleResponse:
      type: object
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
        message:
          type: string
        tips:
          type:
            - string
            - 'null'
    ExtractionResult:
      type: object
      additionalProperties: true
      properties:
        field_key:
          type: string
          description: 文档类型的唯一标识。
        field_name:
          type: string
          description: 文档类型名称。
        object_values:
          type: array
          description: 各识别文档的抽取结果。
          items:
            $ref: '#/components/schemas/DocumentObjectValue'
    DocumentObjectValue:
      type: object
      additionalProperties: true
      properties:
        document_type:
          type: string
          description: 识别出的文档类型标识。
        pages:
          type: array
          items:
            type: integer
          description: 文档所在的页码，从 0 开始计数。
        extraction_result:
          type: array
          description: >-
            抽取字段。可验真的发票还可能包含 fpVerification（查验结果）、fpVerificationMsg（查验报错信息）和
            fpIsVoided（作废标志）。
          items:
            $ref: '#/components/schemas/ExtractedField'
    ExtractedField:
      type: object
      additionalProperties: true
      properties:
        field_key:
          type: string
          description: 字段唯一标识；发票验真字段分别为 fpVerification、fpVerificationMsg 和 fpIsVoided。
        field_name:
          type: string
          description: 字段显示名称。
        field_values:
          type: array
          description: 字段值列表。
          items:
            $ref: '#/components/schemas/ExtractedFieldValue'
    ExtractedFieldValue:
      type: object
      additionalProperties: true
      properties:
        field_value:
          type: string
          description: 字段值。
        field_confidence:
          type: number
          format: float
          description: 字段抽取置信度。
        confidence:
          type: number
          format: float
          description: 发票验真字段的置信度。
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````