Cancellations
How to cancel a booking as a owner or a customer
Using the /bookings/:id/:action endpoint, you can cancel a booking and make sure that both owner and customer is notified.
Cancelling a booking
Cancelling a 1-on-1 booking (using the confirm_decline or instant graphs), is done by sending a PUT request to the /bookings/:id/:action endpoint. It looks something like this:
curl# Request example (replace :id)
# [PUT] /bookings/:id/cancel
curl -X POST \
-H 'Timekit-App: back-to-the-future' \
-u doc.brown@timekit.io:nvHfRSlhvsnlg4rS7Wt28Ty47qdgegwSu3YK7hPW \
-d '{
"cancel": {
"message": "Sorry, gotta fix the DeLorean"
}
}' \
https://api.timekit.io/v2/bookings/:id/cancel
After calling the cancel action, the booking will enter a cancelled state and a notification email will be sent to both the owner and customer.
Cancelling a group booking
Cancelling a group booking is very similar to cancelling a 1-on-1 booking. For the owner booking (using the group_owner graph), it's the exact same process using the /bookings/:id/:action endpoint. After the owner booking has been cancelled, all the customers will receive a notification via email.
Cancelling a customer group booking (using the group_customer graph) is done with the cancel_by_customer action, instead of the usual cancel action, and looks like this:
curl# Request example (replace :customer_booking_id)
# [PUT] /bookings/:customer_booking_id/cancel_by_customer
curl -X POST \
-H 'Timekit-App: back-to-the-future' \
-u doc.brown@timekit.io:nvHfRSlhvsnlg4rS7Wt28Ty47qdgegwSu3YK7hPW \
-d '{
"cancel_by_customer": {
"message": "Sorry, I'm not so (Mc)fly today"
}
}' \
https://api.timekit.io/v2/bookings/:customer_booking_id/cancel_by_customer
After the customer has cancelled the booking, a notification is sent to the owner via email.