The booking retrieval method returns the full information of a booking.

Table of Contents
  1. URL Endpoint
  2. Guidelines
  3. JSON Response Schema
  4. JSON Response Example

URL Endpoint

/reservation/{res_id}

Guidelines

Channel bookings

WebHotelier retrieves and imports bookings from 3d party Channel Manager systems.

Channel bookings can be distinguished by the channelstream flag in the response.

To distinguish the booking channel, use the bookInfo.source_id & bookInfo.source fields. To get a list of source ids that correspond to channels, use the Booking Sources API method.

Channel resevations may have some additional fields with data returned from the 3d party Channel Manager system. Such fields are:

  • external_id
  • roomStay.externalRateInfo
  • guest_names
  • policies.external
  • special_requests
  • additional_fields

You should parse, store and show the above fields to your system as they may contain special additional information that can not be reflected via the mapped WebHotelier rate.

More that one channel bookings may share the same external_id. This is because Channel Managers may split a multi-room booking into several single-room bookings. Each one of these split bookings is a unique WebHotelier booking with unique WebHotelier confirmation number. You should always import and uniquely distinguish a booking based on the WebHotelier confirmation number.

Channel bookings may also be imported manually by the hotelier via WebHotelier Legolas. These bookings will have the channelstream flag set to false, offline flag set to true and bookInfo.source_id set to the corresponding channel.

Booking Status

If you are only interested in knowing whether a booking is confirmed or not, the "status" boolean field is enough (1=Confirmed, 0=Cancelled). If however you want to get into more details about the reason of the status, you should also look for the "statusCode".

A booking can have one of the following statuses, which is returned in the "statusCode" field:

  • CANCELLED
  • CONFIRMED
  • ONHOLD
  • PURGED

From the above statuses, CONFIRMED and ONHOLD have reduced the number of available units for the room type. These two statuses have no other difference between them besides the code itself. An ONHOLD booking may be subsequently changed to CONFIRMED or CANCELLED. CANCELLED and PURGED have released the available units that the booking had initially allocated.

Booking Search API will only return CANCELLED, CONFIRMED or ONHOLD bookings.

JSON Response Schema

{
	"method": "https://rest.reserve-online.net/reservation/10123456"
	"http_method": "GET",
	"http_code": 200,
	"error_code": "OK",
	"error_msg": "",
	"params": [],
	"data":{
		"id":INTEGER, // Booking confirmation number
		"external_id":STRING, // (Optional) External reference id
		"property":STRING, // Property code
		"status":BOOLEAN, // 1=Confirmed, 0=Cancelled
		"statusCode":STRING, // Enumerated value: CANCELLED, CONFIRMED, ONHOLD, PURGED
		"cancellation_reason":STRING, // (Optional, exists only if status=0 and cancellation reason has been given)
		"offline":BOOLEAN, // 1=Booking was imported via Legolas or Channel Manager, 0=Direct booking
		"channelstream":BOOLEAN, // 1=Channel booking, 0=Other booking
		"roomStay":{
			"roomType":STRING, // Room type code
			"roomName":STRING, // Room type name
			"rateName":STRING, // Rate name
			"rateDesc":STRING, // Rate short description
			"rateID":INTEGER, // Rate ID
			"board":INTEGER, // Board ID(can be empty/null). See Board Types
			"externalRateInfo":STRING, // (Optional) Rate information as provided by third party systems
			"rooms":INTEGER, // Number of rooms
			"from":ISO 8601, // Check-in date
			"to":ISO 8601, // Check-out date
		},
		"pricing":{
			"price":MONEY, // Total booking price
			"subTotal":MONEY, // Rooms price (exclusive of extras and taxes)
			"extras":MONEY, // Extras name
			"taxes":MONEY, // Taxes price
			"excluded_charges":MONEY, // Excluded charges collected separately by the hotel (e.g. tourism tax)
			"currency":ISO 4217, // Price currency code
			"retail":MONEY // (Optional) For B2B bookings only where NET rate may be derived from retail.
		},
		"bookInfo":{
			"bookDate":ISO 8601, // Booking date timestamp in ISO 8601 UTC format
			"bookingCode":STRING, // Special booking code used
			"voucherCode":STRING, // Special voucher code used
			"voucherCredit":{ // (Optional)
				"amount":MONEY, // Credit voucher total amount
				"currency":ISO 4217 // Credit voucher currency code
			},
			"referer":STRING, // Referer hostname
			"source":STRING, // Booking source name(refers also to channels like Booking.com, Expedia, etc)
			"source_id":INTEGER, // Booking source unique id
			"agent":STRING, // Travel agent name
			"agent_id":INTEGER, // Travel agent unique id
			"remote_ip":IP, // User ip (IPv4)
			"remote_country":ISO 3166-1-alpha-2, // User country
		},
		"clientInfo":{
			"firstName":STRING,
			"lastName":STRING,
			"email":STRING,
			"tel":STRING,
			"country":ISO 3166-1-alpha-2,
			"address":STRING,
			"postal":STRING,
			"location":STRING,
			"region":STRING,
			"company":STRING,
			"purpose":STRING,
			"remarks":STRING,
			"arrival":{ // (Optional)
				"date":ISO 8601, // Arrival date
				"time":STRING, // Arrival time (HH:MM)
				"details":STRING // Arbitrary free text details
			},
			"departure":{ // (Optional)
				"date":ISO 8601, // Departure date
				"time":STRING, // Departure time (HH:MM)
				"details":STRING // Arbitrary free text details
			}
		},
		"guest_names":[], STRING[], // (Optional) A list of guest names as provided by 3d party systems*
		"constraints":{
			"minStay":INTEGER, // Minimum stay in days
			"maxStay":INTEGER, // Maximum stay in days
			"freeCancelDays":INTEGER, // Number of days before check-in that free cancellation is allowed
			"freeCancelExpiry":ISO 8601, // Cancellation date timestamp in ISO 8601 UTC format
		},
		"policies":{
			"cancellation":STRING, // Cancellation policy
			"payment":STRING, // Payment policy
			"external":STRING, // (Optional) Additional booking policy as provided by 3d party systems
			"payments":[
				{
					"due":ISO 8601, // Payment due date 
					"amount":MONEY // Amount to be paid until the above date
				}
			],
			"cancellation_fees": [
				{
					"after":ISO 8601, // Cancellation fee is applied if the reservation is cancelled after this date
					"fee":MONEY // Cancellation fee amount that applies after the above date
				}
			]
		},
		"rooms":[
			{
				"roomNo":INTEGER,
				"adults":INTEGER,
				"children":INTEGER,
				"infants":INTEGER,
				"rates":[
					{
						"date":ISO 8601,
						"price":MONEY, // Room daily price
						"price_with_tax":MONEY, // Room daily price with tax included
						"retail":MONEY // (Optional) For B2B bookings only where NET rate may be derived from retail.
					}
				],
				"price":MONEY, // Total room price
				"price_with_tax":MONEY // Total room price with tax included
			}
		],
		"extras":[
			{
				"id":INTEGER,
				"name":STRING,
				"quantity":INTEGER,
				"price":MONEY, // Total extra price
				"pricing":{
					"unitPrice":MONEY, // Single extra unit price
					"perRoom":BOOLEAN, // 1=True, 0=False
					"perDay":BOOLEAN, // 1=True, 0=False
					"perAdult":BOOLEAN, // 1=True, 0=False
					"perChild":BOOLEAN, // 1=True, 0=False
					"perInfant":BOOLEAN // 1=True, 0=False
				}
			}
		],
		"taxes":[
			{
				"order":INTEGER,
				"description":STRING,
				"included":BOOLEAN, // 1=True, 0=False
				"type":STRING, // ABS=Flat Amount, MU_PER=Percentage
				"value":NUMBER, // Tax value, may reflect percentage or flat amount
				"pricing":{
					"perRoom":BOOLEAN, // 1=True, 0=False
					"perDay":BOOLEAN, // 1=True, 0=False
					"perAdult":BOOLEAN, // 1=True, 0=False
					"perChild":BOOLEAN, // 1=True, 0=False
					"perInfant":BOOLEAN // 1=True, 0=False
				}
			}
		],
		"excluded_charges":[
			{
				"description":STRING,
				"type":STRING, // ABS=Flat Amount, MU_PER=Percentage
				"value":NUMBER, // Charge value, may reflect percentage or flat amount
				"pricing":{
					"perRoom":BOOLEAN, // 1=True, 0=False
					"perDay":BOOLEAN, // 1=True, 0=False
					"perAdult":BOOLEAN, // 1=True, 0=False
					"perChild":BOOLEAN, // 1=True, 0=False
					"perInfant":BOOLEAN // 1=True, 0=False
				}
			}
		],
		"preferences":[
			{
				"id":INTEGER,
				"type":STRING,
				"name":STRING,
				"title":STRING,
				"value":STRING
			}
		],
		"special_requests":STRING, // (Optional) Additional requests/guest preferences as provided by 3d party system
		"channel_notes":STRING, // (Optional) Additional notes for hotelier as provided by 3d party system
		"additional_fields":[ // (Optional)
			{
				"code":STRING, // Arbitrary varchar describing the information type of the value
				"value":STRING
			}
		],
		"changes":[
			{
				"userType":STRING,
				"userName":STRING,
				"date":ISO 8601, // Modification date timestamp in ISO 8601 UTC format
				"type":STRING, // MOD=Modification, CL=Cancellation, RES=Restoration (from cancelled to confirmed), CF=Confirmation
			}
		]
	}
}
	

* Total number of guest names may differ from total occupancy

JSON Response Example