Skip to content

Passes

Passes are cards in your digital wallet.

REST API hostname: smartpages-api.smartsolutions.is

Index

Create a Pass

Request
POST https://smartpages-api.smartsolutions.is/api/v1/pass { "passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8", "inputFields": [ { "identifier": "kennitala", "value": "0123456789" }, { "identifier": "email", "value": "john@example.com" } ] }
Request fields
passTemplateId UUID
ID of the Pass Template this pass should be created on
isVoided boolean Optional
If the pass should be voided
externalIdentifier string Optional
Custom Identifier of this pass, needs to be unique for Pass Template. You can use this to connect the pass to some entity in your solution.
validFrom string Optional
The pass will be inactive until this date comes. Should be in ISO 8601 format.
expirationDate string Optional
The pass will expire at this date. Should be in ISO 8601 format.
stampsLeft number Optional
How many stamps/punches/tickets are should be left on the pass. Only applicable for Pass Template types of PUNCH or MULTI_TICKET.
alreadyPaid boolean Optional
If this is a payment pass and the pass holder has already paid by using another method than the payment form on the distribution page, (e.g. cash, POS payment)
inputFields array Optional
Input field values of this pass, identifier must match the settings on the Pass Template
identifier string
The identifier of the field as defined in the Pass Template.
value string
The value of the field for this identifier.
backFields array Optional
Custom back fields for this pass.
label string
The label of the field as it will show up on the pass.
value string
The value of the field.
Response
Response fields
id UUID
ID of the Pass
externalIdentifier string Optional
Custom Identifier of this pass, unique for Pass Template. You can use this to connect the pass to some entity in your solution.
passTemplateId UUID
ID of the Pass Template this pass should be created on
status enum
Possible values:
- "UNCLAIMED": Pass was created but has not been claimed by any device
- "INACTIVE": Pass was downloaded, but its 'validFrom' date has not come yet
- "ACTIVE": Pass is active
- "REDEEMED": Pass has reached its usage limit (relevant for tickets, coupons, punch cards)
- "VOIDED": Pass was voided
- "DELETE_IN_PROGRESS" or "DELETED": Pass was voided and deleted from system
- "EXPIRED": Pass expired
- "UPDATES_OFF": Pass was claimed previously but has currently no devices attached
isVoided boolean
A flag indicating whether pass is voided or not
stampsLeft integer Optional
Amount of stamps left for (for punch cards and multi-tickets, otherwise null)
alreadyPaid boolean
Pass was paid for before it was created
isReward boolean
A flag indicating whether pass is a reward pass or not
expirationDate timestamp Optional
Timestamp indicating date and time of pass expiration
validFrom timestamp Optional
posDistributionCode string Optional
distributionUrl string
Pass download link
deliveryPageUrl string
Pass delivery page link
requiresCustomerInput boolean
A flag indicating whether pass requires customer input (email etc.)
inputFieldValues array
Values entered by customer on delivery page
identifier string
Input field identifier
label string
Input field label
value string Optional
Input value
notifyListSubscribed boolean
A flag indicating whether customer selected to be notified through mailing list
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({
"passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8",
"inputFields": [
{
"identifier": "kennitala",
"value": "0123456789"
},
{
"identifier": "email",
"value": "john@example.com"
}
]
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
try {
const response = await fetch("https://smartpages-api.smartsolutions.is/api/v1/pass", requestOptions);
const result = await response.text();
console.log(result)
} catch (error) {
console.error(error);
};

Get pass by ID

Request
GET https://smartpages-api.smartsolutions.is/api/v1/pass/{id}
Response
Response fields
id UUID
ID of the Pass
externalIdentifier string Optional
Custom Identifier of this pass, unique for Pass Template. You can use this to connect the pass to some entity in your solution.
passTemplateId UUID
ID of the Pass Template this pass should be created on
status enum
Possible values:
- "UNCLAIMED": Pass was created but has not been claimed by any device
- "INACTIVE": Pass was downloaded, but its 'validFrom' date has not come yet
- "ACTIVE": Pass is active
- "REDEEMED": Pass has reached its usage limit (relevant for tickets, coupons, punch cards)
- "VOIDED": Pass was voided
- "DELETE_IN_PROGRESS" or "DELETED": Pass was voided and deleted from system
- "EXPIRED": Pass expired
- "UPDATES_OFF": Pass was claimed previously but has currently no devices attached
isVoided boolean
A flag indicating whether pass is voided or not
stampsLeft integer Optional
Amount of stamps left for (for punch cards and multi-tickets, otherwise null)
alreadyPaid boolean
Pass was paid for before it was created
isReward boolean
A flag indicating whether pass is a reward pass or not
expirationDate timestamp Optional
Timestamp indicating date and time of pass expiration
validFrom timestamp Optional
posDistributionCode string Optional
distributionUrl string
Pass download link
deliveryPageUrl string
Pass delivery page link
requiresCustomerInput boolean
A flag indicating whether pass requires customer input (email etc.)
inputFieldValues array
Values entered by customer on delivery page
identifier string
Input field identifier
label string
Input field label
value string Optional
Input value
notifyListSubscribed boolean
A flag indicating whether customer selected to be notified through mailing list
Code example
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
try {
const response = await fetch("https://smartpages-api.smartsolutions.is/api/v1/pass/{id}", requestOptions);
const result = await response.text();
console.log(result)
} catch (error) {
console.error(error);
};

Update a Pass

Request
PUT https://smartpages-api.smartsolutions.is/api/v1/pass/{id} { "passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8", "inputFields": [ { "identifier": "kennitala", "value": "0123456789" }, { "identifier": "email", "value": "updated_email@example.com" } ] }
Request fields
passTemplateId UUID
ID of the Pass Template this pass should be created on
isVoided boolean Optional
If the pass should be voided
externalIdentifier string Optional
Custom Identifier of this pass, needs to be unique for Pass Template. You can use this to connect the pass to some entity in your solution.
validFrom string Optional
The pass will be inactive until this date comes. Should be in ISO 8601 format.
expirationDate string Optional
The pass will expire at this date. Should be in ISO 8601 format.
stampsLeft number Optional
How many stamps/punches/tickets are should be left on the pass. Only applicable for Pass Template types of PUNCH or MULTI_TICKET.
alreadyPaid boolean Optional
If this is a payment pass and the pass holder has already paid by using another method than the payment form on the distribution page, (e.g. cash, POS payment)
inputFields array Optional
Input field values of this pass, identifier must match the settings on the Pass Template
identifier string
The identifier of the field as defined in the Pass Template.
value string
The value of the field for this identifier.
backFields array Optional
Custom back fields for this pass.
label string
The label of the field as it will show up on the pass.
value string
The value of the field.
Response
Response fields
id UUID
ID of the Pass
externalIdentifier string Optional
Custom Identifier of this pass, unique for Pass Template. You can use this to connect the pass to some entity in your solution.
passTemplateId UUID
ID of the Pass Template this pass should be created on
status enum
Possible values:
- "UNCLAIMED": Pass was created but has not been claimed by any device
- "INACTIVE": Pass was downloaded, but its 'validFrom' date has not come yet
- "ACTIVE": Pass is active
- "REDEEMED": Pass has reached its usage limit (relevant for tickets, coupons, punch cards)
- "VOIDED": Pass was voided
- "DELETE_IN_PROGRESS" or "DELETED": Pass was voided and deleted from system
- "EXPIRED": Pass expired
- "UPDATES_OFF": Pass was claimed previously but has currently no devices attached
isVoided boolean
A flag indicating whether pass is voided or not
stampsLeft integer Optional
Amount of stamps left for (for punch cards and multi-tickets, otherwise null)
alreadyPaid boolean
Pass was paid for before it was created
isReward boolean
A flag indicating whether pass is a reward pass or not
expirationDate timestamp Optional
Timestamp indicating date and time of pass expiration
validFrom timestamp Optional
posDistributionCode string Optional
distributionUrl string
Pass download link
deliveryPageUrl string
Pass delivery page link
requiresCustomerInput boolean
A flag indicating whether pass requires customer input (email etc.)
inputFieldValues array
Values entered by customer on delivery page
identifier string
Input field identifier
label string
Input field label
value string Optional
Input value
notifyListSubscribed boolean
A flag indicating whether customer selected to be notified through mailing list
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({
"passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8",
"inputFields": [
{
"identifier": "kennitala",
"value": "0123456789"
},
{
"identifier": "email",
"value": "updated_email@example.com"
}
]
});
const requestOptions = {
method: "PUT",
headers: myHeaders,
body: raw,
redirect: "follow"
};
try {
const response = await fetch("https://smartpages-api.smartsolutions.is/api/v1/pass/{id}", requestOptions);
const result = await response.text();
console.log(result)
} catch (error) {
console.error(error);
};

Scan a pass

Scanning a pass is handled by one or two calls to SmartPages REST API:

  1. An initial fetch-scan call (POST /scan), which allows you to receive pass data and available actions in exchange for scanned code data.This call creates a scan transaction, which is going to be used for any further actions connected to this scan event.
  2. (Optionally) performing one or multiple scan-actions (POST /scan/{id}/action) on the scanned pass using the scan transaction ID returned by previous fetch-scan call. This can mean:
    • voiding the pass
    • punching the pass (if the pass is a punch card or multi-ticket)
    • redeeming the pass (if the pass is a ticket or a coupon)
    • changing available amount on the pass (if the pass is a gift card)

Fetch-scan

Request
POST https://smartpages-api.smartsolutions.is/api/v1/scan { "data": "...barcode data...", "scannerIdentifier": "Scanner #1" }
Request fields
data string
Data retrieved from scanning the pass code
scannerIdentifier string Optional
Identifier or name of the scanner used to scan the pass. It will be displayed in scan history on Smart Pages
Response
Response fields
transactionId UUID
Scan transaction ID that can be used to perform scan action
pass object
Pass data
id UUID
ID of the Pass
externalIdentifier string Optional
Custom Identifier of this pass, unique for Pass Template. You can use this to connect the pass to some entity in your solution.
passTemplateId UUID
ID of the Pass Template this pass should be created on
status enum
Possible values:
- "UNCLAIMED": Pass was created but has not been claimed by any device
- "INACTIVE": Pass was downloaded, but its 'validFrom' date has not come yet
- "ACTIVE": Pass is active
- "REDEEMED": Pass has reached its usage limit (relevant for tickets, coupons, punch cards)
- "VOIDED": Pass was voided
- "DELETE_IN_PROGRESS" or "DELETED": Pass was voided and deleted from system
- "EXPIRED": Pass expired
- "UPDATES_OFF": Pass was claimed previously but has currently no devices attached
isVoided boolean
A flag indicating whether pass is voided or not
stampsLeft integer Optional
Amount of stamps left for (for punch cards and multi-tickets, otherwise null)
alreadyPaid boolean
Pass was paid for before it was created
isReward boolean
A flag indicating whether pass is a reward pass or not
expirationDate timestamp Optional
Timestamp indicating date and time of pass expiration
validFrom timestamp Optional
posDistributionCode string Optional
distributionUrl string
Pass download link
deliveryPageUrl string
Pass delivery page link
requiresCustomerInput boolean
A flag indicating whether pass requires customer input (email etc.)
inputFieldValues array
Values entered by customer on delivery page
identifier string
Input field identifier
label string
Input field label
value string Optional
Input value
notifyListSubscribed boolean
A flag indicating whether customer selected to be notified through mailing list
actions array
Available scan actions for the pass
action string
Type of action:
- VOID: void the pass
- REDEEM: redeem the pass
- PUNCHES: punch the pass (for punch cards and multi-tickets)
- SUBTRACT_AMOUNT: for gift cards
- ADD_AMOUNT: for gift cards
maxPunches integer Optional
Available punches on the pass (for punch or multi-ticket passes)
maxSubtractAmount integer Optional
Maximum amount to subtract from gift-card
minSubtractAmount integer Optional
Minimum amount to subtract from gift-card
maxAddAmount integer Optional
Maximum amount to add to gift-card
minAddAmount integer Optional
Minimum amount to add to gift-card
customTitle string Optional
Action title
customDescription string Optional
Action description
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({
"data": "...barcode data...",
"scannerIdentifier": "Scanner #1"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
try {
const response = await fetch("https://smartpages-api.smartsolutions.is/api/v1/scan", requestOptions);
const result = await response.text();
console.log(result)
} catch (error) {
console.error(error);
};

Perform a scan action

Request
POST https://smartpages-api.smartsolutions.is/api/v1/scan/{transactionId}/action { "action": "PUNCHES", "punches": 2, "subtractedAmount": null, "addedAmount": null }
Request fields
action string
Type of action:
- VOID: void the pass
- REDEEM: redeem the pass
- PUNCHES: punch the pass (for punch cards and multi-tickets)
- SUBTRACT_AMOUNT: for gift card passes
- ADD_AMOUNT: for gift card passes
punches integer Optional
Amount of punches to use on the pass (for PUNCHES action)
subtractedAmount integer Optional
Amount to subtract from gift card (for SUBTRACT_AMOUNT action)
addedAmount integer Optional
Amount to add to gift card (for ADD_AMOUNT action)
Response
Response fields
action string
Type of action:
- VOID: void the pass
- REDEEM: redeem the pass
- PUNCHES: punch the pass (for punch cards and multi-tickets)
- SUBTRACT_AMOUNT: for gift card passes
- ADD_AMOUNT: for gift card passes
pass object
Pass data
id UUID
ID of the Pass
externalIdentifier string Optional
Custom Identifier of this pass, unique for Pass Template. You can use this to connect the pass to some entity in your solution.
passTemplateId UUID
ID of the Pass Template this pass should be created on
status enum
Possible values:
- "UNCLAIMED": Pass was created but has not been claimed by any device
- "INACTIVE": Pass was downloaded, but its 'validFrom' date has not come yet
- "ACTIVE": Pass is active
- "REDEEMED": Pass has reached its usage limit (relevant for tickets, coupons, punch cards)
- "VOIDED": Pass was voided
- "DELETE_IN_PROGRESS" or "DELETED": Pass was voided and deleted from system
- "EXPIRED": Pass expired
- "UPDATES_OFF": Pass was claimed previously but has currently no devices attached
isVoided boolean
A flag indicating whether pass is voided or not
stampsLeft integer Optional
Amount of stamps left for (for punch cards and multi-tickets, otherwise null)
alreadyPaid boolean
Pass was paid for before it was created
isReward boolean
A flag indicating whether pass is a reward pass or not
expirationDate timestamp Optional
Timestamp indicating date and time of pass expiration
validFrom timestamp Optional
posDistributionCode string Optional
distributionUrl string
Pass download link
deliveryPageUrl string
Pass delivery page link
requiresCustomerInput boolean
A flag indicating whether pass requires customer input (email etc.)
inputFieldValues array
Values entered by customer on delivery page
identifier string
Input field identifier
label string
Input field label
value string Optional
Input value
notifyListSubscribed boolean
A flag indicating whether customer selected to be notified through mailing list
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({
"action": "PUNCHES",
"punches": 2,
"subtractedAmount": null,
"addedAmount": null
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
try {
const response = await fetch("https://smartpages-api.smartsolutions.is/api/v1/scan/{transactionId}/action", requestOptions);
const result = await response.text();
console.log(result)
} catch (error) {
console.error(error);
};