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

# Driver's License

> Extract identity details from a Nigerian driver's license using OCR.

Verify a customer's Nigerian driver's license by uploading a photo — no manual license number entry required. OCR extraction plus a required face match against a selfie — no liveness check (no video, no blink/motion challenge).

<Note>
  This is a two-sided document — supply both `document_front` and `document_back` for the most complete extraction.
</Note>

<Note>
  `selfie_image` is required — the face extracted from the document is compared against it. This is a still-image comparison (not liveness).
</Note>

## Endpoint

```
POST /api/onboarding/document_verification/nigeria/drivers_license
```

## Request

### Headers

| Header | Value | Required |
| - | - | - |
| `x-access-token` | Your API secret key | Yes |
| `Content-Type` | `multipart/form-data` | Yes |

### Body Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `document_front` | file | Yes | Front of the driver's license. JPG or PNG, max 5MB |
| `document_back` | file | No | Back of the driver's license. JPG or PNG, max 5MB |
| `selfie_image` | file | Yes | A selfie to compare against the document's face photo. JPG or PNG, max 5MB |

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/drivers_license" \
    -H "x-access-token: YOUR_SECRET_KEY" \
    -F "document_front=@/path/to/license_front.jpg" \
    -F "document_back=@/path/to/license_back.jpg" \
    -F "selfie_image=@/path/to/selfie.jpg"
  ```

  ```javascript Node.js theme={null}
  const formData = new FormData();
  formData.append("document_front", fs.createReadStream("/path/to/license_front.jpg"));
  formData.append("document_back", fs.createReadStream("/path/to/license_back.jpg"));
  formData.append("selfie_image", fs.createReadStream("/path/to/selfie.jpg"));

  const response = await fetch(
    "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/drivers_license",
    {
      method: "POST",
      headers: { "x-access-token": "YOUR_SECRET_KEY" },
      body: formData,
    }
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/drivers_license",
      headers={"x-access-token": "YOUR_SECRET_KEY"},
      files={
          "document_front": open("/path/to/license_front.jpg", "rb"),
          "document_back": open("/path/to/license_back.jpg", "rb"),
          "selfie_image": open("/path/to/selfie.jpg", "rb"),
      },
  )
  data = response.json()
  ```
</CodeGroup>

## Response

### 200 OK

| Field | Type | Description |
| - | - | - |
| `status` | string | `"success"` on a successful extraction |
| `data.full_name` | string | Extracted full name |
| `data.first_name` | string | Extracted first name |
| `data.last_name` | string | Extracted last name |
| `data.date_of_birth` | string | Date of birth in `YYYY-MM-DD` format |
| `data.gender` | string | Extracted gender |
| `data.id_number` | string | The driver's license number |
| `data.document_type` | string | `"drivers_license"` |
| `data.expiry_date` | string | License expiry date |
| `data.is_expired` | boolean | Whether `expiry_date` has already passed |
| `data.photo` | string | Base64-encoded face photo extracted from the document |
| `data.extra_fields` | object | Every other field the license printed — see below |
| `data.face_match` | object | Result of comparing the document's face against `selfie_image` — see below |
| `data.face_match.attempted` | boolean | Whether a comparison was actually run |
| `data.face_match.verified` | boolean \| null | `true`/`false` if the comparison ran; `null` if it couldn't (see Face Match Notes) |
| `data.face_match.confidence_percentage` | number | Match confidence, 0–100 |
| `data.face_match.selfie_image` | string | URL of the uploaded selfie |
| `message` | string | Human-readable result summary |

```json theme={null}
{
  "status": "success",
  "data": {
    "valid": true,
    "first_name": "GOODLUCK EBELE",
    "last_name": "JONATHAN",
    "full_name": "GOODLUCK EBELE JONATHAN",
    "date_of_birth": "1957-11-20",
    "gender": "M",
    "address": "STATE HOUSE",
    "id_number": "JTC0977DD",
    "document_type": "drivers_license",
    "expiry_date": "2030-11-20",
    "is_expired": false,
    "photo": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
    "extra_fields": {
      "height": "1.75M",
      "blood_group": "AB+",
      "place_of_residence": "FCT",
      "category": "PRIVATE",
      "license_class": "B",
      "endorsement": "P",
      "date_of_first_issue": "02-09-2011",
      "first_issued_state": "FCT",
      "facial_marks": "N",
      "glasses_required": "N",
      "replacement_count": "0",
      "renewal_count": "1",
      "next_of_kin_phone": "08072262207"
    },
    "face_match": {
      "attempted": true,
      "verified": true,
      "confidence_percentage": 92.4,
      "selfie_image": "https://.../selfie.jpg"
    }
  },
  "message": "Document details retrieved successfully"
}
```

<Note>
  **Extra Fields** — `extra_fields` carries every other field the license actually printed that doesn't have its own dedicated field above. Nigerian licenses print more of these than other countries' — expect anywhere from a few fields to the full set shown here, and expect `null`/absent fields to be dropped rather than sent as `null`, since a field that wasn't printed on the document isn't guessed at.
</Note>

<Note>
  **Face Match Notes** — if the comparison service itself fails, `attempted` reflects whether a comparison was actually run and `verified` comes back `null` with a `reason` field explaining why — this is different from `verified: false`, which means the comparison ran and the faces didn't match. A face-match problem never blocks the underlying document data — the rest of `data` is still returned.
</Note>

### 400 Bad Request

```json theme={null}
{
  "status": "failed",
  "data": [],
  "message": "ID photo is too blurry — please retake in good lighting with a steady hand"
}
```

### 401 Unauthorized

```json theme={null}
{
  "status": "failed",
  "message": "Authentication credentials were not provided."
}
```

<Note>
  For a full list of error codes, see the [Error Codes](/error_codes) reference.
</Note>


## OpenAPI

````yaml POST /api/onboarding/document_verification/nigeria/drivers_license
openapi: 3.0.3
info:
  title: Adhere API
  description: >-
    Identity verification, credit checks, transaction monitoring, and loan fraud
    detection across Africa.
  version: 3.0.0
servers:
  - url: https://adhere-api.smartcomply.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Nigeria KYC
  - name: Kenya KYC
  - name: Ghana KYC
  - name: Rwanda KYC
  - name: Uganda KYC
  - name: Document Verification
  - name: Biometrics
  - name: Individual Credit
  - name: Business Credit
  - name: Transaction Monitoring
  - name: Transaction Screening
  - name: Transaction KYC
  - name: Loan Fraud
  - name: User Journey
paths:
  /api/onboarding/document_verification/nigeria/drivers_license:
    post:
      tags:
        - Document Verification
      summary: Document Verification — Nigeria Driver's License
      description: >
        Extract identity details from a Nigerian driver's license using OCR,
        plus a required face match against a selfie. document_type and country
        are fixed by this URL — no need to send them in the request body.
      operationId: documentVerificationNigeriaDriversLicense
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - document_front
              properties:
                document_front:
                  type: string
                  format: binary
                  description: Front of the driver's license. JPG or PNG, max 5MB.
                document_back:
                  type: string
                  format: binary
                  description: >
                    Back of the license. Optional, but recommended — extraction
                    may be less complete without it.
                selfie_image:
                  type: string
                  format: binary
                  description: >
                    A selfie to compare against the face extracted from the
                    document. JPG or PNG, max 5MB. Required.
      responses:
        '200':
          $ref: '#/components/responses/DocumentVerificationSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    DocumentVerificationSuccess:
      description: Document details extracted successfully
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: success
              data:
                type: object
                properties:
                  valid:
                    type: boolean
                  first_name:
                    type: string
                  last_name:
                    type: string
                  full_name:
                    type: string
                  date_of_birth:
                    type: string
                  gender:
                    type: string
                  nationality:
                    type: string
                  address:
                    type: string
                  id_number:
                    type: string
                  serial_number:
                    type: string
                  id_type:
                    type: string
                  document_type:
                    type: string
                  expiry_date:
                    type: string
                  issue_date:
                    type: string
                  is_expired:
                    type: boolean
                  photo:
                    type: string
                    description: >-
                      Base64-encoded face photo extracted from the document.
                      Absent for document types with no face photo
                      (cac_certificate, utility_bill).
                  extra_fields:
                    type: object
                    description: >-
                      Every other field OCR read from the document that doesn't
                      have its own dedicated field above. Varies by
                      document_type and country.
                  face_match:
                    type: object
                    description: Present only when selfie_image was supplied.
                    properties:
                      attempted:
                        type: boolean
                      verified:
                        type: boolean
                        nullable: true
                        description: >-
                          true/false if the comparison ran; null if it couldn't
                          (see reason).
                      confidence_percentage:
                        type: number
                      selfie_image:
                        type: string
                        description: URL of the uploaded selfie.
                      reason:
                        type: string
                        description: >-
                          Present when verified is null — explains why the
                          comparison couldn't run or complete.
              message:
                type: string
                example: Document details retrieved successfully
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: failed
              data:
                type: array
                items: {}
              message:
                type: string
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: failed
              message:
                type: string
                example: Authentication credentials were not provided.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: Your Adhere API secret key

````

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