Create a wallet message

To send messages to your wallet item users, you can create a wallet message using the public APIs and a POST method. Note that the message will begin being sent to targeted end users immediately after it is created.

📱

OS limitations

Messages based on location (Latitude/Longitude) can be sent for Apple and Android, but time-based notifications can only be sent for Apple.

Request

Define the relevant fields in the body of your request. In the filters element, you can define which wallet users will receive the message. Skip to the filter fields section to learn more about filtering.

Note that the created_at, updated_at, url, and wallet_message_id fields are system generated. Any values specified in the request will be ignored.

Response

Upon a successful request, a wallet message entity will be returned, along with an HTTP 200 status code.

If the wallet_id does not exist, an HTTP – NOT FOUND error will be returned.

Filter Field Options

First class field filter

See the first-class fields guide to get more information on how first-class fields work.

SelectorValueExample
anyString{ "name" : "first_class_field", "field_name": "first_name", "selector" : "any", "value" : ["Your Name"] }`
starts_withString{ "name" : "first_class_field", "field_name": "last_name", "selector" : "starts_with", "value" : "R" }

The loyalty_balance first-class field supports comparison of float values.

SelectorValueExample
=, <, <=, > , >=String{"name" : "first_class_field", "field_name" : "loyalty_balance", "selector" : ">=", "value" : 100.5 }
betweenString{"name" : "first_class_field", "field_name" : "loyalty_balance", "selector" : "between", "value" : [1,10] }

Group code filter

SelectorValueExample
anyString{ "name" : "group_code", "selector" : "any", "value" : "code1" }
starts_withString{ "name" : "group_code", "selector" : "starts_with", "value" : "code1" }

Provider filter

SelectorValueExample
anyArray. Possible values are: "passbook" or "google"{ "name" : "provider", "selector" : "any", "value" : ["passbook", "google"] }

Example date filter

Notes for Time:

  • ISO8601 format is required. The filter expects an expiration date with a date, time and offset information. Any offset can be used.
  • "on" selector is equivalent to between: [expiration_date (beginning of day), expiration_date (end of day)].
SelectorValueExample
beforeString. Date in ISO8601 format with offset.{"name": "expiration_date", "selector": "before", "value": "2017-10-25T10:20:30-06:00"}
afterString. Date in ISO8601 format with offset.{"name": "expiration_date", "selector": "after", "value": "2017-10-25T10:20:30-06:00"}
betweenArray. 2 dates in ISO8601 format with offset.{"name": "expiration_date", "selector": "between", "value": ["2017-10-24T10:20:30-06:00", "2017-10-25T10:20:30-06:00"]}
onString. Date in ISO8601 with offset{"name": "expiration_date", "selector": "on", "value": "2017-10-25T10:20:30-06:00"}
Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!