Passes
Passes are cards in your digital wallet.
REST API hostname: smartpages-api.smartsolutions.is
Index
- Creating and editing the pass:
POST /api/v1/pass- Create a passGET /api/v1/pass/{id}- Get pass data by its IDPUT /api/v1/pass/{id}- Update a pass
- Scanning a pass:
POST /api/v1/scan- Fetch-scanPOST /api/v1/scan/{id}/action- Perform a scan-action
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
value
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
value
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
- "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
label
value
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);};const axios = require('axios');let data = JSON.stringify({ "passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8", "inputFields": [ { "identifier": "kennitala", "value": "0123456789" }, { "identifier": "email", "value": "john@example.com" } ]});
let config = { method: 'post', maxBodyLength: Infinity, url: 'https://smartpages-api.smartsolutions.is/api/v1/pass', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>' }, data : data};
async function makeRequest() { try { const response = await axios.request(config); console.log(JSON.stringify(response.data)); } catch (error) { console.log(error); }}
makeRequest();import requestsimport json
url = "https://smartpages-api.smartsolutions.is/api/v1/pass"
payload = json.dumps({ "passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8", "inputFields": [ { "identifier": "kennitala", "value": "0123456789" }, { "identifier": "email", "value": "john@example.com" } ]})headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)val client = OkHttpClient()val mediaType = "application/json".toMediaType()val body = "{\"passTemplateId\":\"eb168935-29dd-4ec1-ba04-8afbc23243a8\",\"inputFields\":[{\"identifier\":\"kennitala\",\"value\":\"0123456789\"},{\"identifier\":\"email\",\"value\":\"john@example.com\"}]}".toRequestBody(mediaType)val request = Request.Builder() .url("https://smartpages-api.smartsolutions.is/api/v1/pass") .post(body) .addHeader("Content-Type", "application/json") .addHeader("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>") .build()val response = client.newCall(request).execute()var client = new HttpClient();var request = new HttpRequestMessage(HttpMethod.Post, "https://smartpages-api.smartsolutions.is/api/v1/pass");request.Headers.Add("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");var content = new StringContent("{\"passTemplateId\":\"eb168935-29dd-4ec1-ba04-8afbc23243a8\",\"inputFields\":[{\"identifier\":\"kennitala\",\"value\":\"0123456789\"},{\"identifier\":\"email\",\"value\":\"john@example.com\"}]}", null, "application/json");request.Content = content;var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = reqwest::Client::builder() .build()?;
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse()?); headers.insert("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>".parse()?);
let data = r#"{ "passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8", "inputFields": [ { "identifier": "kennitala", "value": "0123456789" }, { "identifier": "email", "value": "john@example.com" } ]}"#;
let json: serde_json::Value = serde_json::from_str(&data)?;
let request = client.request(reqwest::Method::POST, "https://smartpages-api.smartsolutions.is/api/v1/pass") .headers(headers) .json(&json);
let response = request.send().await?; let body = response.text().await?;
println!("{}", body);
Ok(())}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
- "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
label
value
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);};const axios = require('axios');
let config = { method: 'get', maxBodyLength: Infinity, url: 'https://smartpages-api.smartsolutions.is/api/v1/pass/{id}', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>' }};
async function makeRequest() { try { const response = await axios.request(config); console.log(JSON.stringify(response.data)); } catch (error) { console.log(error); }}
makeRequest();import requestsimport json
url = "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}"
payload = {}headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>'}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)val client = OkHttpClient()val request = Request.Builder() .url("https://smartpages-api.smartsolutions.is/api/v1/pass/{id}") .addHeader("Content-Type", "application/json") .addHeader("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>") .build()val response = client.newCall(request).execute()var client = new HttpClient();var request = new HttpRequestMessage(HttpMethod.Get, "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}");request.Headers.Add("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");var content = new StringContent(string.Empty);content.Headers.ContentType = new MediaTypeHeaderValue("application/json");request.Content = content;var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = reqwest::Client::builder() .build()?;
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse()?); headers.insert("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>".parse()?);
let request = client.request(reqwest::Method::GET, "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}") .headers(headers);
let response = request.send().await?; let body = response.text().await?;
println!("{}", body);
Ok(())}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
value
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
value
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
- "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
label
value
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);};const axios = require('axios');let data = JSON.stringify({ "passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8", "inputFields": [ { "identifier": "kennitala", "value": "0123456789" }, { "identifier": "email", "value": "updated_email@example.com" } ]});
let config = { method: 'put', maxBodyLength: Infinity, url: 'https://smartpages-api.smartsolutions.is/api/v1/pass/{id}', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>' }, data : data};
async function makeRequest() { try { const response = await axios.request(config); console.log(JSON.stringify(response.data)); } catch (error) { console.log(error); }}
makeRequest();import requestsimport json
url = "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}"
payload = json.dumps({ "passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8", "inputFields": [ { "identifier": "kennitala", "value": "0123456789" }, { "identifier": "email", "value": "updated_email@example.com" } ]})headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>'}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)val client = OkHttpClient()val mediaType = "application/json".toMediaType()val body = "{\"passTemplateId\":\"eb168935-29dd-4ec1-ba04-8afbc23243a8\",\"inputFields\":[{\"identifier\":\"kennitala\",\"value\":\"0123456789\"},{\"identifier\":\"email\",\"value\":\"updated_email@example.com\"}]}".toRequestBody(mediaType)val request = Request.Builder() .url("https://smartpages-api.smartsolutions.is/api/v1/pass/{id}") .put(body) .addHeader("Content-Type", "application/json") .addHeader("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>") .build()val response = client.newCall(request).execute()var client = new HttpClient();var request = new HttpRequestMessage(HttpMethod.Put, "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}");request.Headers.Add("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");var content = new StringContent("{\"passTemplateId\":\"eb168935-29dd-4ec1-ba04-8afbc23243a8\",\"inputFields\":[{\"identifier\":\"kennitala\",\"value\":\"0123456789\"},{\"identifier\":\"email\",\"value\":\"updated_email@example.com\"}]}", null, "application/json");request.Content = content;var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = reqwest::Client::builder() .build()?;
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse()?); headers.insert("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>".parse()?);
let data = r#"{ "passTemplateId": "eb168935-29dd-4ec1-ba04-8afbc23243a8", "inputFields": [ { "identifier": "kennitala", "value": "0123456789" }, { "identifier": "email", "value": "updated_email@example.com" } ]}"#;
let json: serde_json::Value = serde_json::from_str(&data)?;
let request = client.request(reqwest::Method::PUT, "https://smartpages-api.smartsolutions.is/api/v1/pass/{id}") .headers(headers) .json(&json);
let response = request.send().await?; let body = response.text().await?;
println!("{}", body);
Ok(())}Scan a pass
Scanning a pass is handled by one or two calls to SmartPages REST API:
- 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. - (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
externalIdentifier
passTemplateId
status
isVoided
stampsLeft
alreadyPaid
isReward
expirationDate
validFrom
posDistributionCode
distributionUrl
deliveryPageUrl
requiresCustomerInput
inputFieldValues
notifyListSubscribed
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
- "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
label
value
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
maxPunches
maxSubtractAmount
minSubtractAmount
maxAddAmount
minAddAmount
customTitle
customDescription
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
- 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);};const axios = require('axios');let data = JSON.stringify({ "data": "...barcode data...", "scannerIdentifier": "Scanner #1"});
let config = { method: 'post', maxBodyLength: Infinity, url: 'https://smartpages-api.smartsolutions.is/api/v1/scan', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>' }, data : data};
async function makeRequest() { try { const response = await axios.request(config); console.log(JSON.stringify(response.data)); } catch (error) { console.log(error); }}
makeRequest();import requestsimport json
url = "https://smartpages-api.smartsolutions.is/api/v1/scan"
payload = json.dumps({ "data": "...barcode data...", "scannerIdentifier": "Scanner #1"})headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)val client = OkHttpClient()val mediaType = "application/json".toMediaType()val body = "{\"data\":\"...barcode data...\",\"scannerIdentifier\":\"Scanner #1\"}".toRequestBody(mediaType)val request = Request.Builder() .url("https://smartpages-api.smartsolutions.is/api/v1/scan") .post(body) .addHeader("Content-Type", "application/json") .addHeader("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>") .build()val response = client.newCall(request).execute()var client = new HttpClient();var request = new HttpRequestMessage(HttpMethod.Post, "https://smartpages-api.smartsolutions.is/api/v1/scan");request.Headers.Add("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");var content = new StringContent("{\"data\":\"...barcode data...\",\"scannerIdentifier\":\"Scanner #1\"}", null, "application/json");request.Content = content;var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = reqwest::Client::builder() .build()?;
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse()?); headers.insert("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>".parse()?);
let data = r#"{ "data": "...barcode data...", "scannerIdentifier": "Scanner #1"}"#;
let json: serde_json::Value = serde_json::from_str(&data)?;
let request = client.request(reqwest::Method::POST, "https://smartpages-api.smartsolutions.is/api/v1/scan") .headers(headers) .json(&json);
let response = request.send().await?; let body = response.text().await?;
println!("{}", body);
Ok(())}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
- 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
- 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
externalIdentifier
passTemplateId
status
isVoided
stampsLeft
alreadyPaid
isReward
expirationDate
validFrom
posDistributionCode
distributionUrl
deliveryPageUrl
requiresCustomerInput
inputFieldValues
notifyListSubscribed
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
- "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
label
value
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);};const axios = require('axios');let data = JSON.stringify({ "action": "PUNCHES", "punches": 2, "subtractedAmount": null, "addedAmount": null});
let config = { method: 'post', maxBodyLength: Infinity, url: 'https://smartpages-api.smartsolutions.is/api/v1/scan/{transactionId}/action', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>' }, data : data};
async function makeRequest() { try { const response = await axios.request(config); console.log(JSON.stringify(response.data)); } catch (error) { console.log(error); }}
makeRequest();import requestsimport json
url = "https://smartpages-api.smartsolutions.is/api/v1/scan/{transactionId}/action"
payload = json.dumps({ "action": "PUNCHES", "punches": 2, "subtractedAmount": None, "addedAmount": None})headers = { 'Content-Type': 'application/json', 'Authorization': 'Bearer <base64(KEY_ID:KEY_TOKEN)>'}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)val client = OkHttpClient()val mediaType = "application/json".toMediaType()val body = "{\"action\":\"PUNCHES\",\"punches\":2,\"subtractedAmount\":null,\"addedAmount\":null}".toRequestBody(mediaType)val request = Request.Builder() .url("https://smartpages-api.smartsolutions.is/api/v1/scan/{transactionId}/action") .post(body) .addHeader("Content-Type", "application/json") .addHeader("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>") .build()val response = client.newCall(request).execute()var client = new HttpClient();var request = new HttpRequestMessage(HttpMethod.Post, "https://smartpages-api.smartsolutions.is/api/v1/scan/{transactionId}/action");request.Headers.Add("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>");var content = new StringContent("{\"action\":\"PUNCHES\",\"punches\":2,\"subtractedAmount\":null,\"addedAmount\":null}", null, "application/json");request.Content = content;var response = await client.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(await response.Content.ReadAsStringAsync());#[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = reqwest::Client::builder() .build()?;
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Content-Type", "application/json".parse()?); headers.insert("Authorization", "Bearer <base64(KEY_ID:KEY_TOKEN)>".parse()?);
let data = r#"{ "action": "PUNCHES", "punches": 2, "subtractedAmount": null, "addedAmount": null}"#;
let json: serde_json::Value = serde_json::from_str(&data)?;
let request = client.request(reqwest::Method::POST, "https://smartpages-api.smartsolutions.is/api/v1/scan/{transactionId}/action") .headers(headers) .json(&json);
let response = request.send().await?; let body = response.text().await?;
println!("{}", body);
Ok(())}