CHR API-GATEWAY Booking
in order to create a booking request first you need to create a #Hotel search for booking /
#Package search for booking / #Circuit search for booking the search_id,result_id and meal_plan_id will be used in the booking request
Request info
Item |
Description |
URL |
/v1/bookings |
Type |
POST |
POST params
Item |
Possible values |
Explanation |
bookings |
|
the booking object suports multiple bookings in one request for one costumer |
bookings.0 |
|
the first booking item |
bookings.0.search_id |
|
search id |
bookings.0.result_id |
|
result id |
bookings.0.meal_plan_id |
|
meal plan id |
bookings.0.type |
hotel / package / circuit |
|
bookings.0.pax_info |
|
tourist list and tourist personal data |
bookings.0.pax_info.0 |
|
first tourist |
bookings.0.pax_info.0.type |
adult / child / infant |
|
bookings.0.pax_info.0.title |
Mr / Mrs |
bookings.0.pax_info.0.first_name |
|
first name |
bookings.0.pax_info.0.last_name |
|
last name |
bookings.0.pax_info.0.birth_date |
|
birthdate (Y-m-d) |
bookings.0.pax_info.0.gender |
male / female |
|
customer_info |
|
customer info |
customer_info.type |
personal / company |
|
customer_info.title |
Mr / Mrs |
|
customer_info.first_name |
|
customer first name |
customer_info.last_name |
|
customer last name |
customer_info.email |
|
customer email |
customer_info.phone |
|
customer phone |
customer_info.street |
|
customer street |
customer_info.city |
|
customer city |
customer_info.zip_code |
|
customer zip_code |
customer_info.address |
|
customer address |
customer_info.county |
|
customer county |
currency |
RON / EUR |
|
_includes |
items |
|
Response
Item |
Description |
id |
booking id |
price |
booking price |
vat |
booking vat |
currency |
booking currency |
_includes.data.items.id |
booking item id |
_includes.data.items.search_id |
booking item search id |
_includes.data.items.result_id |
booking item search result_id |
_includes.data.items.room_id |
booking item search room_id |
_includes.data.items.meal_plan_id |
booking item search meal_plan_id |
_includes.data.items.currency |
booking item currency |
_includes.data.items.type |
booking item type |
_includes.data.items.item_id |
booking item circuit/hote/package id |
_includes.data.items.label |
booking item circuit/hote/package label |
_includes.data.items.description |
booking item circuit/hote/package description |
_includes.data.items.gross |
booking item gross price |
_includes.data.items.tax |
booking item tax |
_includes.data.items.tax |
booking item tax |
_includes.data.items.status |
booking item status |
Example
Request
curl --request POST \
--url 'URL/v1/bookings/17500?_includes=items' \
--header 'Authorization: Bearer TOKEN' \
--header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
--form 'bookings[0][search_id]=87812306' \
--form 'bookings[0][result_id]=639988703' \
--form 'bookings[0][meal_plan_id]=475' \
--form 'bookings[0][type]=hotel' \
--form 'bookings[0][pax_info][0][type]=adult' \
--form 'bookings[0][pax_info][0][title]=Mr' \
--form 'bookings[0][pax_info][0][first_name]=TEST' \
--form 'bookings[0][pax_info][0][last_name]=test' \
--form 'bookings[0][pax_info][0][birth_date]=1971-09-08' \
--form 'bookings[0][pax_info][0][gender]=male' \
--form 'bookings[0][pax_info][1][type]=adult' \
--form 'bookings[0][pax_info][1][first_name]=TEST' \
--form 'bookings[0][pax_info][1][last_name]=TEST' \
--form 'bookings[0][pax_info][1][birth_date]=1970-04-25' \
--form 'bookings[0][pax_info][1][gender]=female' \
--form 'customer_info[type]=personal' \
--form 'customer_info[title]=Mr' \
--form 'customer_info[first_name]=TEST' \
--form 'customer_info[last_name]=TEST' \
--form 'customer_info[email]=victor@thewebroom.ro' \
--form 'customer_info[phone]=0040728009896' \
--form currency=RON \
--form _includes=items \
--form 'bookings[0][pax_info][1][title]=Mrs' \
--form 'customer_info[street]=null' \
--form 'customer_info[city]=Sector 1' \
--form 'customer_info[zip_code]=000000' \
--form 'customer_info[address]=Str. Baiculesti nr. 9 bl. A1 sc. B ap. 74 TEST' \
--form 'customer_info[county]=Bucuresti' \
--form 'bookings[0][pax_info][2][type]=child' \
--form 'bookings[0][pax_info][2][title]=Mrs' \
--form 'bookings[0][pax_info][2][first_name]=TEST' \
--form 'bookings[0][pax_info][2][last_name]=TEST' \
--form 'bookings[0][pax_info][2][birth_date]=2012-08-19' \
--form 'bookings[0][pax_info][2][gender]=female'
Response
{
"data": {
"id": 17500,
"price": "1569.00",
"vat": "0.00",
"currency": "EUR",
"created_at": "2021-05-28T22:41:52+03:00",
"updated_at": "2021-05-28T22:41:55+03:00",
"_includes": {
"items": {
"data": [
{
"id": 17500,
"booking_id": 17500,
"search_id": 2893169,
"result_id": 5838873,
"external_invoice_id": null,
"room_id": 0,
"meal_plan_id": 5838650,
"currency": "EUR",
"type": "circuit",
"item_id": 940,
"label": "Enigmele Egiptului –Marea Piramida si Sfinxul 2021",
"description": "În această călătorie avem ocazia să descoperim Misterul Egiptului :\r\n Hurghada – Cairo – Alexandria \r\n",
"gross": "672.00",
"tax": "897.00",
"commission": "0.00",
"vat": "0.00",
"status": "confirm",
"start_date": "2021-06-27 00:00:00",
"end_date": "2021-07-04 00:00:00",
"pax_info": "[{\"type\": \"adult\", \"title\": \"Mrs\", \"gender\": \"female\", \"last_name\": \"TEST\", \"birth_date\": \"1979-07-17\", \"first_name\": \"TEST\"}, {\"type\": \"adult\", \"title\": \"Mr\", \"gender\": \"male\", \"last_name\": \"DUMITRACHE\", \"birth_date\": \"1971-07-11\", \"first_name\": \"TEST\"}, {\"type\": \"adult\", \"title\": \"Mr\", \"gender\": \"male\", \"last_name\": \"TEST\", \"birth_date\": \"2005-11-17\", \"first_name\": \"TEST\"}]",
"created_at": "2021-05-28T22:41:52+03:00",
"updated_at": "2021-05-28T22:41:54+03:00"
}
],
"instance": "booking_item"
}
}
}
}