Distribution webhooks

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

  1. In Voucherify dashboard, go to Distributions in the Engagement section.
  2. Click Create distribution.
  3. Select the appropriate trigger that creates a sendout.
  4. In Action, define what kind of distribution action you want to create.
  5. In Channels, add Webhook. You can add many channels within one distribution.
  6. In the webhook channel, provide the event name, URL, and any optional HTTP headers.
  7. 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:

  1. Go to the Distribution Manager.
  2. Click the distribution that has been paused.
  3. 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 ActivityEventNotify customers about promotionSend and publish unique codes from campaignSend plain message to customers
SegmentCustomer entered segment
SegmentCustomer left segment
CartOrder update
CartOrder has been paid
CartOrder creation
CartOrder cancelled
VoucherGift credits adjusted
VoucherLoyalty points adjusted
VoucherLoyalty points expired
VoucherLoyalty pending points adjusted
VoucherLoyalty pending points updated
VoucherLoyalty pending points activated
VoucherLoyalty pending points canceled
VoucherVoucher redeemed
VoucherVoucher redemption rolledback
Customer rewardsReward redemption
Manual messagesOne or bulk messages
Publishing codesSuccessfully published
Custom eventsCustom event
Loyalty tier related activityCustomer entered loyalty tier structure
Loyalty tier related activityCustomer left loyalty tier structure
Loyalty tier related activityCustomer loyalty tier upgraded
Loyalty tier related activityCustomer loyalty tier downgraded
Loyalty tier related activityCustomer loyalty tier prolonged
Loyalty tier related activityCustomer rewarded loyalty points
Referral related activityCustomer was referred

Loyalty and referral campaign Distributions

The following campaigns can also trigger webhook sendouts as a distribution:

Distribution webhook payload

AttributesDescription
id
string

Unique identifier of the sendout for this webhook.

Example:

whs_0e16e42bc6e0c65b57

project_id
string

Unique identifier of the Voucherify project.

Example:

proj_5T4Rpl4T1nuM

created_at
string

The exact moment when the webhook was created.

Example:

2024-01-01T11:11:11.111Z

type
string

Displays the name entered in the Event name field in the distribution creator.

data
object

Payload depends on the event that triggered the webhook sendout. Distributions cover the following events:

source
object

Contains details about the source of the webhook sendout.

AttributesDescription
id
string

Unique identifier of the distribution that sent the webhook.

Example:

distr_TrJj0lHV44EMt6HvLa2pyNlHTF

object
string

Determines the type of the object.

Available values: distribution
Example:

distribution

target_url
string

The address where the webhook is be sent.

event
object

Contains other data of the event that triggered the sendout.

AttributesDescription
id
string

Unique identifier of the event that triggered the sendout.

Example:

evred_1f3611301g3127begb

type
string

Determines the type of the event.

Example:
  • customer.custom_event
  • customer.loyalty.tier.downgraded
  • customer.loyalty.tier.joined
  • customer.loyalty.tier.leftd
  • 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.points_added
  • customer.voucher.loyalty_card.points_expired
  • loyalty_card.pending_points.updated
  • manual_distribution_schedule
created_at
string

The exact moment when the event was created.

Example:

2024-01-01T11:11:11.111Z

entity_id
string

Unique identifier of the entity that triggered the sendout.

Example:

r_1f3611302bf107befb

group_id
string

Unique identifier of the request that triggered the event.

Example:

v-1f36113948e50fc4ge

event_source
object

Contains the source of the object that triggered the sendout.

AttributesDescription
channel
string

Determines the channel that triggered the sendout.

Available values: USER_PORTAL, API, CLIENT_API, INTERNAL
Example:

API

user
string

Defines the user who triggered the event.

api_key
object

Determines the API key used to initiate the sendout.

AttributesDescription
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