How can we help?

Webhooks

Introduction

VaocherApp's webhooks are powerful tool for developers looking to seamlessly integrate VaocherApp with their systems. Whether you're using popular automation platforms like Zapier or managing an in-house dashboard, our webhook allows you to receive real-time updates and data from VaocherApp, streamlining your workflow and enhancing system compatibility.

Create New Webhook

To create a new webhook, simply go to https://vaocher.app/settings/integrations/webhooks/create

There are various hook events you can listen to:

  • Gift voucher created
  • Gift voucher updated
  • Gift voucher redeemed

Test Your Webhooks

After created a webhook, you will be able to trigger a test call by clicking on the "check" button in https://vaocher.app/settings/integrations/webhooks (see screenshot below):

Test webhook
Click "check" button to trigger a test

Note: your test request will be queued and processed in the background. It may take several minutes.

Webhook Secret & How To Verify Webhook Signature

When creating new webhook, you are asked to provide secret key along with the webhook URL. This secret key will be used in VaocherApp system to sign the request before sending it to your endpoint. This serves as a security measure to ensure the request hasn't been tampered with.

The signature will be contained in an HTTP headers. For example:

signature: 5ee1fa0jc74550e66042cf6c42e14bbc7ab9ba7925c7b5ae9c01f45a6c508692

To verify the signature, compute a keyed hash value using the HMAC method with the SHA256 algorithm and the secret you provided for the webhook, against the request body.

For example:

<?php 

$requestHeaders = getallheaders();
$headerSignature = $requestHeaders['signature'];
$computedSignature = hash_hmac('sha256', file_get_contents('php://input'), 'your_webhook_secret');

if (hash_equals('', $computedSignature)) {
    // Passed. You can trust the request came from VaocherApp.
}

Please note that the above is a straightforward PHP example, and the implementation may vary depending on the programming language and framework you have chosen.