Skip to content

Members

Members are people with a membership on SmartPages. Their passes are issued by their memberships, so you look them up by the member’s kennitala instead of creating them through the API.

Index

Get member passes by kennitala

Returns the member with that kennitala and their live memberships, each with its pass when one exists, for the issuer that owns the API key. A membership can come with pass set to null when no pass has been issued for it yet or its pass was removed: check pass before using its id or deliveryPageUrl . Look the member up by kennitala on every visit and do not store memberId : when several of your members share a kennitala, the member that answers can change.

Send the kennitala as kennitala in a JSON request body, with the Content-Type: application/json header. It travels in the body rather than in the URL, so it stays out of URLs and request logs. It is the member’s Icelandic kennitala: 10 digits, with or without the dash, e.g. 0101302399 or 010130-2399 . Spaces around it are ignored. System kennitalas (starting with 8 or 9) are not accepted.

Call this endpoint from your portal’s server, never from the member’s browser: your API key must stay secret, and the API does not accept browser requests from your own site. Once the member has logged in to your portal or site, look up their passes with their kennitala and send them to deliveryPageUrl , where they add the pass to Apple Wallet or Google Wallet. Do not send them there when the pass status is VOIDED, EXPIRED, REDEEMED, DELETE_IN_PROGRESS or DELETED. memberStatus is informational only: memberships and their pass decide whether the member has a pass to hand out. Until you issue their pass, a member whose passes are issued on request has no membership of the DK Plus membership type in the lookup. The member can hold other live memberships, so decide on the DK Plus membership, by its subscriberListId , and not on whether memberships is empty.

To send the link to a phone instead, call Send SMS for pass with the pass id . That call needs both the REST API and SMS add-ons, and a sender name registered and approved in Settings → SMS Sender names. Set content.customContent and content.customSender unless the membership’s Pass Template has an SMS Template: each value you leave out is taken from the SMS Template, and without one the call answers 400 . Put the ${url} template token in the text: SmartPages replaces it with a short link to the delivery page, and a text without it is sent without a link. Leave out phoneNumber to text the member’s phone number on file or, when the member has none, the phone number stored on the pass; with neither, the call answers 400 . Sending phoneNumber needs a phone number input field on the Pass Template and stores the number on the pass, not on the member.

An invalid kennitala answers:

{
"error": {
"code": "KENNITALA_INVALID",
"message": "Invalid kennitala",
"possibleFixes": [
"Send a 10-digit Icelandic kennitala, with or without the dash, e.g. 0101302399 or 010130-2399"
]
}
}
Request
POST https://smartpages-api.smartsolutions.is/api/v1/member/passes { "kennitala": "0101302399" }
Request fields
kennitala string
Required. The member's Icelandic kennitala: 10 digits, with or without the dash, e.g. 0101302399 or 010130-2399. Spaces around it are ignored. System kennitalas (starting with 8 or 9) are not accepted. The body must not carry other fields.
Response
Example
{ "memberId": "5f1c2b3a-9d4e-4c8b-a1f2-3e4d5c6b7a89", "kennitala": "0101302399", "memberStatus": "ACTIVE", "memberships": [ { "subscriptionId": "8a7b6c5d-4e3f-4a2b-9c1d-0e1f2a3b4c5d", "subscriptionStatus": "ACTIVE", "subscriberListId": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f", "subscriberListName": "Sample Association membership", "pass": { "id": "19700910-7195-4d57-b402-886ff7439e44", "status": "ACTIVE", "walletInstalled": true, "deliveryPageUrl": "https://smartpages.smartsolutions.is/distribution/pass/19700910-7195-4d57-b402-886ff7439e44/2b1f0c9d-3e4a-4b5c-8d6e-7f8a9b0c1d2e", "distributionUrl": "https://smartpages-api.smartsolutions.is/distribution/pass/19700910-7195-4d57-b402-886ff7439e44/2b1f0c9d-3e4a-4b5c-8d6e-7f8a9b0c1d2e" } } ] }
Fields details
memberId UUID
ID of the member on SmartPages.
kennitala string
The kennitala that was looked up, digits only.
memberStatus string
ACTIVE or CANCELLED. Informational only: use memberships to decide whether the member has a pass.
memberships array
The member's live memberships (PENDING, ACTIVE or GRACE), newest first. Empty when the member has no live membership.
subscriptionId UUID
ID of the membership.
subscriptionStatus string
PENDING, ACTIVE or GRACE.
subscriberListId UUID
ID of the membership type.
subscriberListName string
Name of the membership type.
pass object Optional
The membership's pass. Null when the membership has no pass yet, or its pass was removed.
id UUID
ID of the pass. Use it with the pass endpoints, e.g. POST /api/v1/pass/{id}/distribute/sms.
status string
One of ACTIVE, UNCLAIMED, UPDATES_OFF, INACTIVE (not valid yet), EXPIRED, VOIDED, REDEEMED, DELETE_IN_PROGRESS or DELETED. INACTIVE, EXPIRED, VOIDED, REDEEMED and the deleted states are reported whether or not the pass is in a wallet; use walletInstalled to know whether it is.
walletInstalled boolean
True while at least one Apple Wallet or Google Wallet holds an active copy of the pass.
deliveryPageUrl string
Link to the pass delivery page, where the member adds the pass to Apple Wallet or Google Wallet. Send the member here unless the status is VOIDED, EXPIRED, REDEEMED, DELETE_IN_PROGRESS or DELETED.
distributionUrl string
Link that serves the Apple Wallet .pkpass file to iOS and Android browsers. Other browsers, and passes that still need details from the member, are redirected to deliveryPageUrl; a voided, expired or deleted pass is redirected to an error page. For a button, use deliveryPageUrl: it offers both Apple Wallet and Google Wallet.
Code example
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");
const raw = JSON.stringify({
"kennitala": "0101302399"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
try {
const response = await fetch("https://smartpages-api.smartsolutions.is/api/v1/member/passes", requestOptions);
const result = await response.text();
console.log(result)
} catch (error) {
console.error(error);
};

Issue a member’s pass

Subscribes the member with that kennitala to their membership type, which issues their pass, and returns that membership with its pass in the same format as Get member passes by kennitala. It applies to members whose membership is managed by the DK Plus add-on when the add-on is set to issue passes on request: SmartPages keeps those members up to date from DK Plus, but a member has no pass until you ask for one here.

The lookup never issues a pass. Until the pass is issued, it carries no membership of the DK Plus membership type for such a member; any other live membership the member holds comes back as usual. Call this endpoint when the member presses your “get pass” button, not on every page view. Calling it again while the member holds the pass is harmless: it returns the same membership and pass and issues nothing new. Then send the member to deliveryPageUrl , as described above.

Send the kennitala as kennitala in a JSON request body, with the Content-Type: application/json header, exactly as for the lookup: 10 digits, with or without the dash, spaces around it ignored, system kennitalas (starting with 8 or 9) not accepted. Call this endpoint from your portal’s server, never from the member’s browser.

SmartPages decides whether the member qualifies from the status DK Plus last sent for them and the issuer’s rules, and does not ask DK Plus when you call. A member who no longer qualifies loses their pass, and has to ask again once they qualify.

A member who does not qualify answers:

{
"error": {
"code": "MEMBER_NOT_ELIGIBLE",
"message": "The member does not qualify for a pass",
"possibleFixes": ["The member's status in the source system decides who holds a pass"]
}
}
Request
POST https://smartpages-api.smartsolutions.is/api/v1/member/passes/issue { "kennitala": "0101302399" }
Request fields
kennitala string
Required. The member's Icelandic kennitala: 10 digits, with or without the dash, e.g. 0101302399 or 010130-2399. Spaces around it are ignored. System kennitalas (starting with 8 or 9) are not accepted. The body must not carry other fields.
Response
Example
{ "memberId": "5f1c2b3a-9d4e-4c8b-a1f2-3e4d5c6b7a89", "kennitala": "0101302399", "memberStatus": "ACTIVE", "memberships": [ { "subscriptionId": "8a7b6c5d-4e3f-4a2b-9c1d-0e1f2a3b4c5d", "subscriptionStatus": "ACTIVE", "subscriberListId": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f", "subscriberListName": "Sample Association membership", "pass": { "id": "19700910-7195-4d57-b402-886ff7439e44", "status": "UNCLAIMED", "walletInstalled": false, "deliveryPageUrl": "https://smartpages.smartsolutions.is/distribution/pass/19700910-7195-4d57-b402-886ff7439e44/2b1f0c9d-3e4a-4b5c-8d6e-7f8a9b0c1d2e", "distributionUrl": "https://smartpages-api.smartsolutions.is/distribution/pass/19700910-7195-4d57-b402-886ff7439e44/2b1f0c9d-3e4a-4b5c-8d6e-7f8a9b0c1d2e" } } ] }
Fields details
memberId UUID
ID of the member on SmartPages.
kennitala string
The kennitala that was sent, digits only.
memberStatus string
ACTIVE or CANCELLED. Informational only: use memberships to decide whether the member has a pass.
memberships array
Exactly one entry: the DK Plus membership the pass was issued for, or already held, with its pass.
subscriptionId UUID
ID of the membership.
subscriptionStatus string
PENDING, ACTIVE or GRACE.
subscriberListId UUID
ID of the membership type.
subscriberListName string
Name of the membership type.
pass object Optional
The membership's pass. Null when the membership has no pass yet, or its pass was removed.
id UUID
ID of the pass. Use it with the pass endpoints, e.g. POST /api/v1/pass/{id}/distribute/sms.
status string
One of ACTIVE, UNCLAIMED, UPDATES_OFF, INACTIVE (not valid yet), EXPIRED, VOIDED, REDEEMED, DELETE_IN_PROGRESS or DELETED. INACTIVE, EXPIRED, VOIDED, REDEEMED and the deleted states are reported whether or not the pass is in a wallet; use walletInstalled to know whether it is.
walletInstalled boolean
True while at least one Apple Wallet or Google Wallet holds an active copy of the pass.
deliveryPageUrl string
Link to the pass delivery page, where the member adds the pass to Apple Wallet or Google Wallet. Send the member here unless the status is VOIDED, EXPIRED, REDEEMED, DELETE_IN_PROGRESS or DELETED.
distributionUrl string
Link that serves the Apple Wallet .pkpass file to iOS and Android browsers. Other browsers, and passes that still need details from the member, are redirected to deliveryPageUrl; a voided, expired or deleted pass is redirected to an error page. For a button, use deliveryPageUrl: it offers both Apple Wallet and Google Wallet.
Code example
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");
const raw = JSON.stringify({
"kennitala": "0101302399"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
try {
const response = await fetch("https://smartpages-api.smartsolutions.is/api/v1/member/passes/issue", requestOptions);
const result = await response.text();
console.log(result)
} catch (error) {
console.error(error);
};