curl --request POST \
--url https://api.passform.io/v1/pass/{templateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "ASDF123",
"expiry": "2025-04-04T19:41:12.733Z",
"validFrom": "2025-04-04T19:41:12.733Z",
"voided": false,
"fields": [
{
"key": "voucher",
"label": "free drinks",
"value": "1"
}
],
"backFields": [
{
"key": "terms",
"label": "Terms and Condictions",
"value": "https://myshout.co/terms"
}
]
}
'import requests
url = "https://api.passform.io/v1/pass/{templateId}"
payload = {
"code": "ASDF123",
"expiry": "2025-04-04T19:41:12.733Z",
"validFrom": "2025-04-04T19:41:12.733Z",
"voided": False,
"fields": [
{
"key": "voucher",
"label": "free drinks",
"value": "1"
}
],
"backFields": [
{
"key": "terms",
"label": "Terms and Condictions",
"value": "https://myshout.co/terms"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'ASDF123',
expiry: '2025-04-04T19:41:12.733Z',
validFrom: '2025-04-04T19:41:12.733Z',
voided: false,
fields: [{key: 'voucher', label: 'free drinks', value: '1'}],
backFields: [
{
key: 'terms',
label: 'Terms and Condictions',
value: 'https://myshout.co/terms'
}
]
})
};
fetch('https://api.passform.io/v1/pass/{templateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.passform.io/v1/pass/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'code' => 'ASDF123',
'expiry' => '2025-04-04T19:41:12.733Z',
'validFrom' => '2025-04-04T19:41:12.733Z',
'voided' => false,
'fields' => [
[
'key' => 'voucher',
'label' => 'free drinks',
'value' => '1'
]
],
'backFields' => [
[
'key' => 'terms',
'label' => 'Terms and Condictions',
'value' => 'https://myshout.co/terms'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.passform.io/v1/pass/{templateId}"
payload := strings.NewReader("{\n \"code\": \"ASDF123\",\n \"expiry\": \"2025-04-04T19:41:12.733Z\",\n \"validFrom\": \"2025-04-04T19:41:12.733Z\",\n \"voided\": false,\n \"fields\": [\n {\n \"key\": \"voucher\",\n \"label\": \"free drinks\",\n \"value\": \"1\"\n }\n ],\n \"backFields\": [\n {\n \"key\": \"terms\",\n \"label\": \"Terms and Condictions\",\n \"value\": \"https://myshout.co/terms\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.passform.io/v1/pass/{templateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"ASDF123\",\n \"expiry\": \"2025-04-04T19:41:12.733Z\",\n \"validFrom\": \"2025-04-04T19:41:12.733Z\",\n \"voided\": false,\n \"fields\": [\n {\n \"key\": \"voucher\",\n \"label\": \"free drinks\",\n \"value\": \"1\"\n }\n ],\n \"backFields\": [\n {\n \"key\": \"terms\",\n \"label\": \"Terms and Condictions\",\n \"value\": \"https://myshout.co/terms\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.passform.io/v1/pass/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"ASDF123\",\n \"expiry\": \"2025-04-04T19:41:12.733Z\",\n \"validFrom\": \"2025-04-04T19:41:12.733Z\",\n \"voided\": false,\n \"fields\": [\n {\n \"key\": \"voucher\",\n \"label\": \"free drinks\",\n \"value\": \"1\"\n }\n ],\n \"backFields\": [\n {\n \"key\": \"terms\",\n \"label\": \"Terms and Condictions\",\n \"value\": \"https://myshout.co/terms\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"pass": {
"id": "WgXcQ",
"templateId": "fan-reward",
"accountId": "LDvGjp645u6Q6t9pbvog",
"code": "ASDF123",
"expiry": "2025-04-04T19:41:12.733Z",
"validFrom": "2025-04-04T19:41:12.733Z",
"voided": false,
"fields": [
{
"key": "voucher",
"label": "free drinks",
"value": "1"
}
],
"backFields": [
{
"key": "terms",
"label": "Terms and Condictions",
"value": "https://myshout.co/terms"
}
]
},
"googleUrl": "<string>",
"appleUrl": "<string>",
"webUrl": "<string>"
}{
"statusCode": 123,
"code": "<string>",
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"code": "<string>",
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"code": "<string>",
"error": "<string>",
"message": "<string>"
}Post v1pass
Create a pass for a given template with a random passId. The pass ID will be a Base58 string that is 8 characters
curl --request POST \
--url https://api.passform.io/v1/pass/{templateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "ASDF123",
"expiry": "2025-04-04T19:41:12.733Z",
"validFrom": "2025-04-04T19:41:12.733Z",
"voided": false,
"fields": [
{
"key": "voucher",
"label": "free drinks",
"value": "1"
}
],
"backFields": [
{
"key": "terms",
"label": "Terms and Condictions",
"value": "https://myshout.co/terms"
}
]
}
'import requests
url = "https://api.passform.io/v1/pass/{templateId}"
payload = {
"code": "ASDF123",
"expiry": "2025-04-04T19:41:12.733Z",
"validFrom": "2025-04-04T19:41:12.733Z",
"voided": False,
"fields": [
{
"key": "voucher",
"label": "free drinks",
"value": "1"
}
],
"backFields": [
{
"key": "terms",
"label": "Terms and Condictions",
"value": "https://myshout.co/terms"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: 'ASDF123',
expiry: '2025-04-04T19:41:12.733Z',
validFrom: '2025-04-04T19:41:12.733Z',
voided: false,
fields: [{key: 'voucher', label: 'free drinks', value: '1'}],
backFields: [
{
key: 'terms',
label: 'Terms and Condictions',
value: 'https://myshout.co/terms'
}
]
})
};
fetch('https://api.passform.io/v1/pass/{templateId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.passform.io/v1/pass/{templateId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'code' => 'ASDF123',
'expiry' => '2025-04-04T19:41:12.733Z',
'validFrom' => '2025-04-04T19:41:12.733Z',
'voided' => false,
'fields' => [
[
'key' => 'voucher',
'label' => 'free drinks',
'value' => '1'
]
],
'backFields' => [
[
'key' => 'terms',
'label' => 'Terms and Condictions',
'value' => 'https://myshout.co/terms'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.passform.io/v1/pass/{templateId}"
payload := strings.NewReader("{\n \"code\": \"ASDF123\",\n \"expiry\": \"2025-04-04T19:41:12.733Z\",\n \"validFrom\": \"2025-04-04T19:41:12.733Z\",\n \"voided\": false,\n \"fields\": [\n {\n \"key\": \"voucher\",\n \"label\": \"free drinks\",\n \"value\": \"1\"\n }\n ],\n \"backFields\": [\n {\n \"key\": \"terms\",\n \"label\": \"Terms and Condictions\",\n \"value\": \"https://myshout.co/terms\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.passform.io/v1/pass/{templateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"ASDF123\",\n \"expiry\": \"2025-04-04T19:41:12.733Z\",\n \"validFrom\": \"2025-04-04T19:41:12.733Z\",\n \"voided\": false,\n \"fields\": [\n {\n \"key\": \"voucher\",\n \"label\": \"free drinks\",\n \"value\": \"1\"\n }\n ],\n \"backFields\": [\n {\n \"key\": \"terms\",\n \"label\": \"Terms and Condictions\",\n \"value\": \"https://myshout.co/terms\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.passform.io/v1/pass/{templateId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"ASDF123\",\n \"expiry\": \"2025-04-04T19:41:12.733Z\",\n \"validFrom\": \"2025-04-04T19:41:12.733Z\",\n \"voided\": false,\n \"fields\": [\n {\n \"key\": \"voucher\",\n \"label\": \"free drinks\",\n \"value\": \"1\"\n }\n ],\n \"backFields\": [\n {\n \"key\": \"terms\",\n \"label\": \"Terms and Condictions\",\n \"value\": \"https://myshout.co/terms\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"pass": {
"id": "WgXcQ",
"templateId": "fan-reward",
"accountId": "LDvGjp645u6Q6t9pbvog",
"code": "ASDF123",
"expiry": "2025-04-04T19:41:12.733Z",
"validFrom": "2025-04-04T19:41:12.733Z",
"voided": false,
"fields": [
{
"key": "voucher",
"label": "free drinks",
"value": "1"
}
],
"backFields": [
{
"key": "terms",
"label": "Terms and Condictions",
"value": "https://myshout.co/terms"
}
]
},
"googleUrl": "<string>",
"appleUrl": "<string>",
"webUrl": "<string>"
}{
"statusCode": 123,
"code": "<string>",
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"code": "<string>",
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"code": "<string>",
"error": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Body
The UTC date at which the pass expires. If this is not provided the voucher will have no expiry.
The UTC date at which the pass becomes valid. If this is not provided the pass is valid from when it is created.
Set this to true once the pass has been used
Required for 'generic' pass types.
Metadata is for your internal use. It is not exposed to users through passes. The metadata is limited to 5000 characters when serialized to JSON.
Show child attributes
Show child attributes
4Show child attributes
Show child attributes
The values can be text, numbers or urls.
Show child attributes
Show child attributes
Response
Default Response
The current details of a pass instance
Show child attributes
Show child attributes
{
"id": "WgXcQ",
"templateId": "fan-reward",
"accountId": "LDvGjp645u6Q6t9pbvog",
"code": "ASDF123",
"expiry": "2025-04-04T19:41:12.733Z",
"validFrom": "2025-04-04T19:41:12.733Z",
"voided": false,
"fields": [
{
"key": "voucher",
"label": "free drinks",
"value": "1"
}
],
"backFields": [
{
"key": "terms",
"label": "Terms and Condictions",
"value": "https://myshout.co/terms"
}
]
}

