Skip to main content

Booking Cancelation

Preface

The Booking Cancellation API allows you to cancel bookings according to the rental's cancellation policy. The cancellation policy can be retrieved from the rental's endpoint and includes details such as eligible cancellation days and penalty percentages.

The cancellations and modifications made on the bookings both initiated by the guest or the PMs need to be made on the channel side which will then reflect in the Smily interface.

danger

PMs can't make cancellations directly in the Smily system so the cancellation has to be made by your channel.

  "cancelation-policy-items": [
{
"id": "1",
"penalty-percentage": 10,
"eligible-days": 2,
"message-translations": {
"en": "Lorem ipsum",
"fr": "Lorem ipsum"
}
}
]

In this example, a booking can be canceled up to 2 days before check-in with a penalty of 10% from the booking's final price.

Booking Cancellation Process

To cancel a booking, follow these steps:

  1. Retrieve the cancellation policy from the rental's endpoint. Refer to the Swagger documentation for detailed specifications.
  2. Use the provided cancellation policy to determine the eligible cancellation days and penalty percentage.
  3. Make a PATCH request to the booking cancellation endpoint:
TOKEN="YOUR_TOKEN"
API_URL="API_URL"
BOOKING_ID="111"

curl -X PATCH \
'$API_URL/bookings/$BOOKING_ID/cancel' \
-H 'User-Agent: Api client' \
-H 'Accept: application/vnd.api+json' \
-H 'Content-Type: application/vnd.api+json' \
-H 'Authorization: Bearer $TOKEN' \
-d '{
"data": {
"type": "bookings",
"id": "$BOOKING_ID",
"attributes": {
"cancelation-reason": "canceled_by_traveller_other",
"cancelation-description": "health concern",
"channel-cancelation-cost": "80.0",
"currency": "USD"
}
}
}'
info

When cancelling a booking, it is essential to handle the channel-cancelation-cost attribute correctly to ensure the proper amount is charged or refunded to the guest.

  • Channel-cancelation-cost is 0: means the partner does not want to charge the guest, and the cancellation is free.
  • Channel-cancelation-cost is not 0: indicates that the partner wants to charge the guest a certain amount as a cancellation fee.