Creating Wallet Passes
Create New Wallet Passes based on the Apple and Google json keys defined in your wallet template and send on payload the wallet pass object in JSON format and access them from a URL link.
The next step is creating a wallet pass or passes and sending on payload the wallet pass object in JSON format. That is, you can create a specified wallet pass according to the wallet template that was created or updated previously. With this call, you can also specify and add the unique values you set in the wallet template as fields, images, barcode or beacons for each wallet pass.
It should be remembered, the unique values are personalized for each pass generated. For example, the Secondary field (label) is "Name" and you want that the secondary field value of the "Name" to be personalized for each pass that is generated, which means that value will not be static for each pass to generate, so the Secondary field ("Name") must be entered in the request body in JSON format because each value of the Secondary field will be personalize for each pass created.
Before creating the wallet pass, you need to provide the unique identifier of the wallet template created.
Required Parameter | Description |
---|---|
serial | Unique identifier of the Wallet Template. |
When you create or update one or more wallet passes, the request body contains the following data according to the unique values you set when creating the wallet template:
HTTP Request : POST /wallet/templates/{serial}/passes/batch
NOTE
There are additional parameters that are not included in the example response body when creating the Wallet Template of a store card. These parameters will be included according to the pass style (event ticket, boarding pass, coupon, generic pass) the user desires to create or according to the unique values you set up when creating the wallet template.
Each parameter you set as a unique value when creating the wallet template, it is required when creating the wallet pass. For example, if you didn't set any image type as a unique value, you don't need to add the image to the request body because the image will not be unique for each wallet pass, it will be generic (static) for all generated passes. Only those parameters that are unique values (not generic) are included in the request body when creating the wallet pass as long as they were configured when the wallet template was created.
When updating the wallet template, it was included only two unique values:
"fields": [
{
"place": "SECONDARY",
"label": "Name",
"fixed": false
},
{
"place": "SECONDARY",
"label": "Last Name",
"fixed": false
}
]
But in the request body example, we added the image and barcode as unique values to help you understand the JSON format if you set more than one unique value.
{
"items": [
{
"recipientId": "123ddd20",
"uniqueValues": {
"fields": [
{
"place": "SECONDARY",
"label": "Name",
"value": "Elizabeth"
},
{
"place": "SECONDARY",
"label": "Last Name",
"value": "Smith"
}
],
"images": [
{
"name": "strip",
"url": "https://www.example.com/wp-content/uploads/example-Strip-Image-AirplaneTicket.png"
}
],
"barcode": {
"altText": "Scan the QR code to download the airplane tickets",
"content": "www.airplaneTickets22.com"
}
}
},
{
"recipientId": "135dfc97",
"uniqueValues": {
"fields": [
{
"place": "SECONDARY",
"label": "Name",
"value": "Joshua"
},
{
"place": "SECONDARY",
"label": "Last Name",
"value": "Williams"
}
],
"images": [
{
"name": "strip",
"url": "https://www.example.com/wp-content/uploads/example-Strip-Image-ConcertTicket.png"
}
],
"barcode": {
"altText": "Scan the QR code to download the concert tickets",
"content": "www.concertTickets3434.com"
}
}
}
]
}
The parameters presented in the request body example when creating the Wallet Pass are the following:
Parameter | Required | Description |
---|---|---|
items | Yes | List (array) of wallet passes that will be created. |
items.recipientId | Yes | Unique identifier of the recipient. The recipient ID must be different for each generated wallet pass. |
items.uniqueValues | Yes | Specify the unique values you set in the wallet template as fields, images, barcode or beacons for each wallet pass. |
items.uniqueValues.fields | No | Wallet Template text fields you set as unique values. If the |
items.uniqueValues.fields.place | Yes | Field type. There are 4 types of fields you can add to the wallet template according to the pass type chosen when creating the template:
|
items.uniqueValues.fields.label | Yes | Field text. |
items.uniqueValues.fields.value | Yes | Value of the field text. |
items.uniqueValues.images | No | Wallet Template images you set as unique values. If the |
items.uniqueValues.images.name | Yes | Image type. There are 8 types of images you can add to the wallet template according to the pass type chosen when creating the template:
NOTE: Each imagen must be in .png format. For more information to know what type of images you need to add to the wallet template according to the pass type, go to the Updating Wallet Template section. |
items.uniqueValues.images.url | No | URL where the image is located. By default a custom image is displayed. |
items.uniqueValues.barcode | No | Wallet Template barcode information you set as unique values. If the |
items.uniqueValues.barcode.altText | No | Text displayed below the barcode. |
items.uniqueValues.barcode.content | No | String encoded in the barcode. |
items.uniqueValues.beacons | No | List (array) of IBeacons near where the wallet pass is Relevant. The UUID, major and minor values provide the identifying information for the iBeacon. If the |
items.uniqueValues.beacons.uuid | Yes | The UUID is a standard identifying system which allows a 'unique' number to be generated for a device. The purpose of the ID is to distinguish iBeacons in your network, from all other beacons in networks outside your control. When you receive your beacons, they will all have a common proximity UUID set, which will look something like: f7826da6-4fa2-4e98-8024-bc5b71e0893e. Application developers should define a UUID specific to their app and deployment use case. Size: 16 bytes |
items.uniqueValues.beacons.major | No | Specifies a specific iBeacon and use case. For example, this could define a sub-region within a larger region defined by the UUID. That is, Major values are intended to identify and distinguish a group—for example all beacons on a certain floor or room in your venue could be assigned a unique Major value. Size: 2 bytes By default, if you don't set the major value, it will be |
items.uniqueValues.beacons.minor | No | Allows further subdivision of region or use case, specified by the application developer. That is, Minor values are intended to identify and distinguish an individual—for example distinguishing specific beacons within a group of beacons assigned a Major value. Size: 2 bytes By default, if you don't set the major value, it will be |
items.uniqueValues.beacons.text | Yes | Text to display nearby a beacon. |
When you create the Wallet Pass, the response body contains the following data:
{
"meta": {
"timestamp": 1663784641851,
"transactionId": "b947a798-e12a-414a-977f-92cf3c91817b"
},
"items": [
{
"recipientId": "135dfc97",
"url": "msgi.me/t0n111"
},
{
"recipientId": "123ddd20",
"url": "msgi.me/VNN777"
}
]
}
The parameters presented in the response body example when creating the Wallet Pass are the following:
Parameter | Description |
---|---|
items | List (array) of wallet passes created. |
recipientId | Unique identifier of the recipient. The recipient ID must be different for each generated wallet pass. |
url | URL of the wallet pass. NOTE: Copy and paste the URL into your browser to download the wallet pass that has been created. |
Updated over 1 year ago