Distribution-based webhooks in Voucherify let your application automatically receive notifications related to distribution events. They help you track the results of distributions and quickly respond when certain actions occur. For example, your application can be notified when a voucher is successfully published, a scheduled campaign message is delivered, or when a customer enters or leaves a specific customer segment.
Configuring Distribution webhooks
- In Voucherify dashboard, go to Distributions in the Engagement section.
- Click Create distribution.
- Select the appropriate trigger that creates a sendout.
- In Action, define what kind of distribution action you want to create.
- In Channels, add Webhook. You can add many channels within one distribution.
- In the webhook channel, provide the event name, URL, and any optional HTTP headers.
- Select the attributes to add them to the webhook payload. Optionally, map the attributes to your own keys.
To edit, pause, activate, or delete a distribution, click the three dots icon located on the far right of each row in the Distributions list view.
You can also add distribution webhooks while creating a loyalty or referral programs. The process follows similar pattern.
Re-enabling a webhook
To re-enable a paused webhook:
- Go to the Distribution Manager.
- Click the distribution that has been paused.
- Click the set live icon in the upper right corner.
Webhooks available in Distributions
These webhooks are triggered by the events which cause distribution.
Some distribution events, for example Customer entered segment, have different purposes:
- Notify customers about promotion
- Send and publish unique codes from campaign
- Send plain message to customers
The table below shows which distributions support webhooks:
Related Activity | Event | Notify customers about promotion | Send and publish unique codes from campaign | Send plain message to customers |
---|---|---|---|---|
Segment | Customer entered segment | ✅ | ✅ | ✅ |
Segment | Customer left segment | ✅ | ✅ | ✅ |
Cart | Order update | ✅ | ✅ | ✅ |
Cart | Order has been paid | ✅ | ✅ | ✅ |
Cart | Order creation | ✅ | ✅ | ✅ |
Cart | Order cancelled | ✅ | ✅ | ✅ |
Voucher | Gift credits adjusted | ❌ | ❌ | ✅ |
Voucher | Loyalty points adjusted | ❌ | ❌ | ✅ |
Voucher | Loyalty points expired | ❌ | ❌ | ✅ |
Voucher | Loyalty pending points adjusted | ❌ | ❌ | ✅ |
Voucher | Loyalty pending points updated | ❌ | ❌ | ✅ |
Voucher | Loyalty pending points activated | ❌ | ❌ | ✅ |
Voucher | Loyalty pending points canceled | ❌ | ❌ | ✅ |
Voucher | Voucher redeemed | ❌ | ❌ | ✅ |
Voucher | Voucher redemption rolledback | ❌ | ❌ | ✅ |
Customer rewards | Reward redemption | ❌ | ❌ | ✅ |
Manual messages | One or bulk messages | ✅ | ✅ | ❌ |
Publishing codes | Successfully published | ❌ | ❌ | ✅ |
Custom events | Custom event | ✅ | ✅ | ✅ |
Loyalty tier related activity | Customer entered loyalty tier structure | ❌ | ❌ | ✅ |
Loyalty tier related activity | Customer left loyalty tier structure | ❌ | ❌ | ✅ |
Loyalty tier related activity | Customer loyalty tier upgraded | ❌ | ❌ | ✅ |
Loyalty tier related activity | Customer loyalty tier downgraded | ❌ | ❌ | ✅ |
Loyalty tier related activity | Customer loyalty tier prolonged | ❌ | ❌ | ✅ |
Loyalty tier related activity | Customer rewarded loyalty points | ❌ | ❌ | ✅ |
Referral related activity | Customer was referred | ❌ | ❌ | ✅ |
- Custom events:
- Segment related activities:
- Manual messages:
- Notify customers about promotion – covered by the MANUAL_DISTRIBUTION_SCHEDULE event
- Send and publish unique codes from a campaign – covered by the MANUAL_DISTRIBUTION_SCHEDULE event
- Send a plain message to customers – does not support webhooks as a distribution channel
- Cart related activities:
- Publishing codes:
- Voucher related activities:
- Customer rewards:
- Loyalty tier related activities:
- Referral related activities:
- Customer was referred
Loyalty and referral campaign Distributions
The following campaigns can also trigger webhook sendouts as a distribution:
- Loyalty campaigns:
- Referral campaigns:
- Send referral code to the referrer
- Customer referred (documentation in progress)
Distribution webhook payload
Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
idstring | Unique identifier of the sendout for this webhook. Example:whs_0e16e42bc6e0c65b57 | ||||||||||||||||||||||||||||
project_idstring | Unique identifier of the Voucherify project. Example:proj_5T4Rpl4T1nuM | ||||||||||||||||||||||||||||
created_atstring | The exact moment when the webhook was created. Example:2024-01-01T11:11:11.111Z | ||||||||||||||||||||||||||||
typestring | Displays the name entered in the | ||||||||||||||||||||||||||||
dataobject | Payload depends on the event that triggered the webhook sendout. Distributions cover the following events:
| ||||||||||||||||||||||||||||
sourceobject | Contains details about the source of the webhook sendout.
| ||||||||||||||||||||||||||||
eventobject | Contains other data of the event that triggered the sendout.
|