Stay organized with collectionsSave and categorize content based on your preferences.
Partner Triggered Notifications
Add Message and Notify
Background
After a user adds a pass you may want to send them a message related to the
pass and ensure they are notified about it. Using theAdd Message APIrequest with amessage_typeequal toTEXT_AND_NOTIFYthe following occurs:
A "Message"
item is added to the "back of pass" (akaDetails
Template) and a push notification is sent to users with the pass saved.
Once the user taps the notification it opens Google Wallet to the front of
the pass (a.k.a. Card view) and the user will see a callout at the top of the
screen with a "View Message" button.
Clicking the callout will take users to the back of the pass, where new
unread messages are highlighted.
Some considerations when sending messages with notifications to users
Users must have notifications enabled for their passes to receive the
push notifications related to messages.
Messages may contain URIs to your website or app. Hyperlinks must be a
website or app related to the pass. It is a violation of theAcceptable Use Policyto send users to links not related to the pass.
You may send a maximum of 3 messages that trigger a push notification in a
24 hour period. Google may throttle your push notification delivery quota if it
deems you are spamming your users.
The push notification users see on their lock screen is controlled by Google
Wallet.
You can use theUPDATEorPATCHmethods to edit or remove message data using the regular class or object
endpoint.
Integration Steps
When you want to notify users about a new issuer message added using the
AddMessage API, you will need to update theAddMessageRequestso that theMessagewhich contains your new text has theMessageTypeTEXT_AND_NOTIFYinstead ofTEXT.
Example JSON Request to add message and notify in a Passes Class
ExampleResponseto add message and notify for a Pass Class
// The updated resource…{"kind":"walletobjects#walletObjectMessage","header":"My Object message header","body":"My Object message body with a <a href="http://play.google.com/store/apps/details?id=com.google.android.apps.maps">Hyperlink<\a>","id":"message_id","messageType":"textAndNotify"},…
Exception handling
Any attempts to notify more than 3 times will yield aQuotaExceededExceptionresponse. Any further updates to the
pass can be set using "TEXT" instead of
"TEXT_AND_NOTIFY" as discussed in theIntegration
Steps.
Nearby Notifications
This feature will show users who have enabled notifications and granted precise, always on location access to the Google
Wallet app a push notification reminding them that they have saved a pass relevant to their
current location.
Integration Steps
How to use
To use this feature, you need to add locations to your classes and objects. You can add up to 10
locations per class and 10 per object. UseMerchantLocationsin your class or object
definition. You can add these locations when you use theinsert,patch,
orupdatemethods.
After you add locations to a class or object, Google will send notifications to users when they
are nearby. Google decides how close a user needs to be and how long they need to stay in the area
before the notification is sent. Google also controls the text of the notification.
An example of a LoyaltyClass with the MerchantLocations set:
Users should get a sticky notifications about their passes when they are at one of the specified MerchantLocations.
If they click the notification, it will open their pass in Google Wallet.
Users can dismiss the notification with the swipe gesture. When a user leaves the location, the notification will disappear.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[[["\u003cp\u003eSending messages with \u003ccode\u003eTEXT_AND_NOTIFY\u003c/code\u003e adds a message to the pass details and triggers a push notification, opening Google Wallet upon tap.\u003c/p\u003e\n"],["\u003cp\u003eUsers must have notifications enabled to receive pass-related push notifications, and messages should contain relevant hyperlinks.\u003c/p\u003e\n"],["\u003cp\u003eA maximum of 3 notification-triggering messages can be sent within a 24-hour period to avoid throttling by Google.\u003c/p\u003e\n"],["\u003cp\u003eMessages can be edited or removed using \u003ccode\u003eUPDATE\u003c/code\u003e or \u003ccode\u003ePATCH\u003c/code\u003e methods, and exceeding the notification limit results in a \u003ccode\u003eQuotaExceededException\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `AddMessage` API, with `message_type` set to `TEXT_AND_NOTIFY`, allows sending messages and push notifications to users who have saved a pass. This action adds a message to the pass's back, sends a notification, and displays a \"View Message\" callout on the pass's front view in Google Wallet. Tapping the callout navigates to the back, highlighting new messages. It is possible to set hyperlinks. Users need notifications enabled, and there's a limit of three notifications within 24 hours, attempting more will yield a QuotaExceededException.\n"],null,["Partner Triggered Notifications\n\nAdd Message and Notify\n\nBackground\n\nAfter a user adds a pass you may want to send them a message related to the\npass and ensure they are notified about it. Using the [Add Message API](/wallet/retail/offers/rest/v1/offerclass/addmessage)\nrequest with a `message_type` equal to\n**`TEXT_AND_NOTIFY`** the following occurs:\n\n1. A \"[Message](https://developers.google.com/wallet/reference/rest/v1/Message)\" item is added to the \"back of pass\" (aka [Details\n Template](/wallet/retail/offers/resources/template#details-template)) and a push notification is sent to users with the pass saved.\n2. Once the user taps the notification it opens Google Wallet to the front of the pass (a.k.a. Card view) and the user will see a callout at the top of the screen with a \"View Message\" button.\n3. Clicking the callout will take users to the back of the pass, where new unread messages are highlighted.\n\nSome considerations when sending messages with notifications to users\n\n- Users must have notifications enabled for their passes to receive the push notifications related to messages.\n- Messages may contain URIs to your website or app. Hyperlinks must be a website or app related to the pass. It is a violation of the [Acceptable Use Policy](https://payments.developers.google.com/terms/aup) to send users to links not related to the pass.\n- You may send a maximum of 3 messages that trigger a push notification in a 24 hour period. Google may throttle your push notification delivery quota if it deems you are spamming your users.\n- The push notification users see on their lock screen is controlled by Google Wallet.\n- You can use the [UPDATE](/wallet/retail/offers/rest/v1/offerclass/update) or [PATCH](/wallet/retail/offers/rest/v1/offerclass/patch) methods to edit or remove message data using the regular class or object endpoint.\n\nIntegration Steps\n\nWhen you want to notify users about a new issuer message added using the\nAddMessage API, you will need to update the [AddMessageRequest](https://developers.google.com/wallet/reference/rest/v1/AddMessageRequest)\nso that the [Message](https://developers.google.com/wallet/reference/rest/v1/Message)\nwhich contains your new text has the [MessageType](https://developers.google.com/wallet/reference/rest/v1/Message#MessageType)\n**TEXT_AND_NOTIFY** instead of **TEXT**.\n\nExample JSON Request to add message and notify in a Passes Class \n\n```carbon\n ...\n \"id\": ISSUER_ID.CLASS_ID\",\n \"message\":\n {\n \"header\":\"My Class message header\",\n \"body\": \"My Class message body with a \u003ca href=\"https://wallet.google\"\u003eHyperlink\u003c\\a\u003e\",\n \"id\": \"message_id\",\n \"message_type\": \"TEXT_AND_NOTIFY\"\n },\n ...\n```\n\nExample JSON Request to add message and notify in a Passes Object \n\n```carbon\n ...\n \"id\": OBJECT_ID\",\n \"classId\": \"ISSUER_ID.CLASS_ID\",\n \"message\":\n {\n \"header\":\"My Object message header\",\n \"body\": \"My Object message body with a \u003ca href=\"http://play.google.com/store/apps/details?id=com.google.android.apps.maps\"\u003eHyperlink\u003c\\a\u003e\",\n \"id\": \"message_id\",\n \"message_type\": \"TEXT_AND_NOTIFY\"\n },\n ...\n```\n\nExample [Response](/wallet/retail/offers/rest/v1/offerclass/addmessage#response-body) to add message and notify for a Pass Class \n\n```scilab\n // The updated resource\n …\n {\n \"kind\": \"walletobjects#walletObjectMessage\",\n \"header\": \"My Object message header\",\n \"body\": \"My Object message body with a \u003ca href=\"http://play.google.com/store/apps/details?id=com.google.android.apps.maps\"\u003eHyperlink\u003c\\a\u003e\",\n \"id\": \"message_id\",\n \"messageType\": \"textAndNotify\"\n },\n …\n```\n\nException handling\n\nAny attempts to notify more than 3 times will yield a\n**QuotaExceededException** response. Any further updates to the\npass can be set using \"**TEXT** \" instead of\n\"**TEXT_AND_NOTIFY** \" as discussed in the [Integration\nSteps](#add-message-and-notify-integration-steps).\n\nNearby Notifications This feature will show users who have enabled notifications and granted precise, always on location access to the Google Wallet app a push notification reminding them that they have saved a pass relevant to their current location. \n\nIntegration Steps\n\nHow to use\n\nTo use this feature, you need to add locations to your classes and objects. You can add up to 10\nlocations per class and 10 per object. Use `MerchantLocations` in your class or object\ndefinition. You can add these locations when you use the `insert`, `patch`,\nor `update` methods.\n\nAfter you add locations to a class or object, Google will send notifications to users when they\nare nearby. Google decides how close a user needs to be and how long they need to stay in the area\nbefore the notification is sent. Google also controls the text of the notification.\nAn example of a LoyaltyClass with the MerchantLocations set: \n\n```text\n{\n \"kind\": \"walletobjects#loyaltyClass\",\n \"programLogo\": {\n \"kind\": \"walletobjects#image\",\n \"sourceUri\": {\n \"uri\":\n ...\n }\n },\n \"localizedProgramName\": {\n \"kind\": \"walletobjects#localizedString\",\n \"defaultValue\": {\n \"kind\": \"walletobjects#translatedString\",\n \"language\": \"en\",\n \"value\": \"Program Name\",\n }\n },\n \"id\": Id1234,\n \"version\": \"1\",\n \"allowMultipleUsersPerObject\": true,\n \"reviewStatus\": \"underReview\",\n \"enableSmartTap\": false,\n \"localizedIssuerName\": {\n \"kind\": \"walletobjects#localizedString\",\n \"defaultValue\": {\n \"kind\": \"walletobjects#translatedString\",\n \"language\": \"en\",\n \"value\": \"Issuer Name\"\n }\n },\n \"multipleDevicesAndHoldersAllowedStatus\": \"multipleHolders\",\n \"merchantLocations\": [\n {\n \"latitude\": 37.79020867928078,\n \"longitude\": -122.39004\n },\n {\n \"latitude\": 37.42587,\n \"longitude\": -122.08620\n },\n ]\n}\n```\n\nExpected Behavior\n\nUsers should get a sticky notifications about their passes when they are at one of the specified MerchantLocations.\nIf they click the notification, it will open their pass in Google Wallet.\nUsers can dismiss the notification with the swipe gesture. When a user leaves the location, the notification will disappear."]]