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

# Philippines Document Details Extraction

> Extract structured fields from a supported Philippine ID document without creating a Trust Validation.

This endpoint classifies across 13 Philippine document types. `data.fields.documentType` names the card that was found; it is returned bare (no confidence wrapper) because it is a classification, not transcribed text. Card-specific fields are promoted to the top level of `data.fields`, so the field set returned depends on which document type was detected.

## Recognised document types

| `documentType`     | Document                |
| ------------------ | ----------------------- |
| `alien_id`         | Alien ID                |
| `driving_license`  | Driver's License        |
| `health_insurance` | Health Insurance Card   |
| `nbi_clearance`    | NBI Clearance           |
| `passport`         | Paper Passport          |
| `philsys_id`       | Identity Card (PhilSys) |
| `postal_id`        | Postal ID               |
| `prc`              | Professional ID (PRC)   |
| `sss`              | Social Security Card    |
| `tax`              | Tax ID                  |
| `umid`             | Multipurpose ID (UMID)  |
| `voter_id`         | Voter ID                |
| `work_permit`      | Work Permit             |

The document names above match those used in the [supported documents](/resources/supported-documents) reference for the Philippines.

If the uploaded image is not one of these, the response returns `data.outcome: "rejected"` with `documentType: null` and `errorReason: "wrong_document_type"`.


## OpenAPI

````yaml stateless-verification-api/document-ocr/philippines-document-details-extraction.openapi.json POST /api/v3/verifications/philippines/document-details-extraction-passthrough
openapi: 3.0.3
info:
  title: Document OCR API - Philippines Document Details Extraction
  version: 1.0.0
servers:
  - url: https://{environment-subdomain}.idmetagroup.com
    description: Your environment (replace `{environment-subdomain}`)
    variables:
      environment-subdomain:
        default: integrate
        description: IDmeta environment subdomain
security:
  - bearerAuth: []
paths:
  /api/v3/verifications/philippines/document-details-extraction-passthrough:
    post:
      tags:
        - Document OCR
      summary: Philippines Document Details Extraction
      description: >-
        Extract structured fields from a supported Philippine ID document
        without creating a Trust Validation. Classifies across 13 document types
        — see the page description for the full list of `documentType` values.
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            example: Bearer {your_api_token}
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - documentImage
              properties:
                documentImage:
                  type: string
                  format: binary
                  description: >-
                    The Philippine ID document image. JPG, JPEG, PNG, or PDF, up
                    to 2 MB. A base64 string (raw or `data:` URI) is also
                    accepted.
                metadata:
                  type: object
                  additionalProperties: true
                  description: Optional key-value pairs echoed back in the response.
                  example:
                    clientReference: PH-KYC-4471
      responses:
        '200':
          description: >-
            The document was processed. `data.fields.documentType` names the
            card type that was classified (one of: `alien_id`,
            `driving_license`, `health_insurance`, `nbi_clearance`, `passport`,
            `philsys_id`, `postal_id`, `prc`, `sss`, `tax`, `umid`, `voter_id`,
            `work_permit`), or is `null` when the document was not recognised.
            Check `data.outcome` and `verificationStatus` to determine the
            result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      outcome:
                        type: string
                        enum:
                          - extracted
                          - partial
                          - rejected
                      fields:
                        type: object
                        properties:
                          documentType:
                            type: string
                            nullable: true
                            enum:
                              - alien_id
                              - driving_license
                              - health_insurance
                              - nbi_clearance
                              - passport
                              - philsys_id
                              - postal_id
                              - prc
                              - sss
                              - tax
                              - umid
                              - voter_id
                              - work_permit
                            description: >-
                              The classified Philippine document type. Returned
                              bare (no confidence wrapper) because it is a
                              classification, not transcribed text. `null` when
                              the document was not recognised.
                        additionalProperties: true
                additionalProperties: true
              examples:
                extractedDrivingLicense:
                  summary: extracted — VERIFIED (driving licence)
                  value:
                    success: true
                    message: >-
                      Philippines document details extraction processed
                      successfully
                    data:
                      outcome: extracted
                      fields:
                        documentType: driving_license
                        documentNumber:
                          value: N02-14-004567
                          confidence: 98.95%
                        fullName:
                          value: DELA CRUZ, JUAN MIGUEL
                          confidence: 98.20%
                        firstName:
                          value: JUAN
                          confidence: 98.60%
                        middleName:
                          value: MIGUEL
                          confidence: 97.85%
                        lastName:
                          value: DELA CRUZ
                          confidence: 98.44%
                        suffix: null
                        dateOfBirth:
                          value: '1991-03-08'
                          confidence: 98.70%
                        gender:
                          value: M
                          confidence: 99.25%
                        nationality:
                          value: PHL
                          confidence: 99.10%
                        address:
                          value: 123 MABINI ST, BARANGAY SAN ROQUE, QUEZON CITY
                          confidence: 95.30%
                        placeOfBirth: null
                        expiryDate:
                          value: '2027-03-08'
                          confidence: 98.15%
                        issueDate:
                          value: '2022-03-08'
                          confidence: 98.15%
                        issuingAuthority:
                          value: LAND TRANSPORTATION OFFICE
                          confidence: 99.05%
                        licenseCodes:
                          value: A,B
                          confidence: 97.60%
                        agencyCode:
                          value: N04
                          confidence: 98.30%
                        bloodType:
                          value: O+
                          confidence: 96.20%
                        eyesColor:
                          value: BLACK
                          confidence: 97.05%
                        weightKg:
                          value: '68'
                          confidence: 97.80%
                        heightM:
                          value: '1.70'
                          confidence: 97.45%
                        conditions:
                          value: NONE
                          confidence: 98.00%
                        photo: null
                        signature: null
                      missingFields: []
                    verificationStatus: VERIFIED
                    verificationStatusCode: 3
                    transactionId: 6fb0d3a7-2e94-4c15-83bd-c470a1f9e582
                    verificationType: philippines_document_details_extraction
                    metadata:
                      clientReference: PH-KYC-4471
                    createdAt: '2026-09-01T05:41:12.000000Z'
                partialSss:
                  summary: partial — REVIEW_NEEDED (SSS)
                  value:
                    success: true
                    message: >-
                      Philippines document details extraction processed
                      successfully
                    data:
                      outcome: partial
                      fields:
                        documentType: sss
                        documentNumber: null
                        fullName:
                          value: REYES, MARIA CLARA
                          confidence: 97.10%
                        firstName:
                          value: MARIA CLARA
                          confidence: 97.40%
                        middleName: null
                        lastName:
                          value: REYES
                          confidence: 97.95%
                        suffix: null
                        dateOfBirth:
                          value: '1988-11-22'
                          confidence: 96.85%
                        gender:
                          value: F
                          confidence: 98.90%
                        nationality: null
                        address: null
                        placeOfBirth: null
                        issuingAuthority:
                          value: SOCIAL SECURITY SYSTEM
                          confidence: 98.75%
                        photo: null
                        signature: null
                      missingFields:
                        - documentNumber
                    verificationStatus: REVIEW_NEEDED
                    verificationStatusCode: 2
                    transactionId: c92e4f60-1a87-4db3-9e05-38f7c6b21d4a
                    verificationType: philippines_document_details_extraction
                    metadata: null
                    createdAt: '2026-09-01T05:47:33.000000Z'
                rejected:
                  summary: rejected — REJECTED (unrecognised card)
                  value:
                    success: true
                    message: >-
                      Philippines document details extraction processed
                      successfully
                    data:
                      outcome: rejected
                      fields:
                        documentType: null
                        documentNumber: null
                        fullName: null
                        firstName: null
                        middleName: null
                        lastName: null
                        suffix: null
                        dateOfBirth: null
                        gender: null
                        nationality: null
                        address: null
                        placeOfBirth: null
                        photo: null
                        signature: null
                      missingFields:
                        - documentType
                      errorReason: wrong_document_type
                      errorMessage: >-
                        The uploaded document does not appear to be a
                        Philippines Document
                    verificationStatus: REJECTED
                    verificationStatusCode: 1
                    transactionId: 0ad61c53-7f28-4b90-a6e1-b4c8d2953f07
                    verificationType: philippines_document_details_extraction
                    metadata: null
                    createdAt: '2026-09-01T05:52:41.000000Z'
        '400':
          description: The request body or the submitted image failed validation.
          content:
            application/json:
              examples:
                documentTypesProhibited:
                  summary: documentTypes supplied (prohibited)
                  value:
                    success: false
                    code: VALIDATION_FAILED
                    message: >-
                      The request could not be validated. Please check the
                      submitted fields.
                    errors:
                      documentTypes:
                        - >-
                          documentTypes is not supported on the passthrough API;
                          the response reports the document type it found.
                    transactionId: null
                    verificationType: philippines_document_details_extraction
                    createdAt: '2026-09-01T06:05:47.000000Z'
        '500':
          description: >-
            The request could not be processed — either an internal error
            occurred, or the OCR source was unavailable. Check `code` to
            distinguish the two.
          content:
            application/json:
              examples:
                sourceUnavailable:
                  summary: SOURCE_UNAVAILABLE
                  value:
                    success: false
                    code: SOURCE_UNAVAILABLE
                    message: Mistral rate limit exceeded after retry.
                    verificationStatus: FAILED
                    verificationStatusCode: 6
                    transactionId: b8402fc1-6e75-49da-a37c-1d9058be2743
                    verificationType: philippines_document_details_extraction
                    metadata: null
                    createdAt: '2026-09-01T06:25:31.000000Z'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use your API token as a Bearer token in the `Authorization` header.

````