Skip to main content
Here are some examples of working with webhooks in Engage.

1 - Contact preferences

A contact’s preferences are what tells you if the contact has agreed to receive marketing information by email, SMS, post, or not at all. The three preferences in use in Engage are:
  • acceptsEmail
  • acceptsSms
  • acceptsPostal
As a retailer, you will often need to show the contact preferences for a contact, on My Pages or at the checkout, and you need to be sure the values shown are correct. Since Engage is the master of these settings, the preferences will either have to be fetched every time they are needed, or some system needs to be put in place to constantly poll Engage for the current values. This is not very efficient. It’s better to use a webhooks solution, as described above. In this case, the client creates a webhook for the systems they want to keep updated about contact preference changes. Then, whenever a preference is changed in Engage, the webhook is used to inform all the subscribed external systems, keeping them all in sync with Engage. The webhooks available for syncing of contact preferences are:
  • contact.acceptsEmail.changed - This is triggered whenever the acceptsEmail preference changes.
  • contact.acceptsSms.changed - This is triggered whenever the acceptsSms preference changes.
  • contact.acceptsPostal.changed - This is triggered whenever the acceptsPostal preference changes.
The webhooks for contact preferences are only triggered for already existing contacts. They will not be triggered when a contact is created. Be aware of the legal requirements mentioned above when working with webhooks.

2 - Points and vouchers

There are three webhooks available for syncing of points and vouchers in Engage:
  • loyalty.addPoints - Triggered when points are added to a contact via the Engage UI or through an automation. The transaction is sent in the webhook. This is only for customers using the point follower solution.
  • point.balance.updated - Triggered whenever a contact’s point balance is changed.
  • reward.voucher.created - Triggered when a new reward voucher is created for a contact.
Payload structure for loyalty.addPoints
{
  "eventType": String,
  "id": String,
  "isEncrypted": Boolean,
  "payload": : {
    "amount": Decimal,
    "contactId": String,
    "pointDefinitionId": Int,
    "source": String,
    "description": String,
    "userId": String,
    "userName": String,
    "reason": String,
    "sourceId": String,
  },
  "tenant": String
}
Payload structure for point.balance.updated
{
  "eventType": String,
  "id": String,
  "isEncrypted": Boolean,
  "payload": : {
    "balance": Decimal,
    "contactId": String,
    "accountId": Int,
    "definitionId": String,
    "balanceExpires": DateTimeOffset
  },
  "tenant": String
}
Payload structure for reward.voucher.created
{
  "eventId": String,
  "eventType": String,
  "isEncrypted": Boolean,
  "payload": {
    "Amount": Decimal,
    "ContactId": String,
    "Currency": String,
    "Id": String,
    "UniqueCode": String,
    "ValidFrom": DateTimeOffset,
    "ValidTo": DateTimeOffset
  },
  "tenant": String
}