Template objects

Template objects vary based on the vendor they’re intended for and the types of passes you want to create.

Apple Pass personalization requirements

Jump to examples ↓

OBJECT PROPERTIES
  • description stringREQUIRED

    A brief description of the rewards program that the recipient is signing up for. The description appears on the signup sheet, under the personalization logo.

  • imageUrl string

    The URL of the image you want to appear at the top of the signup form. This image must be a 150 x 40 point PNG image.

  • requiredPersonalizationFields array[string]REQUIRED

    An array of strings representing fields that a customer must provide to sign up for your rewards/loyalty program. Some keys populate multiple fields in the personalization callback or on passes.

    • name - requires the user to enter their fullName. This also populates the givenName and familyName fields on passes and/or personalization callbacks.
    • postalCode - prompts the user for their postal code. This populates both postalCode and ISOCountryCode on passes and/or personalization callbacks.
    • emailAddress - requires the user’s email address.
    • phoneNumber - requires the user’s phone number.

  • termsAndConditions string

    The terms and conditions for the reward program. If present, this information appears after the user enters their personal information and taps Next. The user then has the option to agree to the terms, or to cancel the signup process.

Used in:

Examples

Example Apple loyalty personalization requirements

{
  "requiredPersonalizationFields": ["name", "postalCode", "emailAddress", "phoneNumber"
  ],
  "description": "Enter your information to sign up and earn points.",
  "termsAndConditions": "Terms and conditions go here"
}

Apple Wallet template request

A complete iOS template includes template meta information, headers, and fields.

Jump to examples ↓

All of
  • Meta information about templates; this object appears on all templates and identifies templates associated with a project.

  • The iOS template headers object can contain the following objects. Each object has a formatType, fieldType, and value.

    • formatType is always 1, indicating that the value is a string.

    • fieldType is topLevel — a text or color value on the top-front of the pass, image, or barcode.

    • value is the default value for the header field.

  • Defines fields on iOS templates and subsequent passes generated from the template.

Used in:

Examples

Example Apple Wallet template request

{
  "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"
}

Google Wallet template request

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.

Jump to examples ↓

All of
  • Meta information about templates; this object appears on all templates and identifies templates associated with a project.

  • Fields on a Google pass are organized into modules. Modules define how fields on the pass are organized and appear. Fields within each module are objects with a string names.

Used in:

Examples

Example Google template request

{
  "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"
}

Optional fields for Google headers

Header objects for Google Wallet templates use many of the same keys as fields on the template/pass. Populate these keys as necessary. Template responses include these keys with their default values.

Jump to examples ↓

OBJECT PROPERTIES
  • changeMessage string

    The message that appears when you update this field.

  • hideEmpty boolean

    If true, the field is hidden if empty.

  • ignoresTimeZone boolean

    if true, the date-time value in a field on an Apple Wallet pass is not offset to account for the pass recipient’s time zone. This may be helpful for things like boarding passes or events, where your times are set local to an airport or venue and should not change based on a user’s device. When applied to a non-date-time field or a Google template, this setting is ignored.

  • label string

    In most cases, you should not set a label for a Google template header. In responses, the label is typically an empty string.

  • required boolean

    Indicates whether or not the field is required on passes created from this template.

  • textAlignment string

    The alignment of text on the pass.

    Possible values: textAlignmentLeft, textAlignmentCenter, textAlignmentRight, textAlignmentNatural

Used in:

Examples

Example Google header object with optional keys

{
  "background_color": {
    "ignoresTimeZone": null,
    "changeMessage": null,
    "label": "",
    "hideEmpty": false,
    "formatType": "String",
    "value": "#006491",
    "fieldType": "topLevel",
    "required": false
  }
}