Adding a webhook or callback URL gives the hotel the possibility of receiving booking details in JSON format through a URL.
A webhook sends out a callback to a given URL and is triggered each time a booking is created, modified or canceled.
The webhook/callback feature is triggered from:
- The Sirvoy Booking Engine
- The Review booking form
- Bookings managed by front desk under “New Bookings”
- Sales Channel bookings
It can be activated in Settings -> Your account -> Callback URL.
The receiving server has to respond with http code 200 (OK), otherwise the call will be retried every 30 minutes up to 10 times.
- If you seem to get no incoming parameters, (or the equivalent depending on the programming language you use) this is the way to go:
$jsonBooking = json_decode(file_get_contents(‘php://input’)); - Callbacks are made as Posts and via https.
Below is an example of the JSON format:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
{ "version":"1.0", "generatedTime":"2017-08-01T09:40:01+00:00", "event":"new", "propertyId":8409, "bookingId":25947, "channelBookingId":null, "bookingDate":"2017-08-01T09:39:31+00:00", "arrivalDate":"2017-08-10", "departureDate":"2017-08-11", "eta":null, "totalAdults":2, "guest":{ "firstName":"Glenn", "lastName":"Svensson", "businessName":null, "address":"Storav\u00e4gen 18", "postcode":"30252", "city":"Halmstad", "country":"SE", "phone":"0706770000", "email":"test@test.se", "passportNo":null, "language":"sv", "message":null }, "internalComment":null, "couponCode":null, "bookingSource":"Front desk", "bookingIsProvisional":null, "bookingProvisionalId":null, "bookingIsCheckedIn":true, "bookingIsCheckedOut":false, "rooms":[ { "RoomTypeName":"N typ2 ", "RoomTypeDescription":null, "RoomName":"100011", "arrivalDate":"2017-08-10", "departureDate":"2017-08-11", "adults":"2", "quantity":"1", "price":"10", "roomTotal":10, "guestName":null, "comment":null } ], "additionalItems":[ { "description":"St\u00e4dning", "specificDate":null, "quantity":"1", "price":"0", "itemTotal":null } ], "currency":"SEK", "totalPrice":10 } |