Lodging Cancel Booking API

Guidance and examples for accessing the Lodging Cancel Booking API

The Lodging Cancel Booking API allows you to cancel an existing booking. Requires data that is only available at time of booking, so you will only be able to cancel trips that you have booked.

Endpoint

MethodEndpointPrerequisites
PUThttps://apim.expedia.com/hotels/bookings/[TripNumber]An active TripNumber from the Lodging Booking API.

Required Headers

Key:Expedia API key
Authorization:Expedia API Authorization String
User-Id:username@domain.com

The email address associated with the booking.
Accept:application/vnd.exp-hotel.v3+json
Partner-Transaction-Id:[Partner TransactionID String]


Example Cancel Request

Cancel Query

https://apim.expedia.com/hotels/bookings/12345

Cancel Body

Only include if partner wants to store meta data about cancellation for later retrieval.

{
	"PartnerMetaData": {
		"SampleKey1": "SampleValue1",
		"SampleKey2": "SampleValue2"
	}
}

Partial Cancel Response

Request URL

https://apim.expedia.com/hotels/bookings/79017964335?roomConfirmations=5b92c8ff-2c01-49a7-b464-86a91595b0b2

Response Message

{
	"TransactionId": "ea22e5c7-c4ad-4342-b4aa-344dd7f2779c",
	"ItineraryNumber": 79017964335,
	"PartnerConfirmationNumber": "hello123",
	"PartnerAgentId": "123456",
	"TotalRefund": {
		"Value": "1077.60",
		"Currency": "USD"
	},
	"TotalPrice": {
		"Value": "1077.60",
		"Currency": "USD"
	},
	"TotalPenalty": {
		"Value": "0.00",
		"Currency": "USD"
	},
	"CancellationDetails": [{
		"RoomConfirmation": "5b92c8ff-2c01-49a7-b464-86a91595b0b2",
		"CancelConfirmationNumber": "781234764",
		"CancellationDate": "2022-09-05T18:54:00+00:00",
		"Refund": {
			"Value": "1077.60",
			"Currency": "USD",
			"Type": "Full"
		}
	}],
	"Links": {
		"WebItinRetrieve": {
			"Href": "https://www.expedia.com/trips/79017964335?userToken=DuwE6TEhQabmubt9ikFvxlnim3jXAgf7liEfLxxUE6Yi7iqaw74a6QzLeFsFXmU0mUaiEvydBfOOo2qvIUe_KdnKqIWsWdQeybg"
		},
		"ApiItinRetrieve": {
			"Accept": "application/vnd.exp-hotel.v3+json",
			"Method": "GET",
			"Href": "https://apim.expedia.com/hotels/bookings/79017964335"
		}
	}
}

Hotel Cancel Response for One Room

Request URL

https://apim.expedia.com/hotels/bookings/79018078565

Response Message

{
	"TransactionId": "38b82042-ebcd-4935-996f-3481db8a0795",
	"ItineraryNumber": 79018078565,
	"PartnerConfirmationNumber": "hello123",
	"PartnerAgentId": "123456",
	"TotalRefund": {
		"Value": "1077.60",
		"Currency": "USD"
	},
	"TotalPrice": {
		"Value": "1077.60",
		"Currency": "USD"
	},
	"TotalPenalty": {
		"Value": "0.00",
		"Currency": "USD"
	},
	"CancellationDetails": [{
		"RoomConfirmation": "6c5ec779-4e9d-4bbc-9662-3a0627bb85bd",
		"CancelConfirmationNumber": "781235166",
		"CancellationDate": "2022-09-05T20:59:00+00:00",
		"Refund": {
			"Value": "1077.60",
			"Currency": "USD",
			"Type": "Full"
		}
	}],
	"Links": {
		"WebItinRetrieve": {
			"Href": "https://www.expedia.com/trips/79018078565?userToken=c87KNicNu6aaJQUy4R6CmFHwhXT2W6vHsRtVYpcXkritnABGKVA54n4PFs2RyHJJc09Wffl6zPWvUqwWBBxYGI-ZvK2e0DQ2erI"
		},
		"ApiItinRetrieve": {
			"Accept": "application/vnd.exp-hotel.v3+json",
			"Method": "GET",
			"Href": "https://apim.expedia.com/hotels/bookings/79018078565"
		}
	}
}

Hotel Cancel Response for Three Rooms

Request URL

https://apim.expedia.com/hotels/bookings/79018103010

Response Message

{
	"TransactionId": "802ad19d-0010-47d1-91d1-7d53b873b721",
	"ItineraryNumber": 79018103010,
	"PartnerConfirmationNumber": "hello123",
	"PartnerAgentId": "123456",
	"TotalRefund": {
		"Value": "3232.80",
		"Currency": "USD"
	},
	"TotalPrice": {
		"Value": "3232.80",
		"Currency": "USD"
	},
	"TotalPenalty": {
		"Value": "0.00",
		"Currency": "USD"
	},
	"CancellationDetails": [{
			"RoomConfirmation": "1b36922c-8f37-47fe-8858-2f7da8d58ee9",
			"CancelConfirmationNumber": "781235263",
			"CancellationDate": "2022-09-05T21:05:00+00:00",
			"Refund": {
				"Value": "1077.60",
				"Currency": "USD",
				"Type": "Full"
			}
		},
		{
			"RoomConfirmation": "9c6e567b-d786-4d9d-818b-974c515cc342",
			"CancelConfirmationNumber": "781235264",
			"CancellationDate": "2022-09-05T21:05:00+00:00",
			"Refund": {
				"Value": "1077.60",
				"Currency": "USD",
				"Type": "Full"
			}
		},
		{
			"RoomConfirmation": "cffa63d6-fb21-4c5e-a15c-ca66230ccb4d",
			"CancelConfirmationNumber": "781235265",
			"CancellationDate": "2022-09-05T21:05:00+00:00",
			"Refund": {
				"Value": "1077.60",
				"Currency": "USD",
				"Type": "Full"
			}
		}
	],
	"Links": {
		"WebItinRetrieve": {
			"Href": "https://www.expedia.com/trips/79018103010?userToken=plNsBAdxk3K3fwSSzMBdGO1Zi0JpcQp87fua9qlhnwEdlyyz3kMl9Y4pgu-qXCF6iFd-UyGdXogUrWrexGr1_SiLxufSCDdxF9k"
		},
		"ApiItinRetrieve": {
			"Accept": "application/vnd.exp-hotel.v3+json",
			"Method": "GET",
			"Href": "https://apim.expedia.com/hotels/bookings/79018103010"
		}
	}
}

Hotel Cancel Response for One Room - With Coupon

Request URL

https://apim.expedia.com/hotels/bookings/79018078565

Response Message

{
	"TransactionId": "339805e2-3610-4e80-a47c-a7c7131ad8f2",
	"ItineraryNumber": 790008033721,
	"PartnerConfirmationNumber": "hello123",
	"PartnerAgentId": "123456",
	"TotalRefund": {
		"Value": "398.99",
		"Currency": "GBP"
	},
	"TotalPrice": {
		"Value": "398.99",
		"Currency": "GBP"
	},
	"TotalPenalty": {
		"Value": "0.00",
		"Currency": "GBP"
	},
	"CancellationDetails": [{
		"RoomConfirmation": "f8521351-ad2b-4f41-a426-a04a40310d69",
		"CancelConfirmationNumber": "781908413",
		"CancellationDate": "2022-09-22T07:17:00+00:00",
		"Refund": {
			"Value": "398.99",
			"Currency": "GBP",
			"Type": "Full"
		}
	}],
	"Links": {
		"WebItinRetrieve": {
			"Href": "https://www.expedia.co.uk/trips/790008033721?userToken=9eCq-rS-TEXgb1PNhLdiNGXkcac0qUjZ-8yZStL8RQM9vMUY8NU3201HKCAFhoSvF1jBUTr9ClU1bh5Bt_GQqsX-tPWwbYxS798V"
		},
		"ApiItinRetrieve": {
			"Accept": "application/vnd.exp-hotel.v3+json",
			"Method": "GET",
			"Href": "https://apim.expedia.com/hotels/bookings/790008033721"
		}
	},
	"AppliedCoupon": {
		"Code": "EwsTestUKS13",
		"Discount": {
			"Value": "13.00",
			"Currency": "GBP"
		}
	}
}

Hotel Cancel Response for One Room with Prices Returned in Local Currency

Request URL

https://apim.expedia.com/hotels/bookings/790520968636

Response Message

{
	"TransactionId": "7f5d42d3-c3f9-48a9-8777-007ed85103d2",
	"ItineraryNumber": 790520968636,
	"PartnerConfirmationNumber": "hello123",
	"PartnerAgentId": "123456",
	"TotalRefund": {
		"Value": "32739.40",
		"Currency": "JPY"
	},
	"TotalRefundInHotelLocalCurrency": {
		"Value": "6872250.00",
		"Currency": "VND"
	},
	"TotalPrice": {
		"Value": "49109.10",
		"Currency": "JPY"
	},
	"TotalPriceInHotelLocalCurrency": {
		"Value": "10308375.00",
		"Currency": "VND"
	},
	"TotalPenalty": {
		"Value": "16369.70",
		"Currency": "JPY"
	},
	"TotalPenaltyInHotelLocalCurrency": {
		"Value": "3436125.00",
		"Currency": "VND"
	},
	"CancellationDetails": [{
		"RoomConfirmation": "885c38e7-76e7-47ea-9fcd-7eb7472ca756",
		"CancelConfirmationNumber": "783438039",
		"CancellationDate": "2022-10-31T02:11:00+00:00",
		"Refund": {
			"Value": "32739.40",
			"Currency": "JPY",
			"Type": "Partial"
		},
		"RefundInHotelLocalCurrency": {
			"Value": "6872250.00",
			"Currency": "VND",
			"Type": "Partial"
		}
	}],
	"Links": {
		"WebItinRetrieve": {
			"Href": "https://www.expedia.co.jp/trips/790520968636?userToken=EGqG9L_q5CUFEqhPMMOpV2hbqmVIwlanJ6vl3rqk4vWhlD9YxiIZ0Yx0iNc55FpsXL6EwdMcqmeq_HG_V1t91xODVC09sTtkLW6y"
		},
		"ApiItinRetrieve": {
			"Accept": "application/vnd.exp-hotel.v3+json",
			"Method": "GET",
			"Href": "https://apim.expedia.com/hotels/bookings/790520968636"
		}
	}
}

Error Codes

Common Error Codes

HTTP Status CodeError CodeError ResponseCause
400INVALID_ITIN_NUMThe itinerary number is invalid.Invalid itinerary number format.
400ITINERARY_NOT_FOUNDInvalid Input. Unable to retrieve data for Itinerary Number : %s.The itinerary number cannot be found.
400ITINERARY_NOT_FOUND_FOR_PARTNERItinerary %s was not found for client key %s.The itinerary does not belong to the partner.
400ITIN_NOT_ASSOCIATED_WITH_CLIENT_KEYThe itinerary %s is not associated with client key %s.The itinerary belongs to a different Point of Sale.
400BOOKING_ALREADY_CANCELLEDThe booking was already canceled.Trying to cancel a previously cancelled booking.
400CANCEL_BOOKING_NOT_FOUNDThe trip is not booked.This trip was not booked.
400INVALID_CONFIRMATION_NUMBERSThe confirmation numbers are Empty string.The confirmation number that you entered does not seem to be valid.
400CONFIRMATION_NUMBERS_NOT_FOUNDThe confirmation numbers are invalid.Cancellation failed. The order lineid is invalid
400CANCEL_APPLICATION_ERRORCancellation failed. Application Error.There was an error with your cancellation and your trip is most likely not cancelled.
400INVALID_USER_CREDENTIALSUser credentials are either missing or invalid.User info authentication failed.
400INVALID_PARTNER_META_DATAThe size of partner meta data exceeds the limitPartnerMetaData exceeding 20,000 characters.
400RETRIEVE_ITINERARY_ERRORUnable to retrieve data for itinerary number %s. Please try again later.There was an error with your itinerary retrieval and the record cannot be accessed now.
500CANCEL_BOOKING_ITIN_EXPIREDCancellation failed. The itinerary date is in the past.You are trying to cancel an itinerary for a stay that has already occurred.
500INVALID_CANCEL_HOTEL_RESERVATION_STATECancellation failed. The booking is currently being processed. Please try again later.You are trying to cancel a booking that is in the process of being booked.
500CANCEL_CANNOT_ON_LINECancellation failed. Cannot cancel hotel online.The booking may not be cancelled via the API.
500CANCEL_PENALTY_EXCEED_SELL_PRICECancellation failed. Cancel-Penalty exceed the sell price.The cancellation fee exceeds the purchase price of the booking.
500CANCEL_ERROR_DUE_TO_CANCELATION_POLICYCancellation failed. Unable to cancel hotel due to hotel cancellation policy.You are trying to cancel a booking that is not able to be canceled.
500CANCEL_ROLLBACK_SCHEDULED_PAYMENT_FAILEDCancellation failed. Failed to cancel or rollback scheduled payments during a hotel cancellation.You are trying to cancel a booking that is not able to be canceled.
500CANCEL_HOTEL_RESERVATION_CONFIRM_FAILEDCancellation failed. Hotel reservation cannot be confirmed. Please try again later.You are trying to cancel a reservation that is not able to be canceled.
500CANCEL_HOTEL_RESERVATION_CANNOT_BE_CANCELEDCancellation failed. Hotel reservation cannot be cancelled. Cancellation made during cancellation window.You are trying to cancel a reservation that is not able to be canceled.
400INVALID_CANCEL_REQUEST_BODYThe size of partner meta data exceeds the limit.
400BOOKING_ALREADY_CANCELEDThe booking was already canceled.

API details

Here, you can explore the endpoint definitions for this API, then go to the API Explorer to try out all the XAP endpoints, download OpenAPI specs, or download our Postman collections. Testing with one or all of these options will give you an understanding of how the examples and schema definitions compare to the actual output.


Did you find this page helpful?
How can we improve this content?
Thank you for helping us improve!