1. Difference between API and Webhooks
The main difference between how Webhooks and APIs generally work is:
- APIs place calls without knowing whether they get any data update as a response or not.
- Webhooks receive calls through HTTP POSTs from external systems only when those have some data updates.
Then, Webhooks can “activate” the whole integration workflow to act on these updates. The main point here is, however, that this activation happens for a reason (i.e. because there is a real update to process), and not just because it’s time to make yet another check for an update.
Another good thing about Webhooks is that they provide other applications and services with (near) real-time information. This is possible through APIs only too, but it involves more effort and is extremely resources-consuming. Webhooks make real-time really simple.
Note: Click here to get started with the Regiondo API.
2. Create your own webhook
To create your own webhook in your Regiondo Account, go to Connectivity > Webhooks.
2.1 Webhook name
Name your webhook. It is all about you.
Example
Google Notification
2.2 Trigger Type
Choose between the following 3 trigger: Booking, Customer and Ticket.
2.2.1 Booking - Response values
{
"booking_key": "1-2605248-44215-75508-1556874000",
"product_id": "44215",
"product_supplier_id": "9357",
"option_id": "174184",
"variation_id": "75508",
"order_id": "2605248",
"option_name": "Adulte",
"variation_name": "Tours en Français ",
"ticket_name": "La route de Bordeaux",
"product_name": "La route de Bordeaux",
"qty": "1",
"qty_cancelled": "0",
"event_date_time": "2019-05-03T09:00:00+02:00",
"date_applied_for": "2019-05-03T09:00:00+02:00",
"created_at": "2019-04-30T11:02:45+02:00",
"type": "booking",
"status": "approved",
"external_id": null,
"email": "customer.name@regiondo.com",
"phone_number": null,
"first_name": "Customer",
"last_name": "Name",
"duration_type": "minute",
"duration_value": "50.00",
"order_number": "1556614985033893200",
"distribution_channel_partner": "Company Short-name or Name",
"contact_data": {
"firstname": "Customer",
"lastname": "Name",
"email": "customer.name@regiondo.com",
"telephone": null,
"is_subscribed": "no"
}
}
2.2.2 Customer - Response values
{
"customer_email": "customer.name@regiondo.com",
"customer_firstname": "Customer",
"customer_lastname": "Name",
"customer_phone": "",
"customer_birth_date": null,
"customer_street": null,
"customer_postcode": null,
"customer_city": null,
"customer_country": null,
"customer_newsletter_status": 0,
"customer_newsletter_order": null,
"customer_newsletter_datetime": null,
"customer_newsletter_ip": null
}
{
"customer_email": "customer.name@regiondo.com",
"customer_firstname": "Customer",
"customer_lastname": "Name",
"customer_phone": "",
"customer_birth_date": null,
"customer_street": "Neumarkter Str. 63",
"customer_postcode": "81673",
"customer_city": "München",
"customer_country": "DE",
"customer_newsletter_status": 0,
"customer_newsletter_order": null,
"customer_newsletter_datetime": null,
"customer_newsletter_ip": null
}
2.2.3 Ticket - Response values
{
"code": "RE57WGQH0G6S",
"status": "processing",
"validation_status": "not validated",
"data": {
"validated_at": "2019-04-30T11:03:11+02:00",
"product_info": {
"product_name": "La route de Bordeaux",
"variation_name": "Tours en Français ",
"option_name": "Adulte",
"ticket_datetime": "2019-05-03T09:00:00+02:00"
},
"customer_info": {
"customer_name": "Mr. Customer Name",
"customer_email": "customer.name@regiondo.com"
}
}
}
{
"code": "RE57WGQH0G6S",
"status": "sent",
"validation_status": "validated",
"data": {
"validated_at": "2019-04-30T11:09:09+02:00",
"product_info": {
"product_name": "La route de Bordeaux",
"variation_name": "Tours en Français ",
"option_name": "Adulte",
"ticket_datetime": "2019-05-03T09:00:00+02:00"
},
"customer_info": {
"customer_name": "Mr. Customer Name",
"customer_email": "customer.name@regiondo.com"
}
}
}
3. Payload URL
Here you should enter the URL to be called for when the Webhook trigger happens in the dashboard.
Note
Don't forget to test the URL before you save/activate the webhook.
4. Add discount code
You can add information about the discount amount, the currency and the discount code. You will also be shown the total amount of the booking.
4.1 A discount is used
"coupon_code": "HALF_PRICE"
"total_paid": "249.50"
"coupon_discount": "249.50"
"total": "499.00"
"currency_code": "CHF"
4.2 A discount is not used
"coupon_code": null
"total_paid": "10.00"
"coupon_discount": "0.00"
"total": "10.00"
"currency_code": "EUR"
Webhook on Merchandising - Add-ons It is possible to connect to add-ons, but here are limitations: VAT is not passed on. The amount of the product will be added to the amount of the reservation including VAT. Only the total amount of the order is shown, i.e. the amount of the offer + the add-on. Example:Offer amount 50E + add on 5E = 55 EUROS All other information will be transmitted, such as: Product identification, quantity, cancellations, status, payment, reservation number, buyer information, order price including VAT. |