Document Verification — Nigeria National ID
curl --request POST \
--url https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id \
--header 'Content-Type: multipart/form-data' \
--header 'x-access-token: <api-key>' \
--form document_front='@example-file' \
--form document_back='@example-file' \
--form selfie_image='@example-file'import requests
url = "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id"
files = {
"document_front": ("example-file", open("example-file", "rb")),
"document_back": ("example-file", open("example-file", "rb")),
"selfie_image": ("example-file", open("example-file", "rb"))
}
headers = {"x-access-token": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('document_front', '<string>');
form.append('document_back', '<string>');
form.append('selfie_image', '<string>');
const options = {method: 'POST', headers: {'x-access-token': '<api-key>'}};
options.body = form;
fetch('https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id")
.header("x-access-token", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"valid": true,
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"date_of_birth": "<string>",
"gender": "<string>",
"nationality": "<string>",
"address": "<string>",
"id_number": "<string>",
"serial_number": "<string>",
"id_type": "<string>",
"document_type": "<string>",
"expiry_date": "<string>",
"issue_date": "<string>",
"is_expired": true,
"photo": "<string>",
"extra_fields": {},
"face_match": {
"attempted": true,
"verified": true,
"confidence_percentage": 123,
"selfie_image": "<string>",
"reason": "<string>"
}
},
"message": "Document details retrieved successfully"
}{
"status": "failed",
"data": [
"<unknown>"
],
"message": "<string>"
}{
"status": "failed",
"message": "Authentication credentials were not provided."
}Nigeria
National ID
Extract identity details from a Nigerian NIN slip or card using OCR.
POST
/
api
/
onboarding
/
document_verification
/
nigeria
/
national_id
Document Verification — Nigeria National ID
curl --request POST \
--url https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id \
--header 'Content-Type: multipart/form-data' \
--header 'x-access-token: <api-key>' \
--form document_front='@example-file' \
--form document_back='@example-file' \
--form selfie_image='@example-file'import requests
url = "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id"
files = {
"document_front": ("example-file", open("example-file", "rb")),
"document_back": ("example-file", open("example-file", "rb")),
"selfie_image": ("example-file", open("example-file", "rb"))
}
headers = {"x-access-token": "<api-key>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('document_front', '<string>');
form.append('document_back', '<string>');
form.append('selfie_image', '<string>');
const options = {method: 'POST', headers: {'x-access-token': '<api-key>'}};
options.body = form;
fetch('https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id")
.header("x-access-token", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_front\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_back\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"selfie_image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"valid": true,
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"date_of_birth": "<string>",
"gender": "<string>",
"nationality": "<string>",
"address": "<string>",
"id_number": "<string>",
"serial_number": "<string>",
"id_type": "<string>",
"document_type": "<string>",
"expiry_date": "<string>",
"issue_date": "<string>",
"is_expired": true,
"photo": "<string>",
"extra_fields": {},
"face_match": {
"attempted": true,
"verified": true,
"confidence_percentage": 123,
"selfie_image": "<string>",
"reason": "<string>"
}
},
"message": "Document details retrieved successfully"
}{
"status": "failed",
"data": [
"<unknown>"
],
"message": "<string>"
}{
"status": "failed",
"message": "Authentication credentials were not provided."
}Verify a customer’s Nigerian National Identification Number slip or card by uploading a photo — no manual NIN entry required. OCR extraction plus a required face match against a selfie — no liveness check (no video, no blink/motion challenge).
This is a two-sided document — supply both
document_front and document_back for the most complete extraction.selfie_image is required — the face extracted from the document is compared against it. This is a still-image comparison (not liveness).Endpoint
POST /api/onboarding/document_verification/nigeria/national_id
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 NIN slip/card. JPG or PNG, max 5MB |
document_back | file | No | Back of the NIN card. JPG or PNG, max 5MB |
selfie_image | file | Yes | A selfie to compare against the document’s face photo. JPG or PNG, max 5MB |
document_type and country are not needed — this endpoint is already scoped to Nigerian National ID.Example
curl -X POST "https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id" \
-H "x-access-token: YOUR_SECRET_KEY" \
-F "document_front=@/path/to/nin_front.jpg" \
-F "document_back=@/path/to/nin_back.jpg" \
-F "selfie_image=@/path/to/selfie.jpg"
const formData = new FormData();
formData.append("document_front", fs.createReadStream("/path/to/nin_front.jpg"));
formData.append("document_back", fs.createReadStream("/path/to/nin_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/national_id",
{
method: "POST",
headers: { "x-access-token": "YOUR_SECRET_KEY" },
body: formData,
}
);
const data = await response.json();
import requests
response = requests.post(
"https://adhere-api.smartcomply.com/api/onboarding/document_verification/nigeria/national_id",
headers={"x-access-token": "YOUR_SECRET_KEY"},
files={
"document_front": open("/path/to/nin_front.jpg", "rb"),
"document_back": open("/path/to/nin_back.jpg", "rb"),
"selfie_image": open("/path/to/selfie.jpg", "rb"),
},
)
data = response.json()
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 NIN printed on the document |
data.document_type | string | "national_id" |
data.photo | string | Base64-encoded face photo extracted from the document |
data.extra_fields | object | Present if the card is the older two-sided format — 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 |
{
"status": "success",
"data": {
"valid": true,
"first_name": "TUNDE",
"last_name": "AYODELE",
"full_name": "AYODELE TUNDE",
"date_of_birth": "2002-02-16",
"gender": "M",
"id_number": "12345678901",
"document_type": "national_id",
"photo": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
"face_match": {
"attempted": true,
"verified": true,
"confidence_percentage": 92.4,
"selfie_image": "https://.../selfie.jpg"
}
},
"message": "Document details retrieved successfully"
}
Extra Fields — the newer, one-sided NIN slip/card has no fields beyond what’s listed above. The older, two-sided card prints more (
occupation, state, lga, ward, height, blood_group, plus several back-side fields) — these come back in extra_fields when present, and are simply absent for the newer format rather than sent as null.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.400 Bad Request
Returned for invalid input, or when the document fails OCR’s own quality checks (blurry, wrong document type, glare, etc.).{
"status": "failed",
"data": [],
"message": "ID photo is too blurry — please retake in good lighting with a steady hand"
}
401 Unauthorized
{
"status": "failed",
"message": "Authentication credentials were not provided."
}
For a full list of error codes, see the Error Codes reference.
Authorizations
Your Adhere API secret key
Body
multipart/form-data

