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.

POST/api/verification/eid/initiate

Initiate 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

AuthorizationstringRequired

Bearer <access_token> — obtained via OAuth 2.0 Client Credentials

Content-TypestringRequired

application/json

Request Body

phoneNumberstringRequired

Customer's Icelandic phone number (e.g. "7771234")

challengeTypestringRequired

Currently "age"; other types planned for future versions

challengeDataobjectRequired

For 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.

GET/api/verification/eid/status

Poll the status of an eID verification request. Returns the current status and, on success, the verification result and transaction ID.

Headers

AuthorizationstringRequired

Bearer <access_token> — obtained via OAuth 2.0 Client Credentials

Query Parameters

requestIdstringRequired

The 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" }
StatusMeaning
pendingCustomer has not yet confirmed — keep polling
successAge verified and transaction recorded
rejectedCustomer rejected the request
timeoutRequest expired