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 required age 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/v1/verifications/eid

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> — requires transactions:write scope

Content-TypestringRequired

application/json

Request Body

identifierstringRequired

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

loginTypestringRequired

"app" (RNT app confirmation) | "sim" (SIM-card confirmation)

requiredAgenumberRequired

Minimum age threshold to verify (for example, 18)

posReferencestringOptional

Your own reference for this transaction (e.g. receipt or basket ID, max 20 characters). Returned on the transaction record for reconciliation

deviceIdstringOptional

Service-client callers only: attribute the transaction to an api-origin device (created via POST /api/v1/devices). Returns 404 if the device does not exist, 400 if it is not an active api-origin device

Examples

cURL

curl -X POST https://abyrgverslun.is/api/v1/verifications/eid \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "identifier": "7771234",
    "loginType": "app",
    "requiredAge": 18
  }'

Response

{
  "requestId": "req_abc123",
  "authId": "rnt_auth_xyz",
  "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/v1/verifications/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> — requires transactions:write scope

Query Parameters

requestIdstringRequired

The requestId returned from the initiate endpoint

Examples

cURL

curl -X GET "https://abyrgverslun.is/api/v1/verifications/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/v1/verifications/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/v1/verifications/eid', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    identifier: '7771234',
    loginType: 'app',
    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