Overview
This endpoint generates official NIN slips (Regular, Improved, Premium) and returns a downloadable PDF. The API is designed for server-to-server integrations and mobile/web clients.
Integration Flow
- Verify NIN — Call the verification endpoint to store the NIN biodata in LumiID logs
(
POST /v1/ng/nin-basic or /v1/ng/nin-premium). - Request Slip — Call the Slip Download endpoint with
ninandslip_type. - Receive PDF — LumiID generates the PDF and returns it as a binary response with a
Content-Disposition: attachmentheader to force download. - Client saves/opens — Client writes binary to disk or returns it to end-user (web: auto-download; mobile: save to device).
Note: the NIN must be verified first. If no log exists for the NIN, the
endpoint will return 404.
Slip Download Endpoint
Endpoint
POST https://lumiid.com/api/v1/ng/nin/slip/download
Headers
Authorization: YOUR_API_KEYContent-Type: application/jsonAccept: application/pdf(recommended)
Request Body
{
"nin": "89184072280",
"slip_type": "improved" // regular | improved | premium
}
Successful Response
Binary PDF stream with headers:
Content-Type: application/pdf
Content-Disposition: attachment; filename="improved_89184072280_slip.pdf"
Code Samples
cURL
curl --location 'https://lumiid.com/api/v1/ng/nin/slip/download' \
--header 'Authorization: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--header 'Accept: application/pdf' \
--output slip.pdf \
--data '{
"nin": "89184072280",
"slip_type": "improved"
}'
Python (requests)
import requests
url = "https://lumiid.com/api/v1/ng/nin/slip/download"
headers = {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/pdf"
}
payload = {"nin": "89184072280", "slip_type": "improved"}
r = requests.post(url, json=payload, headers=headers)
if r.status_code == 200:
with open('nin_slip.pdf', 'wb') as f:
f.write(r.content)
print('Saved: nin_slip.pdf')
else:
print(r.status_code, r.text)
Node.js (axios)
const axios = require('axios');
const fs = require('fs');
axios.post('https://lumiid.com/api/v1/ng/nin/slip/download', {
nin: '89184072280',
slip_type: 'improved'
}, {
responseType: 'arraybuffer',
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json',
'Accept': 'application/pdf'
}
}).then(res => {
fs.writeFileSync('nin_slip.pdf', res.data);
console.log('Saved: nin_slip.pdf')
}).catch(err => console.error(err.response ? err.response.data : err.message));
PHP
$apiUrl = "https://lumiid.com/api/v1/ng/nin/slip/download";
$apiKey = "YOUR_API_KEY_HERE";
$data = [
"nin" => "89184072280",
"slip_type" => "improved"
];
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: $apiKey",
"Content-Type: application/json",
"Accept: application/pdf"
],
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_RETURNTRANSFER => true,
]);
$pdf = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);
if ($httpCode !== 200 || $contentType !== "application/pdf") {
echo "Error downloading slip:\n";
var_dump($pdf);
exit;
}
// Save file
$filePath = "nin_slip_89184072280.pdf";
file_put_contents($filePath, $pdf);
echo "Slip saved to: $filePath";
JavaScript Simple fetch — download & save
async function downloadSlip(nin, slipType) {
const url = "https://lumiid.com/api/v1/ng/nin/slip/download";
const payload = { nin, slip_type: slipType };
const res = await fetch(url, {
method: "POST",
headers: {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json",
"Accept": "application/pdf"
},
body: JSON.stringify(payload),
});
if (!res.ok) {
const txt = await res.text();
throw new Error(`Download failed: ${res.status} ${txt}`);
}
const blob = await res.blob();
const downloadUrl = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = downloadUrl;
a.download = `nin_slip_${nin}.pdf`; // fallback name
document.body.appendChild(a);
a.click();
a.remove();
URL.revokeObjectURL(downloadUrl);
}
// usage:
downloadSlip("89184072280", "improved")
.then(() => console.log("Downloaded"))
.catch(e => console.error(e));
Error Handling
| HTTP | When | Action |
|---|---|---|
| 400 | Missing nin or invalid slip_type | Validate request body |
| 401 | Invalid or missing API key | Include valid Authorization header |
| 404 | NIN not found in LumiID logs | Call verify endpoint first |
| 415 | Wrong Content-Type | Use application/json |
| 500 | Server error | Contact LumiID support |
Best Practices & Notes
- Verify first: Always call the verify endpoint before requesting slips.
- Use server-to-server keys: Keep API keys secret and rotate periodically.
- Preserve audit trail: Store the download or response metadata for compliance.
- Use Accept header: Clients should set
Accept: application/pdfto signal they expect binary PDF. - Consider signed URLs: For large-scale integrations you may prefer a temporary signed download URL instead of streaming the PDF.