> ## Documentation Index
> Fetch the complete documentation index at: https://voucherify-pz-test.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks v2024-01-01

> The v2024-01-01 webhook version can be used to inform your system about various events that are triggered in Voucherify. The v2024-01-01 webhooks work for  and events listed in the .

The v2024-01-01 webhooks (both for distributions and project settings) share the same data structure, consisting of the following keys:

* `id`
* `project_id`
* `created_at`
* `type`
* `data`
* `source`
* `event`

The values for the `type` and `data` depend on the event that triggers the webhook. Go to [Project Setting Webhook Payload](#project-setting-webhook-payload) and [Distribution Webhook Payload](#distribution-webhook-payload) to learn more about their payloads.

## Configuring v2024-01-01 Webhooks

1. In Voucherify dashboard, go to Project settings.

2. Scroll down to the Webhooks section.

3. Click the plus button – Add new webhook.

4. Choose v2024-01-01 webhook version.

5. Provide the following details:

   1. Enter the target URL.
   2. Tick the Is active? checkbox.
   3. Select the [events](#webhooks-available-in-project-settings "Project setting webhooks") you want to receive. If you want to receive all the events, choose Send me all events option.
   4. Click Send test webhook to test your configuration (optional).
   5. Click Create endpoint.

6. If necessary for authentication reasons, enter the Secret key in your system to receive webhooks from Voucherify.

You can add multiple webhooks to your projects following the steps above.

To update webhook details, click the Pencil button – edit. Enter your changes and click Update endpoint.

To delete a webhook, click the Trash button and click Delete.

### Get Notified About Failed Sendouts

You can set up notifications to inform you via email or in the app that a webhook did not reach the destination.

Go to the Notification Center > Account Settings and scroll down to Webhook callout notifications to configure notifications.

## Audit log

You can check details about a webhook sendout. In Voucherify dashboard, go to Audit log and Webhook sendouts tab.

The Audit Log includes the following details:

* Webhook status
* Webhook type
* Webhook ID
* Source
* Target URL
* Request ID
* Event created at
* Executed at
* Complete webhook data (three dot menu on the right > Show data)

You can also send a failed webhook again. Go to the three dot menu on the right > Retry.

## Responding to Webhooks

Voucherify expects your webhook to return a response with a `2XX` HTTP status code, indicating that the webhook has been received successfully. If a webhook is not successfully received for any reason, Voucherify will continue trying to send the webhook in the following intervals:

| **Re-try No.** | **Time since the initial attempt** | **Interval to next re-try** |
| -------------- | ---------------------------------- | --------------------------- |
| 1              | 1 min                              | 1 min                       |
| 2              | 2 min                              | 2 min                       |
| 3              | 4 min                              | 4 min                       |
| 4              | 8 min                              | 8 min                       |
| 5              | 16 min                             | 16 min                      |
| 6              | 32 min                             | 32 min                      |
| 7              | 1 h 4 min                          | 1 h 4 min                   |
| 8              | 2 h 8 min                          | 2 h 8 min                   |
| 9              | 4 h 16 min                         | 4 h 16 min                  |
| 10             | 8 h 32 min                         | 8 h 32 min                  |
| 11             | 17 h 4 min                         | 17 h 4 min                  |
| 12             | 24 h                               | Final re-try                |

<Warning>
  Your endpoint must return a response in under 10 seconds; otherwise, it will be considered an error.
</Warning>

<Info>
  * Project-level webhooks that are set in Project Settings are disabled after 12 unsuccessful tries.
  * Distribution-based webhooks that are set up as channels in the Distributions manager are paused after 12 unsuccessful tries.
</Info>

## Re-Enabling a Webhook

### Project-Level Webhook

To re-enable a disabled webhook:

1. In the Project Settings, go to the General tab.
2. Scroll down to the Webhooks section.
3. Edit the specific Webhook.
4. Click Is active.
5. Click Update endpoint.

### Distribution-Based 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.

## Authentication

Once your server is configured to receive payloads, it will listen for any payload sent to the endpoint you configured. For security reasons, you may want to limit requests to those coming from Voucherify. To do so, you should copy a secret token and validate the information.

You can generate a secret key in the Project Settings in the Webhooks section.

Each webhook sent from Voucherify contains the `x-voucherify-signature` of the webhook in the header field.

Then, you can validate the signature by reconstructing it and comparing it to the one sent in the webhook header field.

Reconstruct it using the keyed-hash message authentication code HMAC. It is built with the cryptographic hash function **sha256** and the secret cryptographic key taken from the Project settings.

See the following examples for Java and the `verifySignature` method in the [NodeJS SDK](https://github.com/voucherifyio/voucherify-nodejs-sdk/blob/c63f738c5a53ecb9a5006a04d80d612ee70bdeae/src/utils.js#L102).

<CodeGroup>
  ```java Java
  import java.security.InvalidKeyException;
  import java.security.NoSuchAlgorithmException;
  import javax.crypto.Mac;
  import javax.crypto.spec.SecretKeySpec;
  import java.nio.charset.StandardCharsets;

  class HelloWorld {

      public static void main(String[] args)  throws InvalidKeyException, NoSuchAlgorithmException {
          byte[] secretKey = "secretKey".getBytes(StandardCharsets.UTF_8);

          // when payload is JSON object - whitespaces must be removed
          String signature1 = "a17d2ac229d1ebbb5f10e839c7985c4818e5986eab297f7e5979196d4d7d3ed2";
          System.out.println(verifySignature(removeWhitespaces("{\n  \"a\": 1\n}"), signature1, secretKey));
          System.out.println(verifySignature(removeWhitespaces("{\"a\":1}"), signature1, secretKey));

          String signature2 = "f7cf97814a03146abedb9793f56e1dec34f618f82d10395310d053f749483ffb";
          System.out.println(verifySignature(removeWhitespaces("{\n  \"a\\\"b\": 1\n}"), signature2, secretKey));

          // when payload is directly a String
          String signature3 = "53ff92957e1427ce23ad5bda9d0c5f2f4ff384d0806b83eeacb510c842d3a358";
          System.out.println(verifySignature("  message  ", signature3, secretKey));
      }
      
      public static String removeWhitespaces(String json) {
          boolean quoted = false;
          boolean escaped = false;
          String out = "";
      
          for (Character c : json.toCharArray()) {
              if (escaped) {
                  out += c;
                  escaped = false;
                  continue;
              }
      
              if (c == '"') {
                  quoted = !quoted;
              } else if (c == '\\') {
                  escaped = true;
              }
      
              if (Character.isWhitespace(c) &! quoted) {
                  continue;
              }
      
              out += c;
          }

          return out;
      }
      
      public static boolean verifySignature(String payload, String signature, byte[] secretKey) throws InvalidKeyException, NoSuchAlgorithmException {
          Mac mac = Mac.getInstance("HmacSHA256");
          mac.init(new SecretKeySpec(secretKey, "HmacSHA256"));
          byte[] hash = mac.doFinal(payload.getBytes(StandardCharsets.UTF_8));
          String generatedSignature = bytesToHex(hash);
          return generatedSignature.equals(signature);
      }
      
      private static String bytesToHex(byte[] bytes) {
          StringBuilder sb = new StringBuilder(bytes.length * 2);
          for (byte b : bytes) {
              sb.append(String.format("%02x", b));
          }
          return sb.toString();
      }

  }
  ```

  ```javascript NodeJS
  const crypto = require('crypto') 
  verifySignature: function (signature, message, secretKey) {
    return crypto.createHmac('sha256', secretKey)
      .update(isString(message) && message || JSON.stringify(message))
      .digest('hex') === signature
  }
  ```
</CodeGroup>

## IP Whitelisting

When Voucherify sends a webhook, the Voucherify servers make network requests to tenants’ or third parties’ servers.

To add an additional layer of security, you can do IP whitelisting. This mechanism verifies if webhook requests come from Voucherify.

Voucherify sends webhooks from the IP ranges below. Add all three addressses for your instance.

| **Instance** | **IP**                                   |
| ------------ | ---------------------------------------- |
| eu1          | 34.247.197.2263.32.191.14152.215.148.84  |
| us1          | 100.25.106.6718.209.236.21534.192.255.99 |
| as1          | 52.76.98.8254.169.8.10113.214.87.160     |

## Webhooks Available in Project Settings

These webhooks are triggered by the events listed in the Project settings.

<Warning>
  Documentation of some of the events is still in progress.
</Warning>

The following events can send a webhook:

* Redemption events:

  * [Redemption succeeded](/reference/events-redemption-succeeded "Redemption succeeded event documentation")
  * [Redemption failed](/reference/events-redemption-failed "Redemption failed event documentation")
  * [Redemption rollback succeeded](/reference/events-redemption-rollback-succeeded "Redemption rollback succeeded event documentation")
  * [Redemption rollback failed](/reference/events-redemption-rollback-failed "Redemption rollback failed event documentation")

* Publication event:
  * [Publication succeeded](/reference/events-publication-succeeded "Publication succeeded event documentation")

* Customer events:

  * [Customer created](/reference/events-customer-created "Customer created event documentation")
  * [Customer deleted](/reference/events-customer-deleted "Customer deleted event documentation")
  * [Customer rewarded](/reference/events-customer-rewarded "Customer rewarded event documentation")
  * [Customer rewarded loyalty points](/reference/events-customer-rewarded-loyalty_points "Customer rewarded loyalty points event documentation")
  * Customer confirmed

* Voucher events:

  * [Voucher created](/reference/events-voucher-created "Voucher created event documentation")
  * [Voucher disabled](/reference/events-voucher-disabled "Voucher disabled event documentation")
  * [Voucher enabled](/reference/events-voucher-enabled "Voucher enabled event documentation")
  * [Voucher updated](/reference/events-voucher-updated "Voucher updated event documentation")
  * [Voucher published](/reference/events-voucher-published "Voucher published event documentation")
  * [Voucher loyalty card pending points activated](/reference/events-voucher-loyalty_card-pending_points-activated "Voucher loyalty card pending points activated event documentation")
  * [Voucher loyalty card pending points added](/reference/events-voucher-loyalty_card-pending_points-added "Voucher loyalty card pending points added event documentation")
  * [Voucher loyalty card pending points canceled](/reference/events-voucher-loyalty_card-pending_points-canceled "Voucher loyalty card pending points canceled event documentation")
  * [Voucher loyalty card pending points updated](/reference/events-voucher-loyalty_card-pending_points-updated "Voucher loyalty card pending points update event documentation")
  * [Voucher loyalty card points added](/reference/events-voucher-loyalty_card-points_added "Voucher loyalty card points added event documentation")
  * [Voucher loyalty card points expired](/reference/events-voucher-loyalty_card-points_expired "Voucher loyalty card points expired event documentation")
  * [Voucher loyalty card transaction created](/reference/events-voucher-loyalty_card-transaction-created "Voucher loyalty card transaction created event documentation")
  * [Voucher gift transaction created](/reference/events-voucher-gift-transaction-created "Voucher gift transaction created event documentation")
  * [Voucher gift balance added](/reference/events-voucher-gift-balance_added "Voucher gift balance added event documentation")
  * [Voucher deleted](/reference/events-voucher-deleted "Voucher deleted event documentation")

* Campaign events:

  * [Campaign created](/reference/events-campaign-created "Campaign created event documentation")
  * [Campaign voucher generation completed](/reference/events-campaign-vouchers-generation-completed "Campaign voucher generation completed event documentation")
  * [Campaign disabled](/reference/events-campaign-disabled "Campaign disabled event documentation")
  * [Campaign enabled](/reference/events-campaign-enabled "Campaign enabled event documentation")
  * [Campaign updated](/reference/events-campaign-updated "Campaign updated event documentation")
  * [Campaign deleted](/reference/events-campaign-deleted "Campaign deleted event documentation")
  * Campaign vouchers added

* Promotion tier events:

  * [Promotion tier created](/reference/events-campaign-promotion_tier-created "Promotion tier created event documentation")
  * [Promotion tier disabled](/reference/events-campaign-promotion_tier-disabled "Promotion tier disabled event documentation")
  * [Promotion tier enabled](/reference/events-campaign-promotion_tier-enabled "Promotion tier enabled event documentation")
  * [Promotion tier updated](/reference/events-campaign-promotion_tier-updated "Promotion tier updated event documentation")
  * [Promotion tier deleted](/reference/events-campaign-promotion_tier-deleted "Promotion tier deleted event documentation")

* Business validation rule events:

  * [Business validation rule created](/reference/events-bus_val_rule-created "Validation rule created event documentation")
  * [Business validation rule updated](/reference/events-bus_val_rule-updated "Validation rule updated event documentation")
  * [Business validation rule assignment created](/reference/events-bus_val_rule-assignment-created "Validation rule assignment created event documentation")
  * [Business validation rule assignment deleted](/reference/events-bus_val_rule-assignment-deleted "Validation rule assignment deleted event documentation")
  * [Business validation rule deleted](/reference/events-bus_val_rule-deleted "Validation rule deleted event documentation")

* Earning rule events:

  * Earning rule assigned
  * Earning rule deleted
  * Earning rule disabled
  * Earning rule enabled
  * Earning rule updated

* Loyalty tier related events:

  * [Loyalty tier created](/reference/events-campaign-loyalty_tier-created "Campaign loyalty tier created documentation")
  * [Loyalty tier deleted](/reference/events-campaign-loyalty_tier-deleted "Campaign loyalty tier deleted documentation")
  * [Loyalty tier updated](/reference/events-campaign-loyalty_tier-updated "Campaign loyalty tier updated documentation")

* Promotion stack events:

  * Promotion stack created
  * Promotion stack updated

* Referral tier related events:

  * Referral tier created
  * Referral tier deleted
  * Referral tier updated

* Reward assignment events:

  * Reward assignment created
  * Reward assignment deleted
  * Reward assignment updated

* Voucher generation events:

  * Voucher generation failed
  * Voucher generation started

**Documentation for some events is in progress. Updates will be provided soon.**

### Project Setting Webhook Payload

| Attributes          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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`        | Name of the event that triggerered the webhook sendout.Available values: `business_validation_rule.assignment.created`, `business_validation_rule.assignment.deleted`, `business_validation_rule.created`, `business_validation_rule.deleted`, `business_validation_rule.updated`, `campaign.created`, `campaign.deleted`, `campaign.disabled`, `campaign.enabled`, `campaign.earning_rule.assigned`, `campaign.earning_rule.deleted`, `campaign.earning_rule.disabled`, `campaign.earning_rule.enabled`, `campaign.earning_rule.updated`, `campaign.loyalty_tier.created`, `campaign.loyalty_tier.deleted`, `campaign.loyalty_tier.updated`, `campaign.promotion_stack.created`, `campaign.promotion_stack.updated`, `campaign.promotion_tier.created`, `campaign.promotion_tier.deleted`, `campaign.promotion_tier.disabled`, `campaign.promotion_tier.enabled`, `campaign.promotion_tier.updated`, `campaign.referral_tier.created`, `campaign.referral_tier.deleted`, `campaign.referral_tier.updated`, `campaign.reward.assignment.created`, `campaign.reward.assignment.deleted`, `campaign.reward.assignment.updated`, `campaign.updated`, `campaign.vouchers.added`, `campaign.vouchers.generation.completed`, `campaign.vouchers.generation.failed`, `campaign.vouchers.generation.started`, `customer.confirmed`, `customer.created`, `customer.deleted`, `customer.rewarded`, `customer.rewarded.loyalty_points`, `publication.succeeded`, `redemption.failed`, `redemption.rollback.failed`, `redemption.rollback.succeeded`, `redemption.succeeded`, `voucher.created`, `voucher.deleted`, `voucher.disabled`, `voucher.enabled`, `voucher.gift.balance_added`, `voucher.gift.transaction.created`, `voucher.loyalty_card.pending_points.activated`, `voucher.loyalty_card.pending_points.added`, `voucher.loyalty_card.pending_points.canceled`, `voucher.loyalty_card.pending_points.updated`, `voucher.loyalty_card.points_added`, `voucher.loyalty_card.points_expired`, `voucher.loyalty_card.transaction.created`, `voucher.published`, `voucher.updated` |
| data`object`        | Payload depends on the event that triggered the webhook sendout. Project settings cover the following events:- - [`business_validation_rule.assignment.created`](/reference/events-bus_val_rule-assignment-created)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

* [`business_validation_rule.assignment.deleted`](/reference/events-bus_val_rule-assignment-deleted)
* [`business_validation_rule.created`](/reference/events-bus_val_rule-created)
* [`business_validation_rule.deleted`](/reference/events-bus_val_rule-deleted)
* [`business_validation_rule.updated`](/reference/events-bus_val_rule-updated)
* [`campaign.created`](/reference/events-campaign-created)
* [`campaign.deleted`](/reference/events-campaign-deleted)
* [`campaign.disabled`](/reference/events-campaign-disabled)
* [`campaign.enabled`](/reference/events-campaign-enabled)
* [`campaign.updated`](/reference/events-campaign-updated)
* `campaign.earning_rule.assigned`
* `campaign.earning_rule.deleted`
* `campaign.earning_rule.disabled`
* `campaign.earning_rule.enabled`
* `campaign.earning_rule.updated`
* [`campaign.loyalty_tier.created`](/reference/events-campaign-loyalty_tier-created)
* [`campaign.loyalty_tier.deleted`](/reference/events-campaign-loyalty_tier-deleted)
* [`campaign.loyalty_tier.updated`](/reference/events-campaign-loyalty_tier-updated)
* [`campaign.promotion_tier.created`](/reference/events-campaign-promotion_tier-created)
* [`campaign.promotion_tier.deleted`](/reference/events-campaign-promotion_tier-deleted)
* [`campaign.promotion_tier.disabled`](/reference/events-campaign-promotion_tier-disabled)
* [`campaign.promotion_tier.enabled`](/reference/events-campaign-promotion_tier-enabled)
* [`campaign.promotion_tier.updated`](/reference/events-campaign-promotion_tier-updated)
* `campaign.promotion_stack.created`
* `campaign.promotion_stack.updated`
* `campaign.referral_tier.created`
* `campaign.referral_tier.deleted`
* `campaign.referral_tier.updated`
* `campaign.reward.assignment.created`
* `campaign.reward.assignment.deleted`
* `campaign.reward.assignment.updated`
* [`campaign.vouchers.generation.completed`](/reference/events-campaign-vouchers-generation-completed)
* `campaign.vouchers.generation.failed`
* `campaign.vouchers.generation.started`
* `campaign.vouchers.added`
* [`customer.created`](/reference/events-customer-created)
* [`customer.deleted`](/reference/events-customer-deleted)
* `customer.confirmed`
* [`customer.rewarded`](/reference/events-customer-rewarded)
* [`customer.rewarded.loyalty_points`](/reference/events-customer-rewarded-loyalty_points)
* [`publication.succeeded`](/reference/events-publication-succeeded)
* [`redemption.failed`](/reference/events-redemption-failed)
* [`redemption.rollback.failed`](/reference/events-redemption-rollback-failed)
* [`redemption.rollback.succeeded`](/reference/events-redemption-rollback-succeeded)
* [`redemption.succeeded`](/reference/events-redemption-succeeded)
* [`voucher.created`](/reference/events-voucher-created)
* [`voucher.deleted`](/reference/events-voucher-deleted)
* [`voucher.disabled`](/reference/events-voucher-disabled)
* [`voucher.enabled`](/reference/events-voucher-enabled)
* [`voucher.gift.balance_added`](/reference/events-voucher-gift-balance_added)
* [`voucher.gift.transaction.created`](/reference/events-voucher-gift-transaction-created)
* [`voucher.loyalty_card.pending_points.activated`](/reference/events-voucher-loyalty_card-pending_points-activated)
* [`voucher.loyalty_card.pending_points.added`](/reference/events-voucher-loyalty_card-pending_points-added)
* [`voucher.loyalty_card.pending_points.canceled`](/reference/events-voucher-loyalty_card-pending_points-canceled)
* [`voucher.loyalty_card.pending_points.updated`](/reference/events-voucher-loyalty_card-pending_points-updated)
* [`voucher.loyalty_card.points_added`](/reference/events-voucher-loyalty_card-points_added)
* [`voucher.loyalty_card.points_expired`](/reference/events-voucher-loyalty_card-points_expired)
* [`voucher.loyalty_card.transaction.created`](/reference/events-voucher-loyalty_card-transaction-created)
* [`voucher.published`](/reference/events-voucher-published)
* [`voucher.updated`](/reference/events-voucher-updated) |
  \| source`object`      | Contains details about the source of the webhook sendout.Attributes	Descriptionidstring

  ID number of the webhook.

  Example:

  wh\_j56Vfy47Vx9YOX7QYD1fzHnc

  objectstring&#x9;

  Determines the type of the object.

  Available values: webhook Example:

  webhook

  target\_urlstring&#x9;

  The address where the webhook will be sent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
  \| event`object`       | Contains other data of the event that triggered the sendout.Attributes	Descriptionidstring

  Unique identifier of the event that triggered the sendout.

  Example:

  evred\_1f3611301g3127begb

  typestring&#x9;

  Determines the type of the event.

  Example:

  redemption.succeeded

  created\_atstring&#x9;

  The exact moment when the event was created.

  Example:

  2024-01-01T11:11:11.111Z

  entity\_idstring&#x9;

  Unique identifier of the entity that triggered the sendout.

  Example:

  r\_1f3611302bf107befb

  group\_idstring&#x9;

  Unique identifier of the request that triggered the event.

  Example:

  v-1f36113948e50fc4ge

  event\_sourceobject&#x9;

  Contains the source of the object that triggered the sendout.

  Attributes	Descriptionchannelstring&#x9;

  Determines the channel that triggered the sendout.

  Available values: USER\_PORTAL, API, CLIENT\_API, INTERNAL Example:

  API

  userstring&#x9;

  Defines the user who triggered the event.

  api\_keyobject&#x9;

  Determines the API key used to initiate the sendout.

  Attributes	Descriptionnamestring&#x9;

  Channel name in the application keys.

  app\_idstring&#x9;

  Contains the application ID from the Voucherify API key pair.

  Example:

  1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

## Webhooks Available in Distributions

These webhooks are triggered by the events which cause distribution.

Some distribution events, e.g. Customer entered segment, have different purposes:

* Notify customers about promotion
* Send and publish unique codes from campaign
* Send plain message to customers

<Info>
  Learn more about configuring distribution webhooks from the [Webhook distributions article](https://support.voucherify.io/article/68-webhooks-notifications).
</Info>

The documentation of these events contains data for all purposes. The objects which are shared between the purposes are marked as `required`. The objects which appear only for specific purposes are respectively described.

* Custom events:
  * [Custom event](/reference/events-customer-custom_event "Customer custom event event documentation")

* Segment related activities:

  * [Customer entered segment](/reference/events-customer-segment-entered "Customer entered segment event documentation")
  * [Customer left segment](/reference/events-customer-segment-left "Customer left segment event documentation")

* Manual messages:

  * Notify customers about promotion – covered by [the MANUAL\_DISTRIBUTION\_SCHEDULE event](/reference/events-distribution-manual_distribution_schedule "Manual distribution schedule event documentation")
  * Send and publish unique codes from a campaign – covered by [the MANUAL\_DISTRIBUTION\_SCHEDULE event](/reference/events-distribution-manual_distribution_schedule "Manual distribution schedule event documentation")
  * Send a plain message to customers – does not support webhooks as a distribution channel

* Cart related activities:

  * [Order updated](/reference/events-customer-order-updated "Order updated event documentation")
  * [Order paid](/reference/events-customer-order-paid "Order paid event documentation")
  * [Order created](/reference/events-customer-order-created "Order created event documentation")
  * [Order canceled](/reference/events-customer-order-canceled "Order canceled event documentation")

* Publishing codes:
  * [Successfully published](/reference/events-customer-publication-succeeded "Code published event documentation")

* Voucher related activities:

  * [Gift credits added](/reference/events-customer-voucher-gift-balance_added "Gift credits added event documentation")
  * [Loyalty points added](/reference/events-customer-voucher-loyalty_card-points_added "Loyalty points added event documentation")
  * [Loyalty card points expired](/reference/events-customer-voucher-loyalty_card-points_expired "Customer loyalty card points expired event documentation")
  * [Loyalty pending points added](/reference/events-customer-voucher-loyalty_card-pending_points-added "Customer loyalty card pending points added")
  * [Loyalty pending points updated](/reference/events-customer-voucher-loyalty_card-pending_points-updated "Voucher loyalty card pending points update event documentation")
  * [Loyalty pending points activated](/reference/events-customer-voucher-loyalty_card-pending_points-activated "Customer loyalty card pending points activated")
  * [Loyalty pending points canceled](/reference/events-customer-voucher-loyalty_card-pending_points-canceled "Customer loyalty card pending points canceled")
  * [Voucher redeemed](/reference/events-customer-redemption-succeeded "Voucher redeemed event documentation")
  * [Voucher redemption rolled back](/reference/events-customer-redemption-rollback-succeeded "Voucher redemption rolled back event documentation")

* Customer rewards:
  * [Reward redeemed](/reference/events-customer-rewarded "Customer rewarded documentation")

* Loyalty tier related activities:

  * [Customer entered loyalty tier structure](/reference/events-customer-loyalty-tier-joined "Customer entered loyalty tier structure event documentation")
  * [Customer left loyalty tier structure](/reference/events-customer-loyalty-tier-left "Customer left loyalty tier structure event documentation")
  * [Customer loyalty tier upgraded](/reference/events-customer-loyalty-tier-upgraded "Customer loyalty tier upgraded event documentation")
  * [Customer loyalty tier downgraded](/reference/events-customer-loyalty-tier-downgraded "Customer loyalty tier downgraded event documentation")
  * [Customer loyalty tier prolonged](/reference/events-customer-loyalty-tier-prolonged "Customer loyalty tier prolonged event documentation")
  * [Customer rewarded loyalty points](/reference/events-customer-rewarded-loyalty_points "Customer rewarded loyalty points documentation")

* Referral related activities:
  * Customer was referred

### Campaign Distributions – Notifications

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

* Loyalty campaigns:

  * [Send loyalty program code](/reference/events-customer-publication-succeeded)
  * [Loyalty points gained](/reference/events-customer-rewarded-loyalty_points)
  * [Reward redeemed](/reference/events-customer-reward_redemptions-completed)

* Referral campaigns:

  * [Send referral code to the referrer](/reference/events-customer-publication-succeeded)
  * Customer referred (documentation in progress)

### Distribution Webhook Payload

| Attributes          | Description                                                                                                                                                                    |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 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:- [`customer.custom_event`](/reference/events-customer-custom_event) |

* [`customer.loyalty.tier.downgraded`](/reference/events-customer-loyalty-tier-downgraded)
* [`customer.loyalty.tier.joined`](/reference/events-customer-loyalty-tier-joined)
* [`customer.loyalty.tier.left`](/reference/events-customer-loyalty-tier-left)
* [`customer.loyalty.tier.prolonged`](/reference/events-customer-loyalty-tier-prolonged)
* [`customer.loyalty.tier.upgraded`](/reference/events-customer-loyalty-tier-upgraded)
* [`customer.order.canceled`](/reference/events-customer-order-canceled)
* [`customer.order.created`](/reference/events-customer-order-created)
* [`customer.order.paid`](/reference/events-customer-order-paid)
* [`customer.order.updated`](/reference/events-customer-order-updated)
* [`customer.publication.succeeded`](/reference/events-customer-publication-succeeded)
* [`customer.redemption.rollback.succeeded`](/reference/events-customer-redemption-rollback-succeeded)
* [`customer.redemption.succeeded`](/reference/events-customer-redemption-succeeded)
* `customer.referred`
* [`customer.reward_redemptions.completed`](/reference/events-customer-reward_redemptions-completed)
* [`customer.rewarded`](/reference/events-customer-rewarded)
* [`customer.rewarded.loyalty_points`](/reference/events-customer-rewarded-loyalty_points)
* [`customer.segment.entered`](/reference/events-customer-segment-entered)
* [`customer.segment.left`](/reference/events-customer-segment-left)
* [`customer.voucher.gift.balance_added`](/reference/events-customer-voucher-gift-balance_added)
* [`customer.voucher.loyalty_card.pending_points.activated`](/reference/events-customer-voucher-loyalty_card-pending_points-activated)
* [`customer.voucher.loyalty_card.pending_points.added`](/reference/events-customer-voucher-loyalty_card-pending_points-added)
* [`customer.voucher.loyalty_card.pending_points.canceled`](/reference/events-customer-voucher-loyalty_card-pending_points-canceled)
* [`customer.voucher.loyalty_card.pending_points.updated`](/reference/events-customer-voucher-loyalty_card-pending_points-updated)
* [`customer.voucher.loyalty_card.points_added`](/reference/events-customer-voucher-loyalty_card-points_added)
* [`customer.voucher.loyalty_card.points_expired`](/reference/events-customer-voucher-loyalty_card-points_expired)
* [`manual_distribution_schedule`](/reference/events-distribution-manual_distribution_schedule) |
  \| source`object`      | Contains details about the source of the webhook sendout.Attributes	Descriptionidstring

  Unique identifier of the distribution that sent the webhook.

  Example:

  distr\_TrJj0lHV44EMt6HvLa2pyNlHTF

  objectstring&#x9;

  Determines the type of the object.

  Available values: distribution Example:

  distribution

  target\_urlstring&#x9;

  The address where the webhook is be sent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  \| event`object`       | Contains other data of the event that triggered the sendout.Attributes	Descriptionidstring

  Unique identifier of the event that triggered the sendout.

  Example:

  evred\_1f3611301g3127begb

  typestring&#x9;

  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\_atstring&#x9;

  The exact moment when the event was created.

  Example:

  2024-01-01T11:11:11.111Z

  entity\_idstring&#x9;

  Unique identifier of the entity that triggered the sendout.

  Example:

  r\_1f3611302bf107befb

  group\_idstring&#x9;

  Unique identifier of the request that triggered the event.

  Example:

  v-1f36113948e50fc4ge

  event\_sourceobject&#x9;

  Contains the source of the object that triggered the sendout.

  Attributes	Descriptionchannelstring&#x9;

  Determines the channel that triggered the sendout.

  Available values: USER\_PORTAL, API, CLIENT\_API, INTERNAL Example:

  API

  userstring&#x9;

  Defines the user who triggered the event.

  api\_keyobject&#x9;

  Determines the API key used to initiate the sendout.

  Attributes	Descriptionnamestring&#x9;

  Channel name in the application keys.

  app\_idstring&#x9;

  Contains the application ID from the Voucherify API key pair.

  Example:

  1XXXX5XX-0XXX-XXXb-X7XX-XX2XXaXXX6XX                                                                           |
