Skip to main content
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 and 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 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:
Your endpoint must return a response in under 10 seconds; otherwise, it will be considered an error.
  • 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.

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.

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.

Webhooks Available in Project Settings

These webhooks are triggered by the events listed in the Project settings.
Documentation of some of the events is still in progress.
The following events can send a webhook: Documentation for some events is in progress. Updates will be provided soon.

Project Setting Webhook Payload

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
Learn more about configuring distribution webhooks from the Webhook distributions article.
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.

Campaign Distributions – Notifications

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

Distribution Webhook Payload