Configuring Distribution webhooks
- In Voucherify dashboard, go to Distributions in the Engagement section.
- Click Create distribution.
- Select the appropriate trigger that creates a send out.
- 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.
Payload designer
In the default mapping mode, Voucherify sends the full webhook payload without any mapping to other keys. Click Custom to use the payload designer and create webhook payloads in the JSON format. The Payload designer is empty at the start. You can paste any existing payload or write it from scratch. Each key in the payload can have a value that is static, dynamic, or nested:- Static values are fixed values you define, such as text, numbers, or boolean.
- Dynamic values come from Voucherify keys in the webhook payload. Use double curly braces
{{}}to search for Voucherify keys. You can also mix static and dynamic values, for example"Hello {{customer.name}}". - Nested objects can be created with dots in the key name, such as
{{order.status}}.
(""). When the type of a value is unknown, also wrap it in quotes ("") to ensure it is treated as a string.
📘 Available Voucherify webhook keys The available keys supported by Voucherify are limited to a given distribution event that is used in the webhook. For example, if you create a webhook payload for the Customer entered segment, you can use all the keys available in that event, likecustomer.nameorsegment.name. However, you can’t use objects that aren’t available in that webhook, likeredemption.date. Read Webhooks available in Distributions to learn which webhooks are available. Go to specific webhook pages to learn more about their payloads.
Example: Customer summary with dynamic values
This payload builds a customer summary. All values are taken dynamically from the webhook.Example: Order confirmation with mixed values
This payload mixes static and dynamic values. The currency is fixed, while the order details and greeting come from Voucherify.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
| 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 rolled back | ❌ | ❌ | ✅ |
| 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 send outs as a distribution:- Loyalty campaigns:
-
Referral campaigns:
- Send referral code to the referrer
- Customer referred (documentation in progress)
Distribution webhook payload
The list shows a general structure of a webhook payload set in Distributions. Indented bullet points mean that an object contains further properties or objects.The list shows the complete, unedited payload. If you customize it with the Payload editor, your data may include fewer fields.
id(string): Unique identifier of the send out for this webhook. Example:whs_0e16e42bc6e0c65b57project_id(string): Unique identifier of the Voucherify project. Example:proj_5T4Rpl4T1nuMcreated_at(string): The exact moment when the webhook was created. Example:2024-01-01T11:11:11.111Ztype(string): Displays the name entered in theEvent namefield in the distribution creator.data(object): Payload depends on the event that triggered the webhook send out. Distributions cover the following events:- customer.custom_event
- customer.loyalty.tier.downgraded
- customer.loyalty.tier.joined
- customer.loyalty.tier.left
- customer.loyalty.tier.prolonged
- customer.loyalty.tier.upgraded
- customer.order.canceled
- customer.order.created
- customer.order.paid
- customer.order.updated
- customer.publication.succeeded
- customer.redemption.rollback.succeeded
- customer.redemption.succeeded
- customer.referred
- customer.reward_redemptions.completed
- customer.rewarded
- customer.rewarded.loyalty_points
- customer.segment.entered
- customer.segment.left
- customer.voucher.gift.balance_added
- customer.voucher.loyalty_card.pending_points.activated
- customer.voucher.loyalty_card.pending_points.added
- customer.voucher.loyalty_card.pending_points.canceled
- customer.voucher.loyalty_card.pending_points.updated
- customer.voucher.loyalty_card.points_added
- customer.voucher.loyalty_card.points_expired
- manual_distribution_schedule
source(object): Contains details about the source of the webhook send out. Properties:id(string): Unique identifier of the distribution that sent the webhook. Example:distr_TrJj0lHV44EMt6HvLa2pyNlHTFobject(string): Determines the type of the object. Available values:distributionExample:distributiontarget_url(string): The address where the webhook will be sent.
event(object): Contains other data of the event that triggered the send out. Properties:id(string): Unique identifier of the event that triggered the send out. Example:evred_1f3611301g3127begbtype(string): Determines the type of the event. Example:customer.custom_eventcustomer.loyalty.tier.downgradedcustomer.loyalty.tier.joinedcustomer.loyalty.tier.leftcustomer.loyalty.tier.prolongedcustomer.loyalty.tier.upgradedcustomer.order.canceledcustomer.order.createdcustomer.order.paidcustomer.order.updatedcustomer.publication.succeededcustomer.redemption.rollback.succeededcustomer.redemption.succeededcustomer.referredcustomer.reward_redemptions.completedcustomer.rewardedcustomer.rewarded.loyalty_pointscustomer.segment.enteredcustomer.segment.leftcustomer.voucher.gift.balance_addedcustomer.voucher.loyalty_card.pending_points.activatedcustomer.voucher.loyalty_card.pending_points.addedcustomer.voucher.loyalty_card.pending_points.canceledcustomer.voucher.loyalty_card.points_addedcustomer.voucher.loyalty_card.points_expiredloyalty_card.pending_points.updatedmanual_distribution_schedule
created_at(string): The exact moment when the event was created. Example:2024-01-01T11:11:11.111Zentity_id(string): Unique identifier of the entity that triggered the send out. Example:r_1f3611302bf107befbgroup_id(string): Unique identifier of the request that triggered the event. Example:v-1f36113948e50fc4geevent_source(object): Contains the source of the object that triggered the send out. Properties:channel(string): Determines the channel that triggered the send out. Available values:USER_PORTAL,API,CLIENT_API,INTERNALExample:APIuser(string): Defines the user who triggered the event.api_key(object): Determines the API key used to initiate the send out.name(string): Channel name in the application keys.app_id(string): Contains the application ID from the Voucherify API key pair. Example:1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX
Customer voucher redeemed example

