eID Verification
Two-step verification flow using Icelandic electronic ID. Initiate a request, show the confirmation code to the customer, then poll for their response.
Step 1 — Initiate
Send the customer's phone number and the challenge to start the eID flow. The response contains a short numeric code to display to the customer — they must confirm this code in their RNT app or SIM.
/api/verification/eid/initiateInitiate an eID verification request for a customer. Returns a requestId for polling and a short code to display to the customer for confirmation in their RNT app or SIM card.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer <access_token> — obtained via OAuth 2.0 Client Credentials |
| Content-Type | string | Required | application/json |
AuthorizationstringRequiredBearer <access_token> — obtained via OAuth 2.0 Client Credentials
Content-TypestringRequiredapplication/json
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| phoneNumber | string | Required | Customer's Icelandic phone number (e.g. "7771234") |
| challengeType | string | Required | Currently "age"; other types planned for future versions |
| challengeData | object | Required | For age challenges: { "requiredAge": 18 } |
phoneNumberstringRequiredCustomer's Icelandic phone number (e.g. "7771234")
challengeTypestringRequiredCurrently "age"; other types planned for future versions
challengeDataobjectRequiredFor age challenges: { "requiredAge": 18 }
Examples
cURL
curl -X POST https://abyrgverslun.is/api/verification/eid/initiate \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "7771234",
"challengeType": "age",
"challengeData": { "requiredAge": 18 }
}'Response
{
"requestId": "req_abc123",
"code": "1234",
"status": "pending"
}Step 2 — Poll Status
After initiating, poll the status endpoint using the requestId returned in step 1. Continue polling until the status is success, rejected, or timeout.
Note: Poll every 2–3 seconds. Stop polling when status is success, rejected, or timeout.
/api/verification/eid/statusPoll the status of an eID verification request. Returns the current status and, on success, the verification result and transaction ID.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Required | Bearer <access_token> — obtained via OAuth 2.0 Client Credentials |
AuthorizationstringRequiredBearer <access_token> — obtained via OAuth 2.0 Client Credentials
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| requestId | string | Required | The requestId returned from the initiate endpoint |
requestIdstringRequiredThe requestId returned from the initiate endpoint
Examples
cURL
curl -X GET "https://abyrgverslun.is/api/verification/eid/status?requestId=req_abc123" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"JavaScript — polling with interval
async function pollEidStatus(requestId) {
const terminalStatuses = ['success', 'rejected', 'timeout'];
return new Promise((resolve, reject) => {
const interval = setInterval(async () => {
try {
const response = await fetch(
`https://abyrgverslun.is/api/verification/eid/status?requestId=${requestId}`,
{
headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN' },
}
);
const data = await response.json();
if (terminalStatuses.includes(data.status)) {
clearInterval(interval);
resolve(data);
}
} catch (err) {
clearInterval(interval);
reject(err);
}
}, 2500);
});
}
// Usage
const initResponse = await fetch('https://abyrgverslun.is/api/verification/eid/initiate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
phoneNumber: '7771234',
challengeType: 'age',
challengeData: { requiredAge: 18 },
}),
});
const { requestId, code } = await initResponse.json();
// Show 'code' to the customer, then poll
const result = await pollEidStatus(requestId);
console.log(result);Response
// Customer has not yet confirmed
{ "status": "pending" }
// Customer confirmed and age verified
{
"status": "success",
"result": "pass",
"transactionId": "j57b2mNkR4e9..."
}
// Customer rejected the request
{ "status": "rejected" }
// Request expired
{ "status": "timeout" }| Status | Meaning |
|---|---|
| pending | Customer has not yet confirmed — keep polling |
| success | Age verified and transaction recorded |
| rejected | Customer rejected the request |
| timeout | Request expired |