Face Verification
Face verification is required. Users can complete KYC and transact without face verification. Only Aadhaar, PAN, and Bank are required.
Face verification is a two-step process:
- Initialize - Get a session URL for the user to complete face liveness
- Verify - Check the verification status after user completes the flow
Initialize Face Verification
Required URL to redirect user after completion
Device fingerprint/ID for FIU compliance. Must be captured from the client device.
Request
curl -X POST https://api.stablepay.global/v2/users/usr_abc123/kyc/face/init \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"redirectUrl": "https://yourapp.com/kyc/callback",
"deviceId": "device-fingerprint-12345"
}'
Response
{
"success": true,
"data": {
"sessionId": "face_1704067200_abc123",
"sdkToken": "face_1704067200_abc123",
"url": "https://kyc-sdk.surepass.io/face-liveness?token=...",
"expiresIn": 600
}
}
Direct the user to the url to complete face liveness verification. The session expires in 10 minutes.
Check Face Verification Status
After the user completes the face liveness flow, check the verification status.
The sessionId from the init response (optional if stored in database)
Request
curl -X POST https://api.stablepay.global/v2/users/usr_abc123/kyc/face/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sessionId": "face_1704067200_abc123"}'
Response (Verified)
{
"success": true,
"data": {
"verified": true,
"livenessScore": 0.95,
"faceMatchScore": 0.88,
"isLive": true,
"faceMatched": true,
"message": "Face liveness verified"
}
}
Response (Pending)
{
"success": true,
"data": {
"verified": false,
"livenessScore": 0,
"faceMatchScore": 0,
"isLive": false,
"faceMatched": false,
"message": "Face verification pending or failed"
}
}
Verification Thresholds
| Metric | Threshold | Description |
|---|
| Liveness Score | >= 0.8 | Confidence that the face is live (not a photo/video) |
| Face Match Score | >= 0.7 | Similarity between selfie and reference image |
Errors
| Code | Description |
|---|
SESSION_NOT_FOUND | Face verification session not initialized |
ALREADY_VERIFIED | Face is already verified for this user |
SESSION_EXPIRED | The session has expired, initialize again |