Templates
A template determines the format, style, field placement, and default values for passes. You must specify a template when creating passes or adaptive links.
The Create Template and Update Template calls expect a different data structure than the response from a Get Template call.
Add locations to template
Add locations to the specified template.
POST /template/{templateId}/locations
Security:
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- templateId stringREQUIREDThe template you want to add locations to. For External IDs, format the
{templateId}asid/{externalId}.
Request body:
A request includes an array of locations.
Content-Type:
OBJECT PROPERTIESapplication/json- Locations array
Responses
200
A successful request returns the locations on the pass.
Response body:
- Content-Type:
application/json; charset=utf-8Type:
array
Examples
Example request
POST /v1/template/12345/locations HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"locations":[
{
"longitude": -122.374,
"latitude": 37.618,
"relevantText": "Hello loc0",
"streetAddress1": "address line #1",
"streetAddress2": "address line #2",
"city": "San Francisco",
"region": "CA",
"regionCode": "94404",
"country": "US"
}
]
}
Example request with external ID
POST /v1/template/id/myTemplate/locations HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"locations":[
{
"longitude": -122.374,
"latitude": 37.618,
"relevantText": "Hello loc0",
"streetAddress1": "address line #1",
"streetAddress2": "address line #2",
"city": "San Francisco",
"region": "CA",
"regionCode": "94404",
"country": "US"
}
]
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"locationId": 65,
"value": {
"region": "CA",
"regionCode": "94404",
"relevantText": "Hello loc0",
"streetAddress1": "address line #1",
"streetAddress2": "address line #2",
"longitude": -122.374,
"latitude": 37.618,
"city": "San Francisco"
},
"fieldId": 1842
}
]
Create template
Create a template within the specified project. A template is specific to a vendor platform, Apple or Google. See also Create template with external ID.
POST /template/{id}
Security:
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- id stringREQUIREDThe
projectIdof the project that will contain the new template.
Request body:
The request body is structured by the platform vendor your template and subsequent passes are intended for.
Content-Type:
One ofapplication/jsonA complete iOS template includes template meta information, headers, and fields.
A google template organizes fields into a series of module objects. Include only the objects you want to populate for a particular template; some modules may not apply to your template type.
Responses
200
A response returns the template’s unique identifier. Use this
templateIdto reference the template in subsequent operations.Response body:
- Content-Type:OBJECT PROPERTIES
application/json; charset=utf-8- templateId integer
The identifier for the template. You can recall the template by ID in other operations.
Examples
Example Apple template
POST /v1/template/1234 HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"headers": {
"logo_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(24,86,148)"
},
"icon_image": {
"formatType": 1,
"fieldType": "image",
"value": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-icon.png"
},
"logo_text": {
"formatType": 1,
"fieldType": "topLevel",
"value": "Logo Text"
},
"barcode_encoding": {
"formatType": 1,
"fieldType": "barcode",
"value": "iso-8859-1"
},
"suppress_strip_shine": {
"formatType": 1,
"fieldType": "topLevel",
"value": "true"
},
"logo_image": {
"formatType": 1,
"fieldType": "image",
"value": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-logo.png"
},
"foreground_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(255,255,255)"
},
"background_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(49,159,196)"
}
},
"fields": {
"Coupon": {
"formatType": "String",
"changeMessage": "Enjoy %@ off your next order!",
"order": 1,
"fieldType": "primary",
"textAlignment": "textAlignmentRight",
"value": "20%",
"label": "coupon",
"required": false,
"hideEmpty": true
},
"SiteAddress": {
"formatType": "Number",
"changeMessage": "New stuff, just for you at %@",
"order": 2,
"textAlignment": "textAlignmentCenter",
"fieldType": "secondary",
"value": "https://www.example.com/new?custnumb=123456",
"label": "personalDeals",
"required": false,
"hideEmpty": true
},
"InStore": {
"formatType": "String",
"changeMessage": "Or visit your nearest store at %@",
"order": 1,
"fieldType": "secondary",
"value": "1234 Fake St.",
"label": "nearestStore",
"required": false,
"hideEmpty": false
}
},
"vendor": "Apple",
"projectType": "memberCard",
"projectId": 1234,
"type": "Store Card",
"vendorId": 1,
"deleted": "False",
"description": "Description",
"name": "Loyalty Card",
"disabled": "False",
"expiryInfo": {
"expiryDuration": 365
}
}
Example Google template
POST /v1/template/12345 HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"infoModuleData": {
"hexFontColor": "#666666",
"hexBackgroundColor": "#0096e1",
"Program ID": {
"label": "Program ID",
"value": "12345678",
"row": 0,
"col": 0,
"formatType": "String"
},
"Tier Name": {
"label": "Tier Name",
"value": "Silver",
"row": 0,
"col": 1,
"formatType": "String"
},
"Last Updated": {
"label": "Last Updated",
"value": "Five days ago",
"row": 1,
"col": 0,
"formatType": "String"
}
},
"headers": {
"barcode_type": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_value": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_label": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_encoding": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcodeAltText": {
"fieldType": "barcode",
"value": "",
"notShared": true
}
},
"textModulesData": {
"Program Details": {
"header": "Program Details",
"body": "Some Basic Text",
"row": 0,
"col": 0,
"formatType": "String"
}
},
"linksModuleData": {
"Merchant Website": {
"description": "Merchant Website",
"uri": "http:\/\/www.example.com",
"order": 1,
"formatType": "URL"
}
},
"messageModule": {
},
"imageModulesData": {
},
"pointsModule": {
"Tier": {
"label": "Tier",
"value": 2,
"row": 0,
"col": 1,
"formatType": "Number",
"numberStyle": "PKNumberStyleDecimal"
},
"Points": {
"label": "Points",
"value": 1234,
"row": 0,
"col": 0,
"formatType": "Number"
}
},
"notAssigned": {
},
"titleModule": {
"image": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-icon.png",
"imageDescription": "Logo Image",
"Program Name": {
"label": "Program Name",
"value": "UA",
"row": 0,
"col": 0,
"formatType": "String"
}
},
"vendor": "Google",
"projectType": "memberCard",
"type": "Loyalty1",
"vendorId": 2,
"deleted": "False",
"description": "description",
"name": "Adding Google",
"expiryDuration": 365
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"templateId": 12345
}
Create template with external ID
Create a template with an external ID within the specified project. A template is specific to a vendor platform, Apple or Google. See also Create template.
POST /template/{projectId}/id/{templateExternalId}
Security:
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- projectId stringREQUIREDThe project you want to associate your new template with.
- templateExternalId stringREQUIREDThe custom identifier you want to give to your new template.
Request body:
The request body is structured by the platform vendor your template and subsequent passes are intended for.
Content-Type:
One ofapplication/jsonA complete iOS template includes template meta information, headers, and fields.
A google template organizes fields into a series of module objects. Include only the objects you want to populate for a particular template; some modules may not apply to your template type.
Responses
200
A response returns the template’s unique identifier. Use this
templateIdor the external ID to reference the template in subsequent operations.Response body:
- Content-Type:OBJECT PROPERTIES
application/json; charset=utf-8- templateId integer
The identifier for the template. You can recall the template by ID in other operations.
Examples
Example Apple template
POST /v1/template/1234/id/myTemplate HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"headers": {
"logo_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(24,86,148)"
},
"icon_image": {
"formatType": 1,
"fieldType": "image",
"value": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-icon.png"
},
"logo_text": {
"formatType": 1,
"fieldType": "topLevel",
"value": "Logo Text"
},
"barcode_encoding": {
"formatType": 1,
"fieldType": "barcode",
"value": "iso-8859-1"
},
"suppress_strip_shine": {
"formatType": 1,
"fieldType": "topLevel",
"value": "true"
},
"logo_image": {
"formatType": 1,
"fieldType": "image",
"value": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-logo.png"
},
"foreground_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(255,255,255)"
},
"background_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(49,159,196)"
}
},
"fields": {
"Coupon": {
"formatType": "String",
"changeMessage": "Enjoy %@ off your next order!",
"order": 1,
"fieldType": "primary",
"textAlignment": "textAlignmentRight",
"value": "20%",
"label": "coupon",
"required": false,
"hideEmpty": true
},
"SiteAddress": {
"formatType": "Number",
"changeMessage": "New stuff, just for you at %@",
"order": 2,
"textAlignment": "textAlignmentCenter",
"fieldType": "secondary",
"value": "https://www.example.com/new?custnumb=123456",
"label": "personalDeals",
"required": false,
"hideEmpty": true
},
"InStore": {
"formatType": "String",
"changeMessage": "Or visit your nearest store at %@",
"order": 1,
"fieldType": "secondary",
"value": "1234 Fake St.",
"label": "nearestStore",
"required": false,
"hideEmpty": false
}
},
"vendor": "Apple",
"projectType": "memberCard",
"projectId": 1234,
"type": "Store Card",
"vendorId": 1,
"deleted": "False",
"description": "Description",
"name": "Loyalty Card",
"disabled": "False",
"expiryInfo": {
"expiryDuration": 365
}
}
Example Google template
POST /v1/template/project/id/someProjectExtId/id/someTemplateExtId HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"infoModuleData": {
"hexFontColor": "#666666",
"hexBackgroundColor": "#0096e1",
"Program ID": {
"label": "Program ID",
"value": "12345678",
"row": 0,
"col": 0,
"formatType": "String"
},
"Tier Name": {
"label": "Tier Name",
"value": "Silver",
"row": 0,
"col": 1,
"formatType": "String"
},
"Last Updated": {
"label": "Last Updated",
"value": "Five days ago",
"row": 1,
"col": 0,
"formatType": "String"
}
},
"headers": {
"barcode_type": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_value": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_label": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_encoding": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcodeAltText": {
"fieldType": "barcode",
"value": "",
"notShared": true
}
},
"textModulesData": {
"Program Details": {
"header": "Program Details",
"body": "Some Basic Text",
"row": 0,
"col": 0,
"formatType": "String"
}
},
"linksModuleData": {
"Merchant Website": {
"description": "Merchant Website",
"uri": "http:\/\/www.example.com",
"order": 1,
"formatType": "URL"
}
},
"messageModule": {
},
"imageModulesData": {
},
"pointsModule": {
"Tier": {
"label": "Tier",
"value": 2,
"row": 0,
"col": 1,
"formatType": "Number",
"numberStyle": "PKNumberStyleDecimal"
},
"Points": {
"label": "Points",
"value": 1234,
"row": 0,
"col": 0,
"formatType": "Number"
}
},
"notAssigned": {
},
"titleModule": {
"image": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-icon.png",
"imageDescription": "Logo Image",
"Program Name": {
"label": "Program Name",
"value": "UA",
"row": 0,
"col": 0,
"formatType": "String"
}
},
"vendor": "Google",
"projectType": "memberCard",
"type": "Loyalty1",
"vendorId": 2,
"deleted": "False",
"description": "description",
"name": "Adding Google",
"expiryInfo": {
"expiryDuration": 365
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"templateId": 12345
}
Delete location from template
Remove a location from template.
DELETE /template/{templateId}/location/{locationId}
Security:
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- templateId stringREQUIREDThe template you want to remove a location from. For External IDs, format the
{templateId}asid/{externalId}. - locationId stringREQUIREDThe ID of the location you want to remove.
Responses
200
The location is deleted.
Response body:
- Content-Type:
application/json; charset=utf-8Type:
object
Examples
Example request
DELETE /v1/template/12345/location/456 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Example request with external ID
DELETE /v1/template/id/myTemplate/location/456 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Delete template
Delete the specified template.
DELETE /template/{id}
Security:
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- id stringREQUIREDThe
templateIdof the template you want to delete. For External IDs, format the{id}asid/{externalId}.
Responses
200
Returns the status of the deleted template.
Response body:
- Content-Type:OBJECT PROPERTIES
application/json- TemplateId integer
The identifier of the deleted template.
- status string
Indicates that the request succeeded.
Possible values:
success
Examples
Example request
DELETE /v1/template/12345 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Example request with external ID
DELETE /v1/template/id/12345 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"status": "Deleted",
"TemplateID": "12345"
}
Duplicate template
Duplicates the specified template and put it in the same project.
/v1/template/duplicate/id/(templateExternalId) duplicates the template specified by the external ID and puts the newly created template in the same project.
POST /template/duplicate/{templateId}
Security:
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- templateId stringREQUIREDThe templateId of the template you want to duplicate. For External IDs, format the
{id}asid/{templateExternalId}.
Responses
200
A successful request returns the ID of the newly created template.
Response body:
- Content-Type:OBJECT PROPERTIES
application/json; charset=utf-8- templateId integer
The identifier for the template. You can recall the template by ID in other operations.
Examples
Example request
POST /v1/template/duplicate/12345 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"templateId": 12346
}
Example request with external ID
POST /v1/template/duplicate/id/23456 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{}
Response with external ID
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"templateId": 23457
}
Get template
Get the template specified by the templateId. To get the template payload in the same format as you would use in a POST or PUT operation, use the /templates endpoint instead.
GET /template/{id}
Security:
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- id stringREQUIREDThe
templateIdof the template you want to look up. For External IDs, format the{id}asid/{templateExternalId}.
Responses
200
A successful response returns returns the identifier of the template and dates when the template was created and last updated.
Response body:
- Content-Type:All of
application/json- OBJECT PROPERTIES
- createdAt string
The date and time when the item was created.
- id integer
The identifier for the template. You can recall the template by ID in other operations.
- updatedAt string
The date and time when the item was last updated.
- OBJECT PROPERTIES
Examples
Example request
GET /v1/template/12345 HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Example request with external ID
GET /v1/template/id/myTemplate HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Response — Apple template
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"fieldsModel": {
"headers": {
"logo_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(24,86,148)"
},
"icon_image": {
"formatType": 1,
"fieldType": "image",
"value": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-icon.png"
},
"logo_text": {
"formatType": 1,
"fieldType": "topLevel",
"value": "Logo Text"
},
"barcode_encoding": {
"formatType": 1,
"fieldType": "barcode",
"value": "iso-8859-1"
},
"suppress_strip_shine": {
"formatType": 1,
"fieldType": "topLevel",
"value": "true"
},
"logo_image": {
"formatType": 1,
"fieldType": "image",
"value": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-logo.png"
},
"foreground_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(255,255,255)"
},
"background_color": {
"formatType": 1,
"fieldType": "topLevel",
"value": "rgb(49,159,196)"
}
},
"fields": {
"Coupon": {
"formatType": "String",
"changeMessage": "Enjoy %@ off your next order!",
"order": 1,
"fieldType": "primary",
"textAlignment": "textAlignmentRight",
"value": "20%",
"label": "coupon",
"required": false,
"hideEmpty": true
},
"SiteAddress": {
"formatType": "Number",
"changeMessage": "New stuff, just for you at %@",
"order": 2,
"textAlignment": "textAlignmentCenter",
"fieldType": "secondary",
"value": "https://www.example.com/new?custnumb=123456",
"label": "personalDeals",
"required": false,
"hideEmpty": true
},
"InStore": {
"formatType": "String",
"changeMessage": "Or visit your nearest store at %@",
"order": 1,
"fieldType": "secondary",
"value": "1234 Fake St.",
"label": "nearestStore",
"required": false,
"hideEmpty": false
}
}
},
"templateHeader": {
"vendor": "Apple",
"projectType": "memberCard",
"projectId": 1234,
"type": "Store Card",
"vendorId": 1,
"deleted": "False",
"id": "12345",
"updatedAt": "2013-07-01T18:28:33.000Z",
"description": "Description",
"createdAt": "2013-07-01T18:28:33.000Z",
"name": "Loyalty Card",
"disabled": "False",
"expiryDuration": 730
}
}
Get template passes
Get passes for a template.
/v1/template/id/{templateExternalId}/passes get passes associated with a template identified by external ID.
GET /template/{templateId}/passes
Security:
Query parameters:
- status string
Find only passes matching the installation status.
installed— passes currently installed.uninstalled— passes that have been uninstalled.been_installed— passes that have been either installed or uninstalled.not_been_installed— passes that have never been installed.
Possible values:
installed,uninstalled,been_installed,not_been_installed - pageSize integerThe number of passes per page. Defaults to 10.
Default:
10 - page integerThe page of results you want to retrieve, starting at 1.
Default:
1 - order stringThe order you want passes returned in, defaulting to
id.Possible values:
id,createdAt,updatedAtDefault:
id - direction stringDetermines whether to return values in ascending or descending order. Defaults to
DESC.Possible values:
ASC,DESCDefault:
DESC
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- templateId integerREQUIREDThe
templateIdof the template you want to get passes for. For External IDs, format the{id}asid/{templateExternalId}.
Responses
200
A successful request returns a paged list of passes for a particular template.
Response body:
- Content-Type:OBJECT PROPERTIES
application/json- pagination object<Pagination object>
Contains information about pagination, according to your query parameters.
- passes array[object]
The metadata for passes associated with the template. Each object in the array represents a pass.
404
Template not found.
Examples
Example request
GET /v1/template/12345/passes HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"passes": [{
"id": 3,
"templateId": 12345,
"url": "https://d720-104-177-34-165.ngrok.io/v1/pass/3/download",
"serialNumber": "aff7ffbf-04d7-4180-9da2-c790e08da051",
"createdAt": "2023-04-19T06:17:01.000Z",
"updatedAt": "2023-04-19T06:17:01.000Z",
"status": "uninstalled",
"uninstalledAt": "2023-05-19T06:17:02.000Z",
"installedAt": "2023-04-19T06:17:02.000Z",
"platform": "android"
},
{
"id": 1,
"templateId": 12345,
"url": "https://d720-104-177-34-165.ngrok.io/v1/pass/1/download",
"serialNumber": "34b6f9de-3745-4107-99ae-3f952208e253",
"createdAt": "2023-04-05T17:55:23.000Z",
"updatedAt": "2023-04-05T17:55:23.000Z",
"status": "installed",
"installedAt": "2023-04-05T17:55:23.000Z",
"platform": "android"
}
],
"pagination": {
"order": "id",
"direction": "desc",
"page": 1,
"start": 0,
"pageSize": 2
}
}
Example request with external ID
GET /v1/template/id/23456/passes HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Response with external ID
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"passes": [{
"id": 3,
"templateId": 23456,
"url": "https://d720-104-177-34-165.ngrok.io/v1/pass/3/download",
"serialNumber": "aff7ffbf-04d7-4180-9da2-c790e08da051",
"createdAt": "2023-04-19T06:17:01.000Z",
"updatedAt": "2023-04-19T06:17:01.000Z",
"status": "uninstalled",
"uninstalledAt": "2023-05-19T06:17:02.000Z",
"installedAt": "2023-04-19T06:17:02.000Z",
"platform": "android"
},
{
"id": 1,
"templateId": 23456,
"url": "https://d720-104-177-34-165.ngrok.io/v1/pass/1/download",
"serialNumber": "34b6f9de-3745-4107-99ae-3f952208e253",
"createdAt": "2023-04-05T17:55:23.000Z",
"updatedAt": "2023-04-05T17:55:23.000Z",
"status": "installed",
"installedAt": "2023-04-05T17:55:23.000Z",
"platform": "android"
}
],
"pagination": {
"order": "id",
"direction": "desc",
"page": 1,
"start": 0,
"pageSize": 2
}
}
Get template v2
Get the template specified by the templateId. The template payload returned will be in the same format you would use in a POST or PUT operation unlike the /template endpoint.
GET /templates/{id}
Security:
Path parameters:
- id stringREQUIREDThe
templateIdof the template you want to look up. For External IDs, format the{id}asid/{templateExternalId}.
Responses
200
A successful response returns returns the identifier of the template and dates when the template was created and last updated.
Response body:
- Content-Type:All of
application/json- OBJECT PROPERTIES
- createdAt string
The date and time when the item was created.
- id integer
The identifier for the template. You can recall the template by ID in other operations.
- updatedAt string
The date and time when the item was last updated.
- OBJECT PROPERTIES
Examples
Example request
GET /templates/179229 HTTP/1.1
Authorization: Basic <Base64 key>
Example request with external ID
GET /templates/id/myTemplate HTTP/1.1
Authorization: Basic <Base64 key>
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"type": "loyalty",
"name": "Member Card Android",
"vendorId": 2,
"vendor": "Google",
"projectId": 7311,
"description": "Member Card Android",
"projectType": "loyalty",
"createdAt": "2025-09-26T20:44:15.000Z",
"updatedAt": "2025-09-26T20:44:16.000Z",
"id": 179229,
"deleted": false,
"disabled": false,
"expiryInfo": {
"expiryDuration": 730,
"expiryNever": null
},
"headers": {
"barcode_value": {
"fieldType": "barcode",
"value": "123456789",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcode_encoding": {
"fieldType": "barcode",
"value": "iso-8859-1",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcodeAltText": {
"fieldType": "barcode",
"value": "",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcode_type": {
"fieldType": "barcode",
"value": "PDF_417",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
}
},
"fields": {
"image": {
"fieldType": "titleModule",
"value": "",
"formatType": "String",
"label": "http://storage.googleapis.com/wallet-stag-storage-bucket/1000002/images/ff9367b7cff7cad7fa67ae2c871485e3befae602_6fc517eff2d76511c062913946b9149876a17623_Metro-Logo-1200x1200.png",
"hideEmpty": false,
"required": false
},
"Program Points": {
"fieldType": "loyaltyPoints",
"value": "3600",
"formatType": "Number",
"label": "Member Points",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Program Details": {
"fieldType": "textModulesData",
"value": "Pre-Membership for Metro Members",
"formatType": "String",
"label": "Pre-Member Program",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Tier": {
"fieldType": "acctModule",
"value": "Pre-Member",
"formatType": "String",
"label": "Member Level",
"hideEmpty": false,
"required": false,
"order": 2,
"row": 0,
"col": 1
},
"Merchant Website": {
"fieldType": "linksModuleData",
"value": "Merchant Website",
"formatType": "URL",
"label": "www.metro.com.sg",
"hideEmpty": false,
"required": false,
"order": 0
},
"Member Name": {
"fieldType": "acctModule",
"value": "Henry Christian",
"formatType": "String",
"label": "Member Name",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Loyalty Program Name": {
"fieldType": "titleModule",
"value": "Metro",
"formatType": "String",
"label": "Pre-Member",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
}
},
"locations": [
]
}
List templates
List the headers for templates you created.
GET /template/headers
Security:
Query parameters:
- pageSize numberNumber of templates per page. Defaults to 10.
- page numberThe page you want to retrieve. Defaults to 1.
- order stringThe order you want the projects returned in. Defaults to
id.Possible values:
id,name,createdAt,updatedAt - direction stringThe values ordered ascending or descending. Defaults to
DESC.Possible values:
ASC,DESC
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Responses
200
A successful response includes an array of template headers for templates you created. Look up an individual template to see field and header information for any individual template.
Response body:
- Content-Type:OBJECT PROPERTIES
application/json; charset=utf-8- count string
The total number of results.
- pagination object<Pagination object>
Contains information about pagination, according to your query parameters.
- templateHeaders array
A list of template header objects.
Examples
Example request
GET /v1/template/headers HTTP/1.1
Authorization: Basic <Base64 key>
Api-Revision: 1.2
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"count": 2,
"templateHeaders": [
{
"vendor": "Google",
"projectType": "memberCard",
"projectId": "12345",
"type": "Loyalty1",
"vendorId": "2",
"deleted": "False",
"id": "12344",
"updatedAt": "2013-07-01T18:28:54.000Z",
"description": "description",
"createdAt": "2013-07-01T18:28:54.000Z",
"name": "New Wallet Template",
"disabled": "False",
"expiryDuration": 730
},
{
"vendor": "Apple",
"projectType": "memberCard",
"projectId": "12346",
"type": "Store Card",
"vendorId": "1",
"deleted": "False",
"id": "12345",
"updatedAt": "2013-07-01T18:28:33.000Z",
"description": "Description",
"createdAt": "2013-07-01T18:28:33.000Z",
"name": "Loyalty Card",
"disabled": "False",
"expiryDuration": 730
}
],
"pagination": {
"order": "id",
"page": 1,
"start": 0,
"direction": "DESC",
"pageSize": 10
}
}
Patch template
Update the template with the overrides object, performing a partial update. In the payload, you only need to provide the fields in your template that you want to override.
PATCH /templates/{id}
Security:
Path parameters:
- id stringREQUIREDThe
templateIdof the template you want to update. For External IDs, format the{id}asid/{templateExternalId}.
Request body:
The structure of your template is determined by the device/wallet vendor you create passes for.
Content-Type:
One ofapplication/jsonA complete iOS template includes template meta information, headers, and fields.
A google template organizes fields into a series of module objects. Include only the objects you want to populate for a particular template; some modules may not apply to your template type.
Responses
200
A response returns the template’s unique identifier. Use this
templateIdto reference the template in subsequent operations.Response body:
- Content-Type:OBJECT PROPERTIES
application/json; charset=utf-8- templateId integer
The identifier for the template. You can recall the template by ID in other operations.
Examples
Example patch template
PATCH /templates/179229 HTTP/1.1
Authorization: Basic <authorization string>
Content-Type: application/json
{
"fields" : {
"Loyalty Program Name": {
"fieldType": "titleModule",
"value": "MVP",
"formatType": "String",
"label": "program",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
}
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"type": "loyalty",
"name": "Member Card Android",
"vendorId": 2,
"vendor": "Google",
"projectId": 7311,
"description": "Member Card Android",
"projectType": "loyalty",
"createdAt": "2025-09-26T20:44:15.000Z",
"updatedAt": "2025-09-26T20:44:16.000Z",
"id": 179229,
"deleted": false,
"disabled": false,
"expiryInfo": {
"expiryDuration": 730,
"expiryNever": null
},
"headers": {
"barcodeAltText": {
"fieldType": "barcode",
"value": "",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcode_type": {
"fieldType": "barcode",
"value": "PDF_417",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcode_value": {
"fieldType": "barcode",
"value": "123456789",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcode_encoding": {
"fieldType": "barcode",
"value": "iso-8859-1",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
}
},
"fields": {
"image": {
"fieldType": "titleModule",
"value": "",
"formatType": "String",
"label": "http://storage.googleapis.com/wallet-stag-storage-bucket/1000002/images/ff9367b7cff7cad7fa67ae2c871485e3befae602_6fc517eff2d76511c062913946b9149876a17623_Metro-Logo-1200x1200.png",
"hideEmpty": false,
"required": false
},
"Program Points": {
"fieldType": "loyaltyPoints",
"value": "3600",
"formatType": "Number",
"label": "Member Points",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Program Details": {
"fieldType": "textModulesData",
"value": "Pre-Membership for Metro Members",
"formatType": "String",
"label": "Pre-Member Program",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Tier": {
"fieldType": "acctModule",
"value": "Pre-Member",
"formatType": "String",
"label": "Member Level",
"hideEmpty": false,
"required": false,
"order": 2,
"row": 0,
"col": 1
},
"Merchant Website": {
"fieldType": "linksModuleData",
"value": "Merchant Website",
"formatType": "URL",
"label": "www.metro.com.sg",
"hideEmpty": false,
"required": false,
"order": 0
},
"Member Name": {
"fieldType": "acctModule",
"value": "Henry Christian",
"formatType": "String",
"label": "Member Name",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Loyalty Program Name": {
"fieldType": "titleModule",
"value": "MVP",
"formatType": "String",
"label": "program",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
}
}
}
Publish a bulk update to passes
Updates all passes based on a particular template. The only information you can modify on passes for the specified template ID are images, barcode data, and the following fields:
- Membership ID fields
- Coupon codes
- Barcode values or alternative text
- Any other field or image on the pass
PUT /template/{templateId}/passes
Security:
Query parameters:
- status string
Find only passes matching the installation status.
installed— passes currently installed.uninstalled— passes that have been uninstalled.been_installed— passes that have been either installed or uninstalled.not_been_installed— passes that have never been installed.
Possible values:
installed,uninstalled,been_installed,not_been_installed - pageSize integerThe number of passes per page. Defaults to 10.
Default:
10 - page integerThe page of results you want to retrieve, starting at 1.
Default:
1 - order stringThe order you want passes returned in, defaulting to
id.Possible values:
id,createdAt,updatedAtDefault:
id - direction stringDetermines whether to return values in ascending or descending order. Defaults to
DESC.Possible values:
ASC,DESCDefault:
DESC
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- templateId integerREQUIREDThe
templateIdof the template you want to get passes for. For External IDs, format the{id}asid/{templateExternalId}.
Request body:
Specify the fields you want to update. Any field you do not specify in this payload remains unchanged.
Content-Type:
OBJECT PROPERTIESapplication/json- fields object
Responses
200
Returns a ticket ID as a reference for the update operation.
Response body:
- Content-Type:OBJECT PROPERTIES
application/json- ticketId integer
A ticket you can use to reference this operation for status, troubleshooting, or logging purposes.
404
Template with ID
templateIdwas not found.
Examples
Example request
PUT /v1/template/12345/passes HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"fields": {
"Member Name": {
"value": "Jack Handey"
},
"barcode_value": {
"value": "55555"
},
"Points": {
"value": 1000
}
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"ticketId": 56789
}
Update template
Update the specified template. This endpoint takes any of the parameters used for Creating a Template. You can also add or remove fields from the template with this call by adding or omitting those fields from the request.
To update the template payload in the same format as you would use in a POST or PUT operation, use the /templates endpoint instead.
PUT /template/{id}
Provide a complete template object when updating a template. This call replaces the existing template object in its entirety. You must include all keys and fields that should remain in the template, otherwise they are removed.
Security:
Request headers:
- Api-Revision stringREQUIREDThe particular API revision you want to use. In general, this is
1.2.Possible values:
1.2
Path parameters:
- id stringREQUIREDThe
templateIdof the template you want to update. For External IDs, format the{id}asid/{templateExternalId}.
Request body:
The structure of your template is determined by the device/wallet vendor you create passes for.
Content-Type:
One ofapplication/jsonA complete iOS template includes template meta information, headers, and fields.
A google template organizes fields into a series of module objects. Include only the objects you want to populate for a particular template; some modules may not apply to your template type.
Responses
200
A response returns the template’s unique identifier. Use this
templateIdto reference the template in subsequent operations.Response body:
- Content-Type:OBJECT PROPERTIES
application/json; charset=utf-8- templateId integer
The identifier for the template. You can recall the template by ID in other operations.
Examples
Example request — Apple template
PUT /v1/template/12345 HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"headers": {
"logo_color": {
"formatType": "1",
"fieldType": "topLevel",
"value": "rgb(24,86,148)"
},
"icon_image": {
"formatType": "1",
"fieldType": "image",
"value": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-icon.png"
},
"logo_text": {
"formatType": "1",
"fieldType": "topLevel",
"value": "Logo Text"
},
"barcode_encoding": {
"formatType": "1",
"fieldType": "barcode",
"value": "iso-8859-1"
},
"suppress_strip_shine": {
"formatType": "1",
"fieldType": "topLevel",
"value": "true"
},
"logo_image": {
"formatType": "1",
"fieldType": "image",
"value": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-logo.png"
},
"foreground_color": {
"formatType": "1",
"fieldType": "topLevel",
"value": "rgb(255,255,255)"
},
"background_color": {
"formatType": "1",
"fieldType": "topLevel",
"value": "rgb(49,159,196)"
}
},
"fields": {
"Coupon": {
"formatType": "String",
"changeMessage": "Enjoy %@ off your next order!",
"order": 1,
"fieldType": "primary",
"textAlignment": "textAlignmentRight",
"value": "20%",
"label": "coupon",
"required": false,
"hideEmpty": true
},
"SiteAddress": {
"formatType": "Number",
"changeMessage": "New stuff, just for you at %@",
"order": 2,
"textAlignment": "textAlignmentCenter",
"fieldType": "secondary",
"value": "https://www.example.com/new?custnumb=123456",
"label": "personalDeals",
"required": false,
"hideEmpty": true
},
"InStore": {
"formatType": "String",
"changeMessage": "Or visit your nearest store at %@",
"order": 1,
"fieldType": "secondary",
"value": "1234 Fake St.",
"label": "nearestStore",
"required": false,
"hideEmpty": false
}
},
"beacons":[
{
"uuid": "55502220-A123-A88A-F321-555A444B333C",
"relevantText": "You are near the Ship",
"major": 2,
"minor": 346
}
],
"vendor": "Apple",
"projectType": "memberCard",
"projectId": "1234",
"type": "Store Card",
"vendorId": "1",
"deleted": "False",
"description": "Description",
"name": "Loyalty Card (Edited)",
"disabled": "False"
}
Example request with external ID - Google template
PUT /v1/template/id/12345 HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
Api-Revision: 1.2
{
"infoModuleData": {
"hexFontColor": "#666666",
"hexBackgroundColor": "#0096e1",
"Program ID": {
"label": "Program ID",
"value": "12345678",
"row": 0,
"col": 0,
"formatType": "String"
},
"Tier Name": {
"label": "Tier Name",
"value": "Silver",
"row": 0,
"col": 1,
"formatType": "String"
},
"Last Updated": {
"label": "Last Updated",
"value": "Five days ago",
"row": 1,
"col": 0,
"formatType": "String"
}
},
"headers": {
"barcode_type": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_value": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_label": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcode_encoding": {
"fieldType": "barcode",
"value": "",
"notShared": true
},
"barcodeAltText": {
"fieldType": "barcode",
"value": "",
"notShared": true
}
},
"textModulesData": {
"Program Details": {
"header": "Program Details",
"body": "Some Basic Text",
"row": 0,
"col": 0,
"formatType": "String"
}
},
"linksModuleData": {
"Merchant Website": {
"description": "Merchant Website",
"uri": "http:\/\/www.example.com",
"order": 1,
"formatType": "URL"
}
},
"messageModule": {
},
"imageModulesData": {
},
"pointsModule": {
"Tier": {
"label": "Tier",
"value": 2,
"row": 0,
"col": 1,
"formatType": "Number",
"numberStyle": "PKNumberStyleDecimal"
},
"Points": {
"label": "Points",
"value": 1234,
"row": 0,
"col": 0,
"formatType": "Number"
}
},
"notAssigned": {
},
"titleModule": {
"image": "https:\/\/s3.amazonaws.com\/passtools_prod\/1\/images\/default-pass-icon.png",
"imageDescription": "Logo Image",
"Program Name": {
"label": "Program Name",
"value": "UA",
"row": 0,
"col": 0,
"formatType": "String"
}
},
"vendor": "Google",
"projectType": "memberCard",
"type": "Loyalty1",
"vendorId": 2,
"deleted": "False",
"description": "description",
"name": "Adding Google"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"templateId": "12345"
}
Update template v2
Update the template with the whole resource specified in the request, performing a complete replacement. You can also add or remove fields from the template with this call by adding or omitting those fields from the request. The template payload will be in the same format as in a POST or PUT operation, unlike the /template endpoint.
PUT /templates/{id}
Provide a complete template object when updating a template. This call replaces the existing template object in its entirety. You must include all keys and fields that should remain in the template, otherwise they will be removed.
Security:
Path parameters:
- id stringREQUIREDThe
templateIdof the template you want to update. For External IDs, format the{id}asid/{templateExternalId}.
Request body:
The structure of your template is determined by the device/wallet vendor you create passes for.
Content-Type:
One ofapplication/jsonA complete iOS template includes template meta information, headers, and fields.
A google template organizes fields into a series of module objects. Include only the objects you want to populate for a particular template; some modules may not apply to your template type.
Responses
200
A response returns the template’s unique identifier. Use this
templateIdto reference the template in subsequent operations.Response body:
- Content-Type:OBJECT PROPERTIES
application/json; charset=utf-8- templateId integer
The identifier for the template. You can recall the template by ID in other operations.
Examples
Example request
PUT /templates/12345 HTTP/1.1
Content-Type: application/json
Authorization: Basic <Base64 key>
{
"type": "loyalty",
"name": "Member Card Android",
"vendorId": 2,
"vendor": "Google",
"projectId": 7311,
"description": "Member Card Android",
"projectType": "loyalty",
"deleted": false,
"disabled": false,
"headers": {
"barcode_value": {
"fieldType": "barcode",
"value": "123456789",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcode_encoding": {
"fieldType": "barcode",
"value": "iso-8859-1",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcodeAltText": {
"fieldType": "barcode",
"value": "",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
},
"barcode_type": {
"fieldType": "barcode",
"value": "PDF_417",
"formatType": "String",
"label": "",
"hideEmpty": false,
"required": false
}
},
"fields": {
"image": {
"fieldType": "titleModule",
"value": "Image description for title image"
"formatType": "String",
"label": "http://storage.googleapis.com/wallet-stag-storage-bucket/1000002/images/ff9367b7cff7cad7fa67ae2c871485e3befae602_6fc517eff2d76511c062913946b9149876a17623_Metro-Logo-1200x1200.png",
"hideEmpty": false,
"required": false
},
"Program Points": {
"fieldType": "loyaltyPoints",
"value": "3600",
"formatType": "Number",
"label": "Member Points",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Program Details": {
"fieldType": "textModulesData",
"value": "Pre-Membership for Metro Members",
"formatType": "String",
"label": "Pre-Member Program",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Tier": {
"fieldType": "acctModule",
"value": "Pre-Member",
"formatType": "String",
"label": "Member Level",
"hideEmpty": false,
"required": false,
"order": 2,
"row": 0,
"col": 1
},
"Merchant Website": {
"fieldType": "linksModuleData",
"value": "Merchant Website",
"formatType": "URL",
"label": "www.metro.com.sg",
"hideEmpty": false,
"required": false,
"order": 0
},
"Member Name": {
"fieldType": "acctModule",
"value": "Henry Christian",
"formatType": "String",
"label": "Member Name",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
},
"Loyalty Program Name": {
"fieldType": "titleModule",
"value": "Metro",
"formatType": "String",
"label": "Pre-Member",
"hideEmpty": false,
"required": false,
"order": 1,
"row": 0,
"col": 0
}
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"templateId": 179229
}