Google Sheet Extension
PDF to Pass
Image to Pass
The Create Dynamic Pass Template API allows you to create reusable templates for generating multiple passes with dynamic content. Templates define the structure and design of passes, while dynamic fields can be populated with different data for each individual pass created from the template.
When this API is called, it automatically creates a linked user group in the Manage Users section of your dashboard. This group is used to organize and manage customers associated with passes created from this template. The response will include both the dynamicPassId and the groupIdof the created user group.
All API requests must include your API key in the request headers:
"apikey": "your-api-key-here"
The API accepts the following parameters in the request body JSON:
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | A descriptive name for the template (max 100 characters) |
| templateData | object | Yes | The pass template configuration including design elements and dynamic field placeholders |
| dynamicFields | array<string> | Yes | An array of field names that can be dynamically populated when creating passes from this template |
| description | string | No | A detailed description of the template's purpose and usage |
The templateData object follows the same structure as the Create Pass API, but supports dynamic field placeholders using double curly braces syntax: {fieldName}
You may include accessCode in templateData. Static values max 10 characters, or {dynamicFieldName} for per-recipient codes (must match a name in dynamicFields). Resolved values must be 10 characters or fewer. Recipients verify on the AddToWallet hosted card or embed page — you do not need to implement preview verification.
Use {fieldName} syntax in any string field within templateData to create dynamic placeholders. When creating passes from this template, these placeholders will be replaced with actual values provided in the request.
The textModulesData field follows the same validation rules as the Create Pass API:
r1start, r1middle, and r1end are accepted (lowercase, case-sensitive)header and body fields (after trimming)Items with invalid IDs (e.g., r2start, r2end, r3middle) or empty headers/bodies will be automatically removed. If all items are invalid, an empty array will be used.
thumbnailImage and/or backgroundImage enables Apple event-ticket layout automatically — do not send a layout switch field.googleHeroImage / heroImage; thumbnail does not replace the Google hero.appleHeroImage is not used for the Apple strip.backgroundImage is optional; Apple falls back to hexBackgroundColor.thumbnailImage, textModulesData renders in a three-column auxiliary row; without thumbnail, fields use the secondary row.null or an empty string to remove an image; when both are cleared, the pass reverts to strip layout.backgroundImage is set, set explicit appleFontColor and appleLabelColor for readable text."thumbnailImage": "{photoUrl}" inside templateData (must match a name in dynamicFields).| Name | Type | Required | Description |
|---|---|---|---|
| templateData.thumbnailImage | string | No | Apple square thumbnail image URL (~90×90 in Wallet). Sending this and/or backgroundImage enables Apple event-ticket layout automatically — no layout field needed. |
| templateData.backgroundImage | string | No | Optional Apple full-card background image (180×220 aspect). Also enables event-ticket layout when set alone. Apple falls back to hexBackgroundColor when omitted. |
curl -X POST 'https://api.addtowallet.co/api/dynamicPass/template/' \
-H 'apikey: your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"name": "Employee Business Card Template",
"description": "A template for employee business cards with dynamic employee information",
"templateData": {
"logoUrl": "https://s3.amazonaws.com/i.addtowallet.co/assets/realestatelogo.png",
"rectangleLogo": "https://s3.amazonaws.com/i.addtowallet.co/assets/realestatelogo.png",
"cardTitle": "{companyName}",
"header": "{employeeName}",
"subheader": "{department}",
"textModulesData": [
{ "id": "r1start", "header": "Position", "body": "{position}" },
{ "id": "r1middle", "header": "Department", "body": "{department}" },
{ "id": "r1end", "header": "Phone", "body": "{phone}" }
],
"linksModuleData": [
{
"id": "r1",
"description": "Call {employeeName}",
"uri": "tel:{phone}"
},
{
"id": "r2",
"description": "Email {employeeName}",
"uri": "mailto:{email}"
},
{
"id": "r3",
"description": "Visit our website",
"uri": "{websiteUrl}"
}
],
"barcodeType": "QR_CODE",
"barcodeValue": "{employeeId}",
"barcodeAltText": "Employee ID: {employeeId}",
"hexBackgroundColor": "#141f31",
"appleFontColor": "#FFFFFF",
"heroImage": "https://s3.amazonaws.com/i.addtowallet.co/assets/realestatehero.png",
"googleHeroImage": "https://s3.amazonaws.com/i.addtowallet.co/assets/realestatehero.png",
"appleHeroImage": "https://s3.amazonaws.com/i.addtowallet.co/assets/realestatehero.png"
},
"dynamicFields": ["companyName","employeeName","position","department","phone","email","employeeId","websiteUrl"]
}'Upon successful creation, the API returns a JSON object containing:
{
"dynamicPassId": "686d0d92c2f0bc5cdf25c834",
"groupId": "66b6005bb7bddce8f05a3392",
"message": "Dynamic pass template created with auto-generated user group for API access"
}Once created, you can use this template to generate passes by calling Add User with the returned groupId and providing values for the dynamic fields defined in the template. Look up the group any time with List User Groups, or manage it from your dashboard's Manage Users section.
| Error Code | Description |
|---|---|
| 400 | BAD_REQUEST - Missing required fields or invalid data format |
| 401 | UNAUTHORIZED - Valid API key required |
| 500 | SERVER_ERROR - Database error or unexpected server issue |