Skip to main content
Declining a booking

This tutorial will walk you through how to decline a booking through the API

d
Written by derrick mak
Updated over 6 years ago

This tutorial assumes that you have read the introduction to booking graphs and understood what it means to perform an action on a booking.
This tutorial follows our create booking tutorial, where we created a booking. This tutorial follows naturally after that one and focuses on the action "decline".
It should seem obvious, but declining a booking means that the resource being booked for some reason cannot accept the booking.
Issuing the decline action will look like this, using cURL:

curl --request POST \
  --url https://api.timekit.io/v2/bookings/58190fc6-1ec0-4ebb-b627-7ce6aa9fc703/decline
  --user :live_api_key_7nzvc7wsBQQISLeFSVhROys9V1bUJ1z7 \
  --data '{
    "notify_customer_declined_by_email": {
      "message": "Sorry, I'm not available at that location"
    }
  }'

Please note the id of the previously created booking in the url:

58190fc6-1ec0-4ebb-b627-7ce6aa9fc703


Timekits default behaviour is to send a decline email to the customer, looking like this:

You can disable this email by disabling emails in our admin interface, this means that you should handle declines yourself through webhooks, but that is a different tutorial.

Next steps:

If the resource doesn't decline, most likely you'll want to confirm the booking.
Otherwise the confirm_decline workflow an so the tutorial concludes here.

Did this answer your question?