Webhooks

With Webhooks you can send event based information to a customized URL. When an event e.g. QR_CODE_SCANNED occurs, your given URL will be called (webhooked).

Webhook QR

Events

Event Triggered
QR_CODE_CREATED when a QR Code has been generated
QR_CODE_SCANNED when a QR Code has been scanned
VOUCHER_CREATED when a Voucher has been created
VOUCHER_UPDATED when a Voucher has been updated
VOUCHER_REDEEMED when a Voucher has been redeemed
VOUCHER_EXPIRED when a Voucher has been expired

Parameter

Your Webhook URL is called as a POST request sending parameters depending on the webhook to your server:

Default Parameters
event The name of the event occurred
e.g. QR_CODE_SCANNED
timestamp The time when the event occurred
user The user who created the voucher
code The short URL of the QR Code (Voucher).

QR Code scanned
redirects The number of how many times a QR Code has been scanned.
visitors The number of unique Visitors that scanned the QR Code
device The device that scanned the QR Code
os The operating system that scanned the QR Code
country The country that QR Code has been scanned in
lng/lat An optional lng/lat pair, when user submits his GPS coordinates

Voucher redeemed
uniqueid If the QR Code is a one-time redeemable coupon ,
the unique id of the voucher is returned.
This is one of the unique ids when creating
bulk QR Codes for a unique redeemable Voucher

Debugging

If you want to debug what is sent to your server, when a WebHook occurs you might want to create the following sample script under your customized WebHook URL for testing.

<?php

    // Test WebHook and show post params

    error_log("Fired WebHook");

    foreach ($_POST as $param_name => $param_val) {
        error_log("$param_name: $param_val");
    }
Top