Webhook Notification Data

The webhook notification data is returning unexpected results. For example when the Booking is for two days - It shows the correct booking start and end date but the Item(s) do not have the correct end date. When the status changes to Paid and the webhook is sent the Booking status changes to Paid but the Item(s) status remains the same. 

Here is a sample response:
{"@attributes":{"version":"3.8.0.38","host":".checkfront.com"},"booking":{"@attributes":{"booking_id":"13"},"status":"PAID","code":"FCSH-190316","created_date":"1458445785","staff_id":"1","source_ip":"61.111.111.111","start_date":"1459314000","end_date":"1459400400","customer":{"name":"Lee S","email":{},"region":"TX","address":{},"city":{},"country":"US","phone":{},"postal_zip":{}},"meta":{"customer_account_id":{},"mobile_device":{}},"order":{"@attributes":{"currency_id":"USD"},"sub_total":"0.00","tax_total":"0.00","paid_total":"0.00","total":"0.00","taxes":{},"discount":"0.00","items":{"item":[{"@attributes":{"line_id":"1","item_id":"7"},"start_date":"1459314000","end_date":"1459314000","sku":"tinyhouse1","slip":{},"package_id":"0","status":"PEND","total":"0.00","tax_total":"0.00","qty":"1"},{"@attributes":{"line_id":"2","item_id":"14"},"start_date":"1459314000","end_date":"1459314000","sku":"petdeposit","slip":{},"package_id":"0","status":"HOLD","total":"0.00","tax_total":"0.00","qty":"1"}]}}}}



Comments

  • Booking webhooks are one of the older areas of the application, and as such, while we have begun expanding our webhook offerings of late, much of the format of these in particular has remained unchanged for compatibility with existing systems.

    The date you're seeing is most likely representative of a "nightly" allocated item: while a "daily" item has an inclusive end date (wherein a booking starting today and ending tomorrow is a booking for 2 full days), a "nightly" item has an exclusive end date (a booking checking in today and checking out tomorrow is a booking for 1 night).  Although both would be displayed the same if you described them as "starting today and ending tomorrow", a "night" is internally represented as a single date; that being the date the customer checks in.
    The timestamp format of the date in the webhook isn't how this is registered internally, but rather an artifact of the conversion for the format compatibility.  Because a single night booking technically starts and ends on the same day, but doesn't have a natural end time, it shows as in your example.

    On a status change, the selected state being entered is propagated to any items currently in the booking -- while this may not currently be represented synchronously with the notification, a "status change" being triggered will mean that all displayed items will have the same status as the booking upon completion.
  • Thank you for the detailed explanation. 
Sign In or Register to comment.