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

# Driving Licence

> Verifies a driving licence using licence number and date of birth.

This API retrieves the details of a Driving License (DL) associated with a person. It requires the following input parameters:

* **DL Number**: The driving license number.
* **Date of Birth (DOB)**: The date of birth of the individual.

### Optional Feature

* **Name Match Verification**: Optionally, the API can perform a name match verification.

### Response Details

The API provides comprehensive information about the Driving License, including:

* Basic Info
* Driving License Details
* Validity
* Vehicle Category Details
* Address Details
* Status Details

Use this API to fetch all available details related to a Driving License.

### 400 Response Messages

#### DL Number Errors

* DL Number must be in the format AA00XXXXXXXXXXX.
* DL Number cannot have all identical digits in the numeric part.
* `dl_number` is required.
* `dl_number` is invalid.
* `dl_number` must be a string.

#### Date of Birth (DOB) Errors

* Date of Birth must be in the format dd-mm-yyyy.
* `dob` is required.
* `dob` is invalid.
* `dob` must be a string.

#### Name Errors

* `name` must be a string.
* `name` is invalid.
* Name must not contain special characters or numbers.

#### Payload Errors

* Payload is missing.


## OpenAPI

````yaml POST /verification/driving-licence
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:
  /verification/driving-licence:
    post:
      tags:
        - Identity Verification
        - Driving Licence
      summary: Verify Driving Licence
      description: Verifies a driving licence using licence number and date of birth.
      operationId: verifyDrivingLicence
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                dl_number:
                  type: string
                  maxLength: 16
                  example: MH0920220028511
                  description: >-
                    DL Number must be in the format AA00XXXXXXXXXXX and not
                    contain all identical digits in the numeric part. (Max
                    Length: 16)
                dob:
                  type: string
                  pattern: ^\d{2}-\d{2}-\d{4}$
                  example: 05-05-2020
                  description: Date of Birth in DD-MM-YYYY format.
                name:
                  type: string
                  pattern: ^[a-zA-Z\s]*$
                  example: John Doe
                  description: Optional. Must not contain special characters or numbers.
              required:
                - dl_number
                - dob
      responses:
        '200':
          description: Successful response with Driving Licence details.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/APIBaseResponse'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        type: object
                        required:
                          - state
                          - status
                          - user_dob
                          - dl_number
                          - user_image
                          - expiry_date
                          - issued_date
                          - endorse_date
                          - user_address
                          - endorse_number
                          - status_details
                          - user_full_name
                          - name_match_score
                          - user_blood_group
                          - father_or_husband
                          - transport_validity
                          - non_transport_validity
                        properties:
                          state:
                            type: string
                            example: Maharashtra
                          status:
                            type: string
                            example: Active
                          user_dob:
                            type: string
                            example: 05-05-2000
                          dl_number:
                            type: string
                            example: MH0920220018811
                          user_image:
                            type: string
                            format: uri
                            example: <image_url>
                          expiry_date:
                            type: string
                            example: 04-05-2040
                          issued_date:
                            type: string
                            example: ''
                          endorse_date:
                            type: string
                            example: NA
                          user_address:
                            type: object
                            properties:
                              pin:
                                type: string
                                example: '416212'
                              type:
                                type: string
                                example: Permanent
                              state:
                                type: string
                                example: Maharashtra
                              country:
                                type: string
                                example: INDIA
                              district:
                                type: string
                              addressLine1:
                                type: string
                              completeAddress:
                                type: string
                          endorse_number:
                            type: string
                            example: NA
                          status_details:
                            type: object
                            properties:
                              to:
                                type: string
                                example: ''
                              from:
                                type: string
                                example: ''
                              remarks:
                                type: string
                                example: ''
                          user_full_name:
                            type: string
                            example: RAHUL S MEHRA
                          name_match_score:
                            type: string
                            example: '92.00'
                          user_blood_group:
                            type: string
                            example: AB-
                          father_or_husband:
                            type: string
                            example: NARAYAN K MEHRA
                          transport_validity:
                            type: object
                            properties:
                              to:
                                type: string
                                example: NA
                              from:
                                type: string
                                example: NA
                          non_transport_validity:
                            type: object
                            properties:
                              to:
                                type: string
                                example: 04-05-2040
                              from:
                                type: string
                                example: 10-06-2022
                          vehicle_category_details:
                            type: array
                            items:
                              type: object
                              properties:
                                cov:
                                  type: string
                                  example: LMV
                                issueDate:
                                  type: string
                                  example: 10-06-2022
                                expiryDate:
                                  type: string
                                  example: 04-05-2040
                  - $ref: '#/components/schemas/Credits'
              examples:
                Success:
                  summary: Successful response with driving licence details.
                  value:
                    status: success
                    code: 200
                    message: Data Fetched Successfully.
                    data:
                      state: Karnataka
                      status: Active
                      user_dob: 12-11-1995
                      dl_number: KA0620190034567
                      user_image: >-
                        https://storage.googleapis.com/konnectnxt/dl-verification/profile/random-profile-img.png
                      expiry_date: 11-11-2035
                      issued_date: 12-11-2019
                      endorse_date: NA
                      user_address:
                        - pin: '560001'
                          type: Permanent
                          state: Karnataka
                          country: INDIA
                          district: Bangalore Urban
                          addressLine1: No. 24, MG Road
                          completeAddress: No. 24, MG Road, Bangalore Urban, Karnataka, 560001
                        - pin: '560034'
                          type: Present
                          state: Karnataka
                          country: INDIA
                          district: Bangalore Urban
                          addressLine1: Flat 102, Indiranagar Heights
                          completeAddress: >-
                            Flat 102, Indiranagar Heights, Bangalore Urban,
                            Karnataka, 560034
                      endorse_number: NA
                      status_details:
                        to: ''
                        from: ''
                        remarks: ''
                      user_full_name: RAHUL S MEHRA
                      name_match_score: '95.00'
                      user_blood_group: B+
                      father_or_husband: SANJAY K MEHRA
                      transport_validity:
                        to: NA
                        from: NA
                      non_transport_validity:
                        to: 11-11-2035
                        from: 12-11-2019
                      vehicle_category_details:
                        - cov: LMV
                          issueDate: 12-11-2019
                          expiryDate: 11-11-2035
                        - cov: MCWG
                          issueDate: 12-11-2019
                          expiryDate: 11-11-2035
                    credits_used: 1
                    credits_remaining: 499
        '400':
          $ref: '#/components/responses/400_WithCredits'
          description: Bad request due to invalid input data.
          content:
            application/json:
              examples:
                Incorrect DL Format:
                  summary: DL Number must be in the format AA00XXXXXXXXXXX.
                  value:
                    status: error
                    code: 400
                    message: DL Number must be in the format AA00XXXXXXXXXXX.
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                All Identical Digits in DL:
                  summary: All Identical Digits in DL
                  value:
                    status: error
                    code: 400
                    message: >-
                      DL Number cannot have all identical digits in the numeric
                      part.
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Missing DL Number:
                  summary: DL Number missing
                  value:
                    status: error
                    code: 400
                    message: '`dl_number` is required.'
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Invalid DL:
                  summary: Invalid DL
                  value:
                    status: error
                    code: 400
                    message: '`dl_number` is invalid.'
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Null DL:
                  summary: Invalid Mobile Format
                  value:
                    status: error
                    code: 400
                    message: '`dl_number` must be a string.'
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Invalid DOB Format:
                  summary: Invalid DOB Format (DD-MM-YYYY)
                  value:
                    status: error
                    code: 400
                    message: Date of Birth must be in the format dd-mm-yyyy.
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Missing DOB:
                  summary: DOB is required.
                  value:
                    status: error
                    code: 400
                    message: '`dob` is required.'
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Invalid DOB Value:
                  summary: DOB is invalid.
                  value:
                    status: error
                    code: 400
                    message: '`dob` is invalid.'
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Null DOB:
                  summary: DOB must be a string.
                  value:
                    status: error
                    code: 400
                    message: '`dob` must be a string.'
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Null Name:
                  summary: Name must be a string.
                  value:
                    status: error
                    code: 400
                    message: '`name` must be a string.'
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Invalid Name:
                  summary: Invalid Format of the Name.
                  value:
                    status: error
                    code: 400
                    message: '`name` is invalid.'
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Special Characters in Name:
                  summary: Name must not contain special characters or numbers.
                  value:
                    status: error
                    code: 400
                    message: Name must not contain special characters or numbers.
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
                Missing payload:
                  summary: Payload is missing.
                  value:
                    status: error
                    code: 400
                    message: Payload is missing.
                    data: null
                    credits_used: 0
                    credits_remaining: 8858
        '401':
          $ref: '#/components/responses/401'
        '402':
          $ref: '#/components/responses/402'
        '403':
          $ref: '#/components/responses/403'
        '404':
          description: No Records Found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/APIBaseResponse'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        type: object
                        required:
                          - case_id
                        properties:
                          case_id:
                            $ref: '#/components/schemas/CaseId'
                  - $ref: '#/components/schemas/Credits'
              examples:
                No records found:
                  summary: No records Found
                  value:
                    status: error
                    code: 404
                    message: No records found.
                    data:
                      case_id: 8a3b2d79e91c4ff1b2e97b9f2b36c123
                    credits_used: 0
                    credits_remaining: 499
        '500':
          $ref: '#/components/responses/500_WithCredits'
          description: Internal server error.
components:
  schemas:
    APIBaseResponse:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          $ref: '#/components/schemas/APIStatus'
        code:
          $ref: '#/components/schemas/HTTPCode'
        message:
          $ref: '#/components/schemas/APIMessage'
    Credits:
      type: object
      properties:
        credits_used:
          $ref: '#/components/schemas/CreditsUsed'
        credits_left:
          $ref: '#/components/schemas/CreditsLeft'
      required:
        - credits_used
        - credits_left
    CaseId:
      required:
        - case_id
      type: string
      description: Unique Case Id for BGV
    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
    Error:
      allOf:
        - $ref: '#/components/schemas/APIBaseResponse'
    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
    '402':
      description: Payment Required
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
          examples:
            Credit Limit Exceed:
              summary: Credit Limit Exceeded.
              value:
                status: error
                code: 402
                message: Credit Limit Exceeded.
                data: null
            Insufficient Credits:
              summary: Insufficient credits
              value:
                status: error
                code: 402
                message: 'Insufficient credits: 2 required, 1 remaining.'
                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
    400_WithCredits:
      description: Bad Request
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
              - $ref: '#/components/schemas/Credits'
    500_WithCredits:
      description: Internal Server Error
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/APIErrorData'
              - $ref: '#/components/schemas/Credits'
          examples:
            Internal Server Error:
              summary: Internal Server Error.
              value:
                status: error
                code: 500
                message: Internal Server Error.
                data: null
                credits_used: 3
                credits_remaining: 178
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued by KonnectNXT. Pass as `Authorization: Bearer
        <your_api_key>`.

````