> ## 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.

# Query domestic bill extraction task

> Query the status and result of a domestic bill extraction task by task_id.



## OpenAPI

````yaml en/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: Domestic general bills
  version: 1.1.0
  description: ADP preset application API for extracting domestic general bills.
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://adp-global.laiye.com
    description: ADP global production endpoint
security: []
tags:
  - name: Domestic bill extraction
    description: Extract fields from domestic general bills.
  - name: Domestic invoice verification
    description: Verify domestic invoices from invoice details.
paths:
  /open/agentic_doc_processor/{tenant_name}/v1/app/doc/extract/query/task/{task_id}:
    get:
      tags:
        - Domestic bill extraction
      summary: Query domestic bill extraction task
      description: >-
        Query the status and result of a domestic bill extraction task by
        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: Tenant name. This path parameter must be provided explicitly.
      schema:
        type: string
      example: laiye
    TaskId:
      name: task_id
      in: path
      required: true
      description: Task ID.
      schema:
        type: string
  responses:
    DocumentExtractResponse:
      description: Extraction result.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocumentExtractResponse'
          examples:
            invoiceVerification:
              summary: Extraction result containing invoice verification fields
              value:
                code: success
                message: ''
                tips: null
                data:
                  task_id: ''
                  file_url: ''
                  status: 4
                  extraction_result:
                    - field_key: vat_electronic_special_invoice_new
                      field_name: Electronic VAT Special Invoice
                      object_values:
                        - document_type: vat_electronic_special_invoice_new
                          pages:
                            - 0
                          extraction_result:
                            - field_key: fpVerification
                              field_name: Verification result
                              field_values:
                                - field_value: ''
                                  confidence: 0
                            - field_key: fpVerificationMsg
                              field_name: Verification error message
                              field_values:
                                - field_value: ''
                                  confidence: 0
                            - field_key: fpIsVoided
                              field_name: Voided flag
                              field_values:
                                - field_value: ''
                                  confidence: 0
    ValidationError:
      description: The request body, path parameter, or field type failed validation.
      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: Task status or processing result message.
                status:
                  type: integer
                  enum:
                    - 0
                    - 1
                    - 2
                    - 4
                    - 5
                    - 6
                  description: >-
                    0=unknown, 1=ready, 2=running, 4=succeeded, 5=failed,
                    6=cancelled or rejected.
                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: Extraction configuration version used for this request.
                metadata:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Document processing task metadata.
                aigc:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: AI-generated content compliance label.
                classify_result:
                  type: object
                  additionalProperties: true
    HTTPValidationError:
      type: object
      additionalProperties: true
      required:
        - detail
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      description: Request validation error response.
    SimpleResponse:
      type: object
      additionalProperties: true
      required:
        - code
        - message
        - tips
      properties:
        code:
          oneOf:
            - type: string
            - type: integer
          description: >-
            API processing code. It is `success` after entering the verification
            flow; `success` does not mean that the invoice passed verification.
        message:
          type: string
          description: API-level message.
        tips:
          type:
            - string
            - 'null'
          description: Optional information.
      description: API response envelope.
    ExtractionResult:
      type: object
      additionalProperties: true
      properties:
        field_key:
          type: string
          description: Unique identifier of the document type.
        field_name:
          type: string
          description: Name of the document type.
        object_values:
          type: array
          description: Extraction results for each recognized document.
          items:
            $ref: '#/components/schemas/DocumentObjectValue'
    ValidationErrorItem:
      type: object
      additionalProperties: true
      required:
        - type
        - loc
        - msg
      properties:
        type:
          type: string
          description: Validation error type.
        loc:
          type: array
          description: Location of the invalid field.
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
          description: Validation error message.
        input:
          description: Input value that caused the validation error.
        ctx:
          type: object
          additionalProperties: true
          description: Optional validation context.
      description: One request validation error.
    DocumentObjectValue:
      type: object
      additionalProperties: true
      properties:
        document_type:
          type: string
          description: Identifier of the recognized document type.
        pages:
          type: array
          items:
            type: integer
          description: Zero-based page indexes containing the document.
        extraction_result:
          type: array
          description: >-
            Extracted fields. Verifiable invoices can also include
            fpVerification (verification result), fpVerificationMsg
            (verification error message), and fpIsVoided (voided flag).
          items:
            $ref: '#/components/schemas/ExtractedField'
    ExtractedField:
      type: object
      additionalProperties: true
      properties:
        field_key:
          type: string
          description: >-
            Unique field identifier. Invoice verification uses fpVerification,
            fpVerificationMsg, and fpIsVoided.
        field_name:
          type: string
          description: Display name of the field.
        field_values:
          type: array
          description: List of values for the field.
          items:
            $ref: '#/components/schemas/ExtractedFieldValue'
    ExtractedFieldValue:
      type: object
      additionalProperties: true
      properties:
        field_value:
          type: string
          description: Field value.
        field_confidence:
          type: number
          format: float
          description: Confidence score of the extracted field.
        confidence:
          type: number
          format: float
          description: Confidence score of an invoice verification field.
  headers:
    ProcessTime:
      description: Server processing time in seconds.
      schema:
        type: string
      example: '0.248'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: ADP API Key.

````

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