Getting StartedQuick Start
Quick Start
Step-by-step guidance for secure Xaqiiji API integration.
Integration steps
1
Register business account
Complete this step to finish a working integration.
2
Create xq_test_* API key in portal
Complete this step to finish a working integration.
3
npm install xaqiiji-sdk
Complete this step to finish a working integration.
4
Call verify.citizen() from your backend
Complete this step to finish a working integration.
5
Handle typed SDK errors
Complete this step to finish a working integration.
6
Add webhook URL in portal
Complete this step to finish a working integration.
7
Switch to xq_live_* when approved
Complete this step to finish a working integration.
Install SDK
npm
npm install xaqiiji-sdkThe official xaqiiji-sdk package is published on npm. Install with npm install xaqiiji-sdk — works in Node.js 18+ and any runtime with fetch.
First request (SDK)
TypeScript
npm install xaqiiji-sdkimport { Xaqiiji } from "xaqiiji-sdk";const client = new Xaqiiji({ apiKey: process.env.XAQIIJI_API_KEY!, environment: "test", // use "live" with xq_live_* keys});const result = await client.verify.citizen( { nationalId: "12345678901", purpose: "pre_employment", }, { idempotencyKey: "verify-2026-06-02-001" },);console.log(result.result); // verified | not_found | expired | ...console.log(result.reference); // certificate reference numberconsole.log(result.isCached); // true when replayed within idempotency windowconsole.log(result.citizen?.fullName);REST alternative
fetch
const response = await fetch("http://localhost:8080/api/v1/verify/citizen", { method: "POST", headers: { Authorization: `Bearer ${process.env.XAQIIJI_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "verify-2026-06-02-001", }, body: JSON.stringify({ nationalId: "12345678901", purpose: "pre_employment", }),});const result = await response.json();console.log(result.data?.result);cURL example
cURL
curl -X POST "http://localhost:8080/api/v1/verify/citizen" \ -H "Authorization: Bearer xq_test_xxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: verify-2026-06-02-001" \ -d '{ "nationalId": "12345678901", "purpose": "pre_employment" }'Success response
application/json
{ "message": "Verification completed", "cached": false, "creditDeducted": true, "data": { "id": "uuid", "result": "verified", "purpose": "pre_employment", "channel": "api", "creditsUsed": 1 }, "citizen": { "fullName": "Example Citizen", "dateOfBirth": "1990-01-01", "dateOfIssue": "2020-01-15" }}Edit this page
Was this page helpful?