> ## 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.1.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: 租户名称。该路径参数必须显式提供。
      schema:
        type: string
      example: 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: 请求体、路径参数或字段类型校验失败。
      headers:
        X-Process-Time:
          $ref: '#/components/headers/ProcessTime'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
          example:
            detail:
              - type: missing
                loc:
                  - body
                  - fpNumber
                msg: Field required
                input:
                  fpDate: '2026-08-25'
                  fpAmount: '100.00'
  schemas:
    DocumentExtractResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleResponse'
        - type: object
          properties:
            data:
              type: object
              additionalProperties: true
              properties:
                task_id:
                  type: string
                file_url:
                  type: string
                message:
                  type: string
                  description: 任务状态或处理结果说明。
                status:
                  type: integer
                  enum:
                    - 0
                    - 1
                    - 2
                    - 4
                    - 5
                    - 6
                  description: 0=未知，1=就绪，2=运行中，4=成功，5=失败，6=取消或拒绝。
                doc_recognize_result:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                extraction_result:
                  type: array
                  items:
                    $ref: '#/components/schemas/ExtractionResult'
                extract_config_version:
                  type: string
                  description: 本次抽取使用的配置版本。
                metadata:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: 文档处理任务元数据。
                aigc:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: AI 生成内容合规标识。
                classify_result:
                  type: object
                  additionalProperties: true
    HTTPValidationError:
      type: object
      additionalProperties: true
      required:
        - detail
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
    SimpleResponse:
      type: object
      additionalProperties: true
      required:
        - code
        - message
        - tips
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: |
            接口处理代码。正常进入验真业务流程时为 `success`；
            `success` 不等同于发票验真成功。
        message:
          type: string
          description: 接口级消息。
        tips:
          type:
            - string
            - 'null'
          description: 可选提示信息。
    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'
    ValidationErrorItem:
      type: object
      additionalProperties: true
      required:
        - type
        - loc
        - msg
      properties:
        type:
          type: string
          description: 校验错误类型。
        loc:
          type: array
          description: 错误字段位置。
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
          description: 错误信息。
        input:
          description: 导致校验错误的输入值。
        ctx:
          type: object
          additionalProperties: true
          description: 可选校验上下文。
    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: 发票验真字段的置信度。
  headers:
    ProcessTime:
      description: 服务端处理耗时，单位为秒。
      schema:
        type: string
      example: '0.248'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: ADP OpenAPI 密钥。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.