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

# Voter's Card

> Extract identity details from a Nigerian Permanent Voter's Card (PVC) using OCR.

Verify a customer's Nigerian Permanent Voter's Card (PVC) by uploading a photo — no manual voter ID entry required. Extraction only; no face match, no liveness check.

<Note>
  Only `document_front` is needed for this document.
</Note>

## Endpoint

```
POST /api/onboarding/document_verification
```

## 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_type`  | string | Yes      | `voters_card`                         |
| `country`        | string | Yes      | `nigeria`                             |
| `document_front` | file   | Yes      | Photo of the PVC. JPG or PNG, max 5MB |

### Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://adhere-api.smartcomply.com/api/onboarding/document_verification" \
    -H "x-access-token: YOUR_SECRET_KEY" \
    -F "document_type=voters_card" \
    -F "country=nigeria" \
    -F "document_front=@/path/to/pvc.jpg"
  ```

  ```javascript Node.js theme={null}
  const formData = new FormData();
  formData.append("document_type", "voters_card");
  formData.append("country", "nigeria");
  formData.append("document_front", fs.createReadStream("/path/to/pvc.jpg"));

  const response = await fetch(
    "https://adhere-api.smartcomply.com/api/onboarding/document_verification",
    {
      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",
      headers={"x-access-token": "YOUR_SECRET_KEY"},
      data={"document_type": "voters_card", "country": "nigeria"},
      files={"document_front": open("/path/to/pvc.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 Voter Identification Number (VIN)                 |
| `data.document_type` | string | `"voters_card"`                                       |
| `data.photo`         | string | Base64-encoded face photo extracted from the document |
| `message`            | string | Human-readable result summary                         |

```json theme={null}
{
  "status": "success",
  "data": {
    "valid": true,
    "first_name": "TUNDE",
    "last_name": "AYODELE",
    "full_name": "AYODELE TUNDE",
    "date_of_birth": "2002-02-16",
    "id_number": "90F5A1B2C3D4E5F6",
    "id_type": "voters_card",
    "document_type": "voters_card",
    "photo": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
  },
  "message": "Document details retrieved successfully"
}
```

### 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
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:
    post:
      tags:
        - Document Verification
      summary: Document Verification
      description: >
        Extract identity details from a photo of a document using OCR — no face
        match, no liveness. Fallback for the number-lookup checks (Passport,
        Driver's License, NIN with Face, VNIN, Voter's ID) while those are
        unavailable. Which document_type values are valid depends on country —
        see the Supported Documents table on this page.
      operationId: documentVerification
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - document_type
                - country
                - document_front
              properties:
                document_type:
                  type: string
                  enum:
                    - national_id
                    - passport
                    - drivers_license
                    - voters_card
                    - kenya_id
                    - cac_certificate
                    - utility_bill
                  description: >
                    The kind of document being submitted. Which values are valid
                    depends on country — passport works for every supported
                    country; the rest are country-specific.
                  example: passport
                country:
                  type: string
                  enum:
                    - nigeria
                    - kenya
                    - ghana
                    - canada
                    - usa
                    - cote d'ivoire
                  description: Country the document was issued in.
                  example: nigeria
                document_front:
                  type: string
                  format: binary
                  description: Front of the document. JPG or PNG, max 5MB.
                document_back:
                  type: string
                  format: binary
                  description: >
                    Back of the document. Optional for every type, but
                    recommended for two-sided documents (national_id, kenya_id,
                    drivers_license) — extraction may be less complete without
                    it.
      responses:
        '200':
          description: Document details extracted successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    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

````