Skip to main content
Skip table of contents

The Holibob API - Booking Cancellation

This section covers how to cancel bookings using the Holibob API. Cancellation allows you to cancel all booking availabilities under a booking.

Recommended Implementation Steps

  1. Check Cancellation Eligibility

  2. Display Cancellation Information

  3. Execute Cancellation

  4. Monitor Status

Retrieving Booking Cancellation Data

Before cancelling a booking, you should retrieve certain fields from the booking to add context data to display for cancellations and also to determine if cancellation is available for the booking. This information helps you present accurate cancellation details to users and determine whether the booking can be cancelled.

For detailed information about cancellation policies and how to use the cancellation data to determine when to enable cancellation functionality, refer to the Cancellation Policies documentation.

GraphQL Query Example

Use the following query to retrieve the necessary cancellation context data:

Query

query
GRAPHQL
query Booking($bookingId: String) {
    booking(id: $bookingId) {
        canCancel
        cancellationEffectiveRefundAmount {
            amount
            currency
        }
        availabilityList {
            nodes {
                id
                state
                cancellationState {
                    effectivePenalty {
                        formattedText
                    }
                    effectiveRefundState
                    effectiveRefundAmount {
                        amount
                        currency
                    }
                }
            }
        }
    }
}

Response

response
CODE
{
	"data": {
		"booking": {
			"canCancel": true,
			"cancellationEffectiveRefundAmount": {
				"amount": 425,
				"currency": "USD"
			},
			"availabilityList": {
				"nodes": [
					{
						"id": "6fe66daf-23b0-466f-929e-cebd64bac4ab",
						"state": "CONFIRMED",
						"cancellationState": {
							"effectivePenalty": {
								"formattedText": "A full refund will apply if you cancel."
							},
							"effectiveRefundState": "FULL",
							"effectiveRefundAmount": {
								"amount": 425,
								"currency": "USD"
							}
						}
					}
				]
			}
		}
	}
}

Key Fields Explained

  • canCancel: Boolean field that indicates if the booking can be cancelled. Returns true if any of the booking availabilities under the booking are cancellable

  • cancellationEffectiveRefundAmount: The total refund amount the customer will receive if the booking is cancelled

  • availabilityList.nodes.cancellationState: Detailed cancellation information for each availability within the booking, including:

    • effectivePenalty: The effective penalty window that is applied to the booking.

    • effectiveRefundState: Denotes full, partial or no refund.

    • effectiveRefundAmount: The refund amount for this specific availability (for single Booking Availabilities, this should be the same as cancellationEffectiveRefundAmount)

bookingCancel Mutation

The bookingCancel mutation is used to cancel the entire booking. By doing so you are cancelling all the included booking availabilities with a supplier.

Input Parameters

The mutation accepts a BookingCancelInput object with the following fields:

Field

Type

Required

Description

id

String

✅ Required

The booking ID to cancel

cancellationReason

String

Optional

Reason for the cancellation

Mutation

query
GRAPHQL
mutation BookingCancel($input: BookingCancelInput!) {
    bookingCancel(input: $input) {
        id
    }
}

Response

response
CODE
{
	"data": {
		"bookingCancel": {
			"id": "3b8e81ba-aada-442d-bf53-d7dc4b63ff3d"
		}
	}
}

Asynchronous Processing

Like the bookingCommit mutation, bookingCancel is an asynchronous operation. After calling this mutation:

  1. Poll for Status Changes: Monitor the booking state by periodically querying the booking to check for state changes. You should expect CONFIRMED → PENDING → CANCELLED

  2. Email Notifications: If configured, the customer will receive a cancellation email

  3. Refunds: If Holibob is the Merchant of Record, a refund will be automatically initiated to the customer


This documentation is part of the Holibob Partner API documentation suite. For additional support, contact the development team.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.