BookingCancellation

BookingCancellation is a DELETE method operation that can be used in two different cases:

  • To simulate a booking cancellation
  • To cancel the booking

NOTE:Cancellations always take into account day and time of the destination in order to calculate what cancellation policy should be apply.

BookingCancellation Request

Endpoint

DELETE https://api.test.hotelbeds.com/hotel-api/1.0/bookings/{{booking_reference}}
TIMEOUT: 120 seconds

 

Request parameters

Parameter Type Mandatory Description
language String N Response language
booking_reference String Y

Booking reference number taken from the confirmation response or from the booking list function.

Format: XXX-XXXXXX

cancellationFlag String N

Type of cancellation method to be used. Values:

SIMULATION: To simulate a booking cancellation

CANCELLATION: To cancel the booking (default value if not specified)

Request examples

FOR SIMULATION: https://api.hotelbeds.com/hotel-api/1.0/bookings/1-2553840?cancellationFlag=SIMULATION

FOR CANCELLATION: https://api.hotelbeds.com/hotel-api/1.0/bookings/1-2553840?cancellationFlag=CANCELLATION

 

BookingCancellation Response

When the booking is cancelled, details of the cancelled booking are returned with the following information:

  • The booking status: CANCELLED
  • Cancellation Reference
  • Cancellation fees if applicable
  • Hotel, rooms, and rates of the cancelled booking

Names and surnames of passengers of cancelled bookings are not shown, as cancellation process deletes names of passengers and only passanger types remain in the passenger list of each room.

 

Response parameters

Node/Attribute Type Description
bookingCancellationRS Element Top Element
bookingCancellationRS/auditData Element Relevant internal information
bookingCancellationRS/auditData/@processTime Float Server process time in milliseconds
bookingCancellationRS/auditData/@timeStamp Date Date/time when the request has been processed
bookingCancellationRS/auditData/@requestHost String IP address of the system host
bookingCancellationRS/auditData/@serverId String Server code or ID (for internal use)
bookingCancellationRS/auditData/@environment String Environment where the request has been sent and processed
bookingCancellationRS/auditData/@release String Release version identifier
bookingCancellationRS/auditData/@token String Token identifier of the operation
bookingCancellationRS/auditData/@internal String Internal identifier of the parameters of the operation
bookingCancellationRS/booking Element Booking element

bookingCancellationRS/booking/@reference

String

Booking reference

Format: XXX-XXXXXX

bookingCancellationRS/booking/@cancellationReference

String

Cancellation reference

bookingCancellationRS/booking/@clientReference String Client internal booking reference

bookingCancellationRS/booking/@creationDate

Date

Booking creation date

Format: YYYY-MM-DD

bookingCancellationRS/booking/@cancellationDate

Date

Booking cancellation date

Format: YYYY-MM-DD

bookingCancellationRS/booking/@status String

Booking status:

  • CONFIRMED
  • CANCELLED
bookingCancellationRS/booking/@creationUser String apiKey used to make the booking

bookingCancellationRS/booking/@totalNet

Float

Total amount of the booking

bookingCancellationRS/booking/@pendingAmount Float Remaining amount to be paid

bookingCancellationRS/booking/@currency

String

Currency of the amount to be paid

bookingCancellationRS/booking/modificationPolicies Element

Information regarding the allowed modifications to the booking

bookingCancellationRS/booking/modificationPolicies/@cancellation Boolean

Indicates if the booking can be cancelled

bookingCancellationRS/booking/modificationPolicies/@modification Boolean Indicates if the booking can be modified
bookingCancellationRS/booking/holder Element Information of the booking holder
bookingCancellationRS/booking/holder/@name String Booking holder name
bookingCancellationRS/booking/holder/@surname String Booking holder surname

bookingCancellationRS/booking/hotel

Element

Element that contains information about the hotel and associated rates

bookingCancellationRS/booking/hotel/@checkOut Date

Check-out date Format

YYYY-MM-DD

bookingCancellationRS/booking/hotel/@checkIn Date

Check-in date Format:

YYYY-MM-DD

bookingCancellationRS/booking/hotel/@code Int Hotelbeds internal hotel code

bookingCancellationRS/booking/hotel/@name

String

Hotel name

bookingCancellationRS/booking/hotel/@categoryCode

String

Hotel category

bookingCancellationRS/booking/hotel/@categoryName String Category name

bookingCancellationRS/booking/hotel/@destinationCode

String

Destination code for hotel location

bookingCancellationRS/booking/hotel/@destinationName String Destination name for hotel location

bookingCancellationRS/booking/hotel/@zoneCode

Int

Zone code for hotel location

bookingCancellationRS/booking/hotel/@zoneName String Zone name for hotel location
bookingCancellationRS/booking/hotel/@latitude Float Latitude data for geolocation
bookingCancellationRS/booking/hotel/@longitude Float Longitude data for geolocation
bookingCancellationRS/booking/hotel/@totalNet Float Total amount of the booking

bookingCancellationRS/booking/hotel/@currency

String

Client currency 

bookingCancellationRS/booking/hotel/@cancellationAmount Int Price to pay as cancellation charge

bookingCancellationRS/booking/hotel/rooms

Array of room elements

List of rooms available for a particular hotel

bookingCancellationRS/booking/hotel/rooms/room/

Element

Element that contains information about the room and associated rates

bookingCancellationRS/booking/hotel/rooms/room/@status

String

Booking status:

  • CONFIRMED
  • CANCELLED
bookingCancellationRS/booking/hotel/rooms/room/@id Int Room reservation identifier

bookingCancellationRS/booking/hotel/rooms/room/@code

Int

Internal room code

bookingCancellationRS/booking/hotel/rooms/room/@name String Room name/description
bookingCancellationRS/booking/hotel/rooms/room/@supplierReference String Booking reference of the booking/room for external product supplier bookings
bookingCancellationRS/booking/hotel/rooms/room/paxes Array of pax elements List of paxes for the room
bookingCancellationRS/booking/hotel/rooms/room/paxes/pax Element Element that describes pax information
bookingCancellationRS/booking/hotel/rooms/room/paxes/pax/@roomId Int Room where the pax is located
bookingCancellationRS/booking/hotel/rooms/room/paxes/pax/@type String

Pax type 

Two values are permitted for the attribute:

  • AD for adults
  • CH for child

bookingCancellationRS/booking/hotel/rooms/room/rates

Array of rate elements

List of rates for a particular hotel

bookingCancellationRS/booking/hotel/rooms/room/rates/rate

Element

Price information for a room type and board

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/@rateClass

String

Internal rate class type (NOR, NRF, SPE, OFE, PAQ ...)

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/@net

Float

Room net price

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/@rateComments String Rate comments that contain important information (max lenght = 4000 characters)

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/@paymentType

String

Identifies if it is pay at hotel or merchant 

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/@packaging

String

Identifies if the rate is for packaging

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/@boardCode

String

Internal board code

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/@boardName String Board name/description

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/@rooms

Int

Number of rooms requested with the same occupancy

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/cancellationPolicies

Array of policies elements

List of cancellation policies

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/cancellationPolicies/policy

Element

Cancellation policies

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/cancellationPolicies/policy/@amount

Float

Amount that will be charged after '@from' date

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/cancellationPolicies/policy/@from

String

Date from which the amount will be charged in ISO 8601 format (yyyy-MM-ddTHH:mm:ssZ)

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/cancellationPolicies/policy/@hotelAmount

Float

Amount that will be charged after '@from' date in hotel currency (for the pay at hotel model)

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/cancellationPolicies/policy/@hotelCurrency

String

Currency in which the booking must be paid on arrival

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown

Element

Rate breakdown element

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateDiscounts

Array of rateDiscounts elements

List of discounts for a particular rate

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateDiscounts/rateDiscount Element Discount element
bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateDiscounts/rateDiscount/@code Name Discount internal code
bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateDiscounts/rateDiscount/@name String Discount name/description
bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateDiscounts/rateDiscount/@amount Float Amount of the discount

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements

Array of rateSupplements elements

List of supplements for a particular rate

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements/rateSupplement

Element

Rate supplements element

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements/rateSupplement/@code Int Supplement code
bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements/rateSupplement/@name String Supplement name
bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements/rateSupplement/@from Date

Date from when the supplement begins to apply

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements/rateSupplement/@to Date Date that the supplement no longer applies

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements/rateSupplement/@amount

Float

Supplement amount

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements/rateSupplement/@nights

Int

Number of nights the supplement applies

bookingCancellationRS/booking/hotel/rooms/room/rates/rate/rateBreakDown/rateSupplements/rateSupplement/@paxNumber

Int

Number of paxes to whom the supplement applies

bookingCancellationRS/booking/hotel/supplier

Element

Element that contains supplier information

bookingCancellationRS/booking/hotel/supplier/@name

String

Supplier name

bookingCancellationRS/booking/hotel/supplier/@vatNumber

String

Supplier VAT number

bookingCancellationRS/booking/invoiceCompany Element Element that contains information about the invoice company
bookingCancellationRS/booking/invoiceCompany/@code String Code of the invoice company
bookingCancellationRS/booking/invoiceCompany/@name String Name of the invoice company
bookingCancellationRS/booking/invoiceCompany/@registrationNumber String Registration number of the invoice company
bookingCancellationRS/booking/remark String Booking comments

Response XML Example

<?xml version="1.0" encoding="UTF-8"?>
<bookingCancellationRS xmlns="http://www.hotelbeds.com/schemas/messages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://www.hotelbeds.com/schemas/messages">
	<auditData processTime="543" timestamp="2018-03-23 10:03:02.283" requestHost="212.66.164.12" serverId="sa37AUX3ROLBLIS.env" environment="[int]" release="5c2a98762e8da116cf86a57a17c9db9d2e4d80eb" token="b6f1f3b7-eeec-45b4-a3a5-fb4f577041c2" internal="null||||0|1||||||||||||1|||0|0||0|null|||"/>
	<booking reference="1-3816249" cancellationReference="XCUASHWWPL" clientReference="BRUNOTESTBOOKING" creationDate="2018-03-23" status="CANCELLED" creationUser="wuupfvswdqfz342cejxfv3ku" totalNet="0.00" pendingAmount="0.00" currency="EUR">
		<modificationPolicies cancellation="false" modification="false"/>
		<holder name="HOLDERFIRSTNAME" surname="HOLDERLASTNAME"/>
		<hotel checkOut="2018-04-24" checkIn="2018-04-23" code="229318" name="Hotel Hostal Cuba" categoryCode="4EST" categoryName="4 STARS" destinationCode="PMI" destinationName="Majorca" zoneCode="10" zoneName="Palma" latitude="39.570177" longitude="2.639077" totalNet="0.00" currency="EUR" cancellationAmount="0.00">
			<rooms>
				<room status="CANCELLED" id="1" code="JSU.ST" name="JUNIOR SUITE STANDARD" supplierReference="18431999M-MJ">
					<paxes>
						<pax roomId="1" type="AD"/>
						<pax roomId="1" type="AD"/>
					</paxes>
					<rates>
						<rate rateClass="NOR" net="0.00" sellingRate="0.00" hotelMandatory="true" rateComments="Car park NO   . Key Collection 15:00 – . Check-in hour 15:00 – 00:00. No hen/stag or any other parties allowed  – . " paymentType="AT_WEB" packaging="false" boardCode="BB" boardName="BED AND BREAKFAST" rooms="1" adults="2" children="0"/>
					</rates>
				</room>
			</rooms>
			<supplier name="HOTELBEDS SPAIN, S.L.U." vatNumber="ESB28916765"/>
		</hotel>
		<remark>Booking remarks are to be written here.</remark>
		<invoiceCompany code="E14" name="HOTELBEDS SPAIN, S.L.U" registrationNumber="ESB57218372"/>
	</booking>
</bookingCancellationRS>

Response JSON example

{
	"auditData": {
		"processTime": "803",
		"timestamp": "2018-03-23 09:40:59.157",
		"requestHost": "212.66.164.12",
		"serverId": "sa37AUX3ROLBLIS.env",
		"environment": "[int]",
		"release": "5c2a98762e8da116cf86a57a17c9db9d2e4d80eb",
		"token": "24b3b38c-8a53-44aa-9019-429534bf7c05",
		"internal": "null||||0|1||||||||||||1|||0|0||0|null|||"
	},
	"booking": {
		"reference": "1-3816248",
		"cancellationReference": "PPFPPJXXVZ",
		"clientReference": "BRUNOTESTBOOKING",
		"creationDate": "2018-03-23",
		"status": "CANCELLED",
		"modificationPolicies": {
			"cancellation": false,
			"modification": false
		},
		"creationUser": "wuupfvswdqfz342cejxfv3ku",
		"holder": {
			"name": "HOLDERFIRSTNAME",
			"surname": "HOLDERLASTNAME"
		},
		"hotel": {
			"checkOut": "2018-04-24",
			"checkIn": "2018-04-23",
			"code": 229318,
			"name": "Hotel Hostal Cuba",
			"categoryCode": "4EST",
			"categoryName": "4 STARS",
			"destinationCode": "PMI",
			"destinationName": "Majorca",
			"zoneCode": 10,
			"zoneName": "Palma",
			"latitude": "39.570177",
			"longitude": "2.639077",
			"rooms": [{
				"status": "CANCELLED",
				"id": 1,
				"code": "JSU.ST",
				"name": "JUNIOR SUITE STANDARD",
				"supplierReference": "16923904M-MJ",
				"paxes": [{
					"roomId": 1,
					"type": "AD"
				},
				{
					"roomId": 1,
					"type": "AD"
				}],
				"rates": [{
					"rateClass": "NOR",
					"net": "0.00",
					"sellingRate": "0.00",
					"hotelMandatory": true,
					"rateComments": "Car park NO   . Key Collection 15:00 – . Check-in hour 15:00 – 00:00. No hen/stag or any other parties allowed  – . ",
					"paymentType": "AT_WEB",
					"packaging": false,
					"boardCode": "BB",
					"boardName": "BED AND BREAKFAST",
					"rooms": 1,
					"adults": 2,
					"children": 0
				}]
			}],
			"totalNet": "0.00",
			"currency": "EUR",
			"supplier": {
				"name": "HOTELBEDS SPAIN, S.L.U.",
				"vatNumber": "ESB28916765"
			},
			"cancellationAmount": 0
		},
		"remark": "Booking remarks are to be written here.",
		"invoiceCompany": {
			"code": "E14",
			"company": "HOTELBEDS SPAIN, S.L.U",
			"registrationNumber": "ESB57218372"
		},
		"totalNet": 0,
		"pendingAmount": 0,
		"currency": "EUR"
	}
}

Docs Navigation