Booking Cancellation

The cancel method is a DELETE method that can be used in two different cases:

  • To simulate a booking cancellation

  • To cancel the booking

ENDPOINT: DELETE  https://api.test.hotelbeds.com/hotel-api/1.0/bookings

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

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: DELETE https://api.hotelbeds.com/hotel-api/1.0/bookings/1-2553840?cancellationFlag=SIMULATION

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

 

Cancellation 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, paxes, and rates of the cancelled booking

 

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 Hotebeds 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/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/paxes/pax/@name String Pax name
bookingCancellationRS/booking/hotel/rooms/room/paxes/pax/@surname String Pax surname

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 date from

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

Date

Beginning date when the amount will be charged

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

Float

Amount that will be charged after date from 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

 

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="1526"
        timestamp="2016-06-20 15:04:30.681"
        requestHost="23.23.79.236"
        serverId="sa3RKSJACHXE79K.env"
        environment="[int, ignite]"
        release="d72fd95970efd710ead5638cc0ca2a1734481a57"/>
    <booking
        reference="197-2827755"
        cancellationReference="VAKSEZJBVF"
        clientReference="TEST"
        creationDate="2016-06-20"
        status="CANCELLED"
        totalSellingRate="0.00"
        totalNet="0.00"
        pendingAmount="0.00"
        currency="EUR">
        <modificationPolicies cancellation="false" modification="false"/>
        <holder name="KELLY" surname="DESJARDINS"/>
        <hotel
            checkIn="2016-12-02"
            checkOut="2016-12-03"
            code="212995"
            name="Paris Bastille"
            categoryCode="3EST"
            categoryName="3 STARS"
            destinationCode="PAR"
            destinationName="Paris"
            zoneCode="14"
            zoneName="Arr8/16:Etoile-C.Elysées/Trocadero"
            latitude="48.850979"
            longitude="2.369941"
            totalNet="0.00"
            currency="EUR"
            cancellationAmount="0.00">
            <rooms>
                <room
                    status="CANCELLED"
                    id="1"
                    code="DBT.ST"
                    name="Double or Twin STANDARD">
                    <paxes>
                        <pax roomId="1" type="AD"/>
                        <pax roomId="1" type="AD"/>
                    </paxes>
                    <rates>
                        <rate
                            rateClass="NOR"
                            net="0.00"
                            rateComments="Extra beds on demand NO. Wi-fi YES (without additional debit notes)   . "
                            paymentType="AT_WEB"
                            packaging="false"
                            boardCode="RO"
                            boardName="ROOM ONLY"
                            rooms="1"/>
                    </rates>
                </room>
            </rooms>
            <supplier name="HOTELBEDS SPAIN, S.L.U." vatNumber="ESB28916765"/>
        </hotel>
    </booking>
</bookingCancellationRS>

 

 

Response JSON example

 

{
	"auditData": {
		"processTime": "6568",
		"timestamp": "2017-06-27 13:30:32.360",
		"requestHost": "23.23.79.236",
		"serverId": "ws3xmi01",
		"environment": "[itest]",
		"release": "2844",
		"token": "82ba46f7-2a7c-4995-add9-f880b437ab99",
		"internal": "null||||0|0||||||||||||0||||0||0|gaxuxedesad7nwkyyf4f7yxc||"
	},
	"booking": {
		"reference": "1-2260946",
		"cancellationReference": "GVCNWSHGYJ",
		"clientReference": "TEST",
		"creationDate": "2017-06-22",
		"status": "CANCELLED",
		"modificationPolicies": {
			"cancellation": false,
			"modification": false
		},
		"creationUser": "gaxuxedesad7nwkyyf4f7yxc",
		"holder": {
			"name": "HOLDER NAME",
			"surname": "HOLDER SURNAME"
		},
		"hotel": {
			"checkOut": "2017-10-11",
			"checkIn": "2017-10-10",
			"code": 66699,
			"name": "Blau Porto Petro Beach Resort & Spa",
			"categoryCode": "4EST",
			"categoryName": "4 STARS",
			"destinationCode": "PMI",
			"destinationName": "Palma de Mallorca",
			"zoneCode": 92,
			"zoneName": "Palma de Mallorca",
			"latitude": "47.497221",
			"longitude": "19.058115",
			"rooms": [{
				"status": "CANCELLED",
				"id": 1,
				"code": "DUS-E10-ST",
				"name": "DOUBLE SINGLE USE STANDARD",
				"paxes": [{
					"roomId": 1,
					"type": "AD"
				}],
				"rates": [{
					"rateClass": "NOR",
					"net": "1518.32",
					"rateComments": "Car park YES (with additional debit notes) 15 EUR Per unit/night. Check-in hour 14:00 – 23:59. Deposit on arrival   . Early departure. Identification card at arrival. ",
					"paymentType": "AT_WEB",
					"packaging": false,
					"boardCode": "RO",
					"boardName": "ROOM ONLY",
					"rateBreakDown": {
						"rateSupplements": [{
							"code": "C",
							"name": "UNKNOWN",
							"from": "2017-10-10",
							"to": "2017-10-11",
							"amount": "0.000",
							"nights": 1
						}]
					},
					"rooms": 1
				}]
			}],
			"totalNet": "0.000",
			"currency": "EUR",
			"supplier": {
				"name": "HOTELBEDS SPAIN, S.L.U.",
				"vatNumber": "ESB28916765"
			},
			"cancellationAmount": 0.000
		},
		"totalNet": 0.000,
		"pendingAmount": 0.000,
		"currency": "EUR"
	}
}

Docs Navigation