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

# PAN v2

> Processes a PAN image and extracts structured information using OCR technology. Returns PAN number, name, father's name, date of birth, and other details.

## Description

Extract structured data from PAN cards using advanced OCR technology powered by IDfy. Simply provide the document URL and receive comprehensive details including PAN number, name, father's name, date of birth, PAN type, and age information. The API automatically detects whether the document is scanned or photographed and validates minor status.

## Use Cases

This API is valuable for:

* **Digital KYC Onboarding** - Automate customer verification by extracting PAN details during account opening or registration processes
* **Loan Applications** - Quickly capture applicant PAN information for identity verification and credit assessment
* **Tax Compliance** - Extract PAN details for tax filing and compliance requirements without manual data entry
* **Identity Authentication** - Verify individual identity by extracting name, father's name, and date of birth from PAN uploads
* **Document Validation** - Detect whether the PAN card is scanned or photographed to assess document quality
* **Age Verification** - Automatically calculate age and determine minor status for age-restricted services
* **Customer Onboarding** - Eliminate manual data entry by automatically capturing all PAN fields from uploaded documents


## OpenAPI

````yaml POST /v2/ocr/pan
openapi: 3.0.0
info:
  title: KonnectNXT API Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://bgv.konnectnxt.com/api
    description: Production
  - url: https://testbgv.konnectnxt.com/api
    description: QA
security:
  - bearerAuth: []
paths:
  /v2/ocr/pan:
    post:
      tags:
        - OCR
      summary: Extract data from PAN Card
      description: >-
        Processes a PAN image and extracts structured information using OCR
        technology. Returns PAN number, name, father's name, date of birth, and
        other details.
      operationId: extractPANOCR
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PANOCRRequest'
            examples:
              Example:
                summary: PAN OCR extraction
                value:
                  document_url: https://example.com/documents/pan-sample.jpg
      responses:
        '200':
          description: PAN OCR processed successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/APIBaseResponse'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        $ref: '#/components/schemas/PANOCRData'
                  - $ref: '#/components/schemas/Credits'
              examples:
                Success:
                  summary: Successful PAN OCR extraction
                  value:
                    status: success
                    code: 200
                    message: Operation completed successfully
                    data:
                      pan_number: MYWPS3665E
                      name: Rajesh Kumar Sharma
                      father_name: Rakesh Kumar Sharma
                      date_of_birth: '1990-03-15'
                      date_of_issue: ''
                      pan_type: Individual
                      age: 35
                      is_minor: false
                      is_scanned: true
                    credits_used: 10
                    credits_remaining: 984066.5
        '400':
          description: Bad request due to invalid input data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Document URL Missing:
                  summary: Document URL missing
                  value:
                    status: error
                    code: 400
                    message: '`document_url` is required.'
                    data: null
                Invalid Document URL:
                  summary: Invalid Document URL
                  value:
                    status: error
                    code: 400
                    message: Enter a valid `document_url`
                    data: null
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '422':
          description: Unprocessable Entity - Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Invalid URL:
                  summary: Invalid document URL provided
                  value:
                    status: error
                    code: 422
                    message: Invalid URL
                    data: null
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    PANOCRRequest:
      type: object
      required:
        - document_url
      properties:
        document_url:
          type: string
          format: uri
          description: Public URL of the PAN card image (JPG, PNG, or PDF)
          example: https://example.com/documents/pan-sample.jpg
    APIBaseResponse:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          $ref: '#/components/schemas/APIStatus'
        code:
          $ref: '#/components/schemas/HTTPCode'
        message:
          $ref: '#/components/schemas/APIMessage'
    PANOCRData:
      type: object
      required:
        - pan_number
        - name
        - father_name
        - date_of_birth
        - pan_type
        - age
        - is_minor
        - is_scanned
      properties:
        pan_number:
          type: string
          description: PAN number extracted from the card
          example: MYWPS3665E
        name:
          type: string
          description: Full name as printed on PAN card
          example: Rajesh Kumar Sharma
        father_name:
          type: string
          description: Father's name from PAN card
          example: Rakesh Kumar Sharma
        date_of_birth:
          type: string
          format: date
          description: Date of birth in YYYY-MM-DD format
          example: '1990-03-15'
        date_of_issue:
          type: string
          nullable: true
          description: Date of issue (if available)
          example: ''
        pan_type:
          type: string
          description: Type of PAN card holder
          example: Individual
        age:
          type: integer
          description: Calculated age based on date of birth
          example: 35
        is_minor:
          type: boolean
          description: Whether the PAN holder is a minor
          example: false
        is_scanned:
          type: boolean
          description: Whether the document is a scanned copy
          example: true
    Credits:
      type: object
      properties:
        credits_used:
          $ref: '#/components/schemas/CreditsUsed'
        credits_left:
          $ref: '#/components/schemas/CreditsLeft'
      required:
        - credits_used
        - credits_left
    Error:
      allOf:
        - $ref: '#/components/schemas/APIBaseResponse'
    APIStatus:
      type: string
      enum:
        - success
        - error
      description: Overall status of the API
    HTTPCode:
      type: integer
      description: HTTP status code
      example: 400
    APIMessage:
      type: string
      description: Description of the response or error
      example: Invalid request parameters
    CreditsUsed:
      type: integer
      description: Represents the total number of credits used in this request.
      example: 3
    CreditsLeft:
      type: integer
      description: 'Represents the remaining credits available for use. '
      example: 4040
    APIErrorData:
      type: object
      properties:
        data:
          type: object
          nullable: true
          example: null
  responses:
    '401':
      description: Unauthorized
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Missing Token:
              summary: Bearer token is missing or invalid.
              value:
                status: error
                code: 401
                message: Bearer token is missing or invalid.
                data: null
            Incorrect Token Format:
              summary: Token format is incorrect
              value:
                status: error
                code: 401
                message: Token format is incorrect
                data: null
            No Admin Found:
              summary: No admin found for this request
              value:
                status: error
                code: 401
                message: No admin user found for this organization
                data: null
            Invalid API Key:
              summary: Invalid API Key
              value:
                status: error
                code: 401
                message: Invalid API key (organization ID)
                data: null
            User not Found:
              summary: User not found
              value:
                status: error
                code: 401
                message: User not found.
                data: null
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Token Revoked:
              summary: Token access has been Revoked, Contact Support.
              value:
                status: error
                code: 403
                message: Token access has been Revoked, Contact Support.
                data: null
            Token Inactive:
              summary: Token is Inactive, Contact Support.
              value:
                status: error
                code: 403
                message: Token is Inactive, Contact Support.
                data: null
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Internal Server Error:
              summary: Internal Server Error.
              value:
                status: error
                code: 500
                message: Internal Server Error.
                data: null
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued by KonnectNXT. Pass as `Authorization: Bearer
        <your_api_key>`.

````