Step 7: Booking cancellation

Bókun allows confirmed bookings to be cancelled. The cancellation process is also hooked via Channel manager and is forwarded to the appropriate plugin. The relationship between cancellation is maintained via successful booking response which emits bookingConfirmationCode which is then passed through the CancelBookingRequest.

In case if the external system does not support cancellations, the following workaround might be used:

  • Make sure you attach cancellation policy with cancellation 100% fee if cancelled 1000 (or some other large number) days in advance. This will effectively mean the end user will not receive any monies back - even if the cancellation is successful.
  • Your cancellation implementation may simply send an email to the customer/your back office staff informing about this fact. You may retrieve the booking/reservation data you persisted in the previous step which contains the context information.

gRPC service interface

gRPC-enabled plugins must implement the following API call:

rpc CancelBooking (CancelBookingRequest) returns (io.bokun.inventory.common.api.grpc.CancelBookingResponse) {}


REST-enabled plugins must work with the following URL:

POST /booking/cancel

Cancellation request and response

Cancellation request, CancelBookingRequest, has the following structure:

Plugin configuration parameters, as specified in Step 3. plugin configuration
Corresponds to ConfirmBookingResponse::successfulBooking::bookingConfirmationCode - as sent by the plugin during the confirmation
see notes
Agent code who has cancelled the booking (if set)

Plugin response must be in shape of CancelBookingResponse, and have the following structure:

see notes
Should be set if cancellation had succeeded. Can not be set if the cancellation had failed
see notes
Should be set if cancellation had failed. Can not be set if the cancellation had failed. Either this or successfulCancellation has to be set but not both
Did this answer your question?