Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Current »

The following methods describe how and why Wallet Item Added and Wallet Item Removed callback events are used, including examples.

The supported callback_types are wallet_item_install and wallet_item_remove. More information on creating callbacks can be found here. 

Wallet Callback Types

The wallet_item_install callback event is triggered when a new wallet pass is installed by an end user.

To register an endpoint to receive the wallet_item_install callback, follow the instructions below:


First you will need to create a new callback record. 

POST /companies/:company_key/config/callbacks/


Then you will need to post the following information using information from the wallet campaign that you wish to establish callbacks for, as well as the desired destination url for the callbacks. 

{   
  "callback_type": "wallet_item_install",
  "event_type": "wallet_item_install", //deprecated
  "wallet_item_install": {
    "campaign_token": "YOUR_WALLET_CAMPAIGN_TOKEN"
  },
  "destination":{
     "url":"https://YOUR.DESTINATION.URL",
     "method":"POST",
     "content_type":"application/json"
  }
}

The wallet_item_remove callback event is triggered when a wallet pass is removed by an end user.

To register an endpoint to receive the wallet_item_remove callback, you use the same instructions as the wallet_item_install, however you will want to change the callback_type to "wallet_item_remove". 

{
  "callback_type": "wallet_item_remove",
  "event_type": "wallet_item_remove",  //deprecated
  "wallet_item_install": {
    "campaign_token": "YOUR_WALLET_CAMPAIGN_TOKEN"
  },
  "destination":{
     "url":"https://YOUR.DESTINATION.URL",
     "method":"POST",
     "content_type":"application/json"
  }
}

If successful, you will receive the following callback body indicating the start date, created at date, as well as the callback_id. Callback Body


 {
        "callback_id": 11887,
        "callback_type": "wallet_item_install",
        "event_type": "wallet_item_install", //deprecated
        "wallet_item_install": {
            "campaign_token": "r3zhm8"
        },
        "destination": {
            "url": "http://destination.url",
            "method": "POST",
            "content_type": "application/json"
        },
        "start_date": "2018-04-25T20:00:00Z",
        "url": "/companies/ba9bcNKc/config/callbacks/11887",
        "created_at": "2018-04-27T21:37:09Z",
        "updated_at": "2018-04-27T21:37:09Z"
 }

Wallet Item Install Callback Event

This callback event is triggered when a new Wallet item has been installed for a given campaign. This data will be sent to whichever url was specified in the initial callback registration. 

{
  {
  "event_id": "5725c57e-f4bf-47e3-8b1f-6b47e532157a",
  "event_type": "wallet_item_install", //deprecated
  "event_date": "2018-05-07T15:27:33.664Z",
  "delivery_attempt":"1",
  "wallet_instance": {
    "registered_at": "2017-01-14T14:30Z",
    "unregistered_at": NULL,
    "wallet_instance_uid": "ec5035b8-349d-47e4-aef1-21bef2220c26",
    "provider": "google"
  },
  "wallet_item": {
    "uuid": "item-uuid",
    "wallet_object_uid": "j8hddfgu65-349d-47e4-aef1-5ujdf2220c26",
    "expiration_date": "2017-01-14T14:30Z",
    "tokens": {
      "first_name": "Calrissian"
    },
    "url": "/companies/bi3bwNRk/campaigns/wallet/r3zhm8/items/item-uuid"
  },
  "wallet_campaign": {
    "wallet_campaign_uid": "cc2ba6ca-557f-4335-9df0-ee5d3c541d0a",
    "token": "r3zhm8",
    "url": "/companies/bi3bwNRk/campaigns/wallet/r3zhm8/"
  }
}


Wallet Item Remove Callback Event

This callback event is triggered when a new Wallet item has been removed for a given campaign. 


{
  "event_id": "5725c57e-f4bf-47e3-8b1f-6b47e532157a",
  "callback_type": "wallet_item_remove",
  "event_type": "wallet_item_remove", //deprecated
  "event_date": "2018-05-07T15:27:33.664Z",
  "delivery_attempt":"1",
  "wallet_instance": {
    "registered_at": "2017-01-14T14:30Z",
    "unregistered_at": "2018-01-14T14:30Z",
    "wallet_instance_uid": "ec5035b8-349d-47e4-aef1-21bef2220c26",
    "provider": "google"
  },
  "wallet_item": {
    "uuid": "item-uuid",
    "wallet_object_uid": "j8hddfgu65-349d-47e4-aef1-5ujdf2220c26",
    "expiration_date": "2017-01-14T14:30Z",
    "tokens": {
      "first_name": "Calrissian"
    },
    "url": "/companies/bi3bwNRk/campaigns/wallet/r3zhm8/items/item-uuid"
  },
  "wallet_campaign": {
    "wallet_campaign_uid": "cc2ba6ca-557f-4335-9df0-ee5d3c541d0a",
    "token": "r3zhm8",
    "url": "/companies/bi3bwNRk/campaigns/wallet/r3zhm8/"
  }
}

For information on how to register your endpoint to receive callbacks, see Callback Configuration

Additional Resources

  • No labels