Webhook
Webhook allows an external system to automatically receive notifications about events that occur within the reenio system. The event is delivered via an HTTP request to the external system’s URL, according to the custom message settings in the administration interface. The request body contains information about the given event. Based on this information, the external system can immediately react to the event, for example by retrieving detailed information via the API.
The reenio system implements webcams using custom messages.
How does an HTTP webhook request look like
For authorization purposes toward an external system, it is also possible to define custom HTTP request headers in the webhook settings. Headers with names starting with "x-" or the "authorization" header are supported. For example, when integrating with the Make platform, it is recommended to use authorization via the "x-make-apikey" header.
The data is sent in JSON format using the HTTP POST method (the data is located in the body of the request). Sample data in JSON format:
{
"triggerType": 1,
"customerId": 10,
"reservationId": 50
}
The server to which the HTTP request was sent must return a response with HTTP status code 200 (OK) and a "REENIO" response body (plain text, without quotation marks). If the server returns any other response, the webhook is considered undelivered and the system will try to deliver it again, see below. During the configuration (settings within the administration) of the webhook, an HTTP authentication request will be sent to the specified URL, which will contain an empty object in JSON format.
{}
The server must respond to this request as in the same way as any other request (status code 200 and the text "REENIO"), otherwise the settings will not be saved.
Supported protocols for sending webhooks are HTTP and HTTPS.
Data sent as the webhook body are always in JSON format. All requests, except for the verification request (an empty object), contain the triggerType field, which specifies the type of event that triggered the webhook. Additional properties depend on the event type. By default, the reservation ID (reservationId) and the customer ID (customerId) are always included (if they exist). Detailed information associated with the provided IDs can then be obtained through direct communication with the API.
The set of transmitted data may be extended or changed over time.
triggerType value list
| Value | Event |
|---|---|
| 0 | Reservation created |
| 1 | End of reserved time slot |
| 2 | Reservation status changed to: TOOK PLACE |
| 3 | Reservation status changed to: CONFIRMED |
| 4 | Start of reserved time slot |
| 5 | Customer registration |
| 6 | Reservation cancelled due to non-payment |
| 7 | Reservation paid |
| 8 | Time slot cancelled due to insufficient capacity |
| 9 | Reservation cancelled (except cancellation due to non-payment and time slot cancellation) |
| 10 | Reservation status changed to: DID NOT TAKE PLACE |
| 11 | Reservation status changed to: DID NOT COME |
| 12 | Reservation rescheduled |
| 13 | End of reserved time slot (ignored if a newer customer reservation exists) |
| 14 | Reservation created as a substitute |
| 16 | Start of paid reserved time slot |
| 17 | Substitute moved up |
| 20 | Bank transfer payment for reservation – payment details obtained |
| 21 | Bank transfer payment for credit – payment details obtained |
| 22 | Bank transfer payment for voucher – payment details obtained |
| 40 | Coupons – Code assigned to customer |
| 41 | Coupons – Code purchased |
| 42 | Coupons – Code created |
| 43 | Coupons – Code removed |
| 44 | Coupons – Maximum number of code uses reached |
| 50 | Customer credit – Credit added/removed (including credit purchase) |
| 51 | Customer credit – Credit added (including credit purchase) |
| 52 | Customer credit – Credit removed |
| 53 | Customer credit – Credit purchased |
| 100-199 | Reservation status changed to custom status |
| 200 | System – Low reenio credit balance |
| 201 | System – reenio package expiration |
What if the URL for sending webhooks is unavailable
If the URL returns a response other than HTTP status code 200 and the text "REENIO", the webhook will be considered undelivered and the system will attempt to deliver it again after a time delay. The delay is gradually increased with the number of failed delivery attempts. The exact number of attempts and the timing of retries are defined by the reservation system itself. The system will always attempt delivery at least 3 times, with the last attempt taking place at least 12 hours after the first attempt. This should cover potential short-term outages of the external system.
The server receiving webhooks should always respond as quickly as possible. Avoid running long-lasting tasks during the webhook call and processing; the response must be sent as soon as the request is received, not after the task has been fully processed. If the reenio system does not receive a response to the sent webhook within a sufficiently short time, the delivery will be marked as unsuccessful.
booking system