Habitaciones y tarifas
Dos endpoints que alimentan los resultados de búsqueda del motor de reservas: la lista de habitaciones, que devuelve los tipos de habitación a la venta, los regímenes y los precios para las fechas y la ocupación indicadas, y la disponibilidad, que devuelve la disponibilidad y las tarifas día a día para las vistas de calendario.
/external/online/roomTypeLista de habitaciones y tarifasGET/external/room/type/hotel/availabilityDisponibilidad en calendarioLista de habitaciones y tarifas#
/external/online/roomTypeAutenticación: Authorization: Bearer · Cuerpo: application/x-www-form-urlencoded o multipart/form-data
Devuelve los tipos de habitación del hotel abiertos a la venta online para las fechas y la ocupación indicadas. Para cada tipo de habitación se calculan el número de habitaciones disponibles (roomCount), las restricciones (estancia mínima, cerrado a la entrada o a la salida), los regímenes y las opciones de precio. Si viajan niños, envía sus edades con childAges[]; el precio para niños depende de la edad.
Reglas de validación: entrada hoy o más adelante, salida posterior a la entrada, 30 noches como máximo, 1–40 adultos, 0–10 niños (de 0 a 16 años).
Campos de formulario
hotelIDintegerobligatoriostartDatedateobligatorioYYYY-MM-DD.endDatedateobligatorioYYYY-MM-DD.adultCountintegerobligatoriochildCountintegerpredeterminado: 0childAges, prevalece la longitud de la lista de edades.childAges[]integer[]childAges[]=7&childAges[]=12.languagestringpredeterminado: trbuildingIDintegerRespuesta
200 Lista de tipos de habitación. Los precios están bajo cada régimen, en el objeto prices, con claves "<persons>-<1|0>": -1 es la tarifa estándar (reembolsable) y -0, la tarifa no reembolsable ([NR]). Con precios por habitación, las claves son 1-1 / 1-0.
items[].id / nameinteger / stringroomTypeID en la reserva.items[].capacityAdult / capacityChildren / capacityTotalintegeritems[].roomCountintegerroomRestrictionMessage.items[].roomRestrictionMessagestring | nullclosed_to_checkinclosed_to_checkoutpassive_salesminimum_staymaximum_stayclosed_to_arrivalprice_not_founditems[].nonRefundable / refundablebooleanitems[].images[]string[]items[].accommodationTypes[]object[]id pasa a ser ratePlanID en la reserva. priceType: 0 precio por persona, 1 precio por habitación.…accommodationTypes[].prices{}objecttotal noches, price importe total, currency, nonRefundable ("[NR]" significa no reembolsable), id ID de selección, prices[] tarifas por noche (price, tarih en formato dd.mm.aaaa).items[].roomFeatures[]object[]title, icon.countintegererrorMessage / errorCodestring | integer | nullRespuestas de error
- 200
errorCode10001 hotel no encontrado · 10002 falta un parámetro · 10003 hotel cerrado a la venta online · 10004 ningún tipo de habitación abierto a la venta · 10022 parámetros de fecha/ocupación no válidos · 20001–20004 disponibilidad insuficiente.
curl "https://test.hms.gen.tr/external/online/roomType" \
-H "Authorization: Bearer $HMS_TOKEN" \
-d "hotelID=1000" \
-d "startDate=2026-08-18" \
-d "endDate=2026-08-20" \
-d "adultCount=2" \
-d "childCount=1" \
-d "childAges[]=7" \
-d "language=tr"const res = await fetch("https://test.hms.gen.tr/external/online/roomType", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`
},
body: new URLSearchParams([
["hotelID", "1000"],
["startDate", "2026-08-18"],
["endDate", "2026-08-20"],
["adultCount", "2"],
["childCount", "1"],
["childAges[]", "7"],
["language", "tr"]
])
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/online/roomType');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('HMS_TOKEN'),
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'hotelID' => '1000',
'startDate' => '2026-08-18',
'endDate' => '2026-08-20',
'adultCount' => '2',
'childCount' => '1',
'childAges' => [
'7',
],
'language' => 'tr',
]),
]);
$data = json_decode(curl_exec($ch), true);{
"success": true,
"items": [
{
"id": 2,
"name": "Habitación Estándar",
"capacityAdult": 2,
"capacityTotal": 3,
"totalBed": 1,
"totalBathroom": 1,
"roomSize": 24,
"currency": "TRY",
"detail": "<p>Habitación estándar de 24 m² con vistas al jardín.</p>",
"roomCount": 5,
"roomRestrictionMessage": null,
"nonRefundable": false,
"refundable": true,
"images": [
"images/1000/odatipi/standart-1.jpg",
"images/1000/odatipi/standart-2.jpg"
],
"accommodationTypes": [
{
"id": 2,
"title": "Alojamiento y desayuno",
"priceType": 0,
"roomRestriction": 1,
"roomRestrictionMessage": null,
"roomRestrictionValue": null,
"prices": {
"2-1": {
"total": 2,
"title": 2,
"nonRefundable": "",
"price": "1930.00",
"currency": "TRY",
"id": "2/2",
"prices": [
{
"price": "965.00",
"tarih": "18.08.2026"
},
{
"price": "965.00",
"tarih": "19.08.2026"
}
]
},
"2-0": {
"total": 2,
"title": 2,
"nonRefundable": "[NR]",
"price": "1737.00",
"currency": "TRY",
"id": "2-0/2",
"prices": [
{
"price": "868.50",
"tarih": "18.08.2026"
},
{
"price": "868.50",
"tarih": "19.08.2026"
}
]
}
}
}
],
"roomFeatures": [
{
"title": "Aire acondicionado",
"icon": "fa-snowflake"
},
{
"title": "Wi-Fi gratuito",
"icon": "fa-wifi"
}
],
"capacityChildren": 1
}
],
"count": 1,
"errorMessage": null,
"errorCode": null
}{
"success": false,
"errorMessage": "No hay suficiente disponibilidad para los adultos indicados.",
"errorCode": 20001
}Disponibilidad en calendario#
/external/room/type/hotel/availabilityAutenticación: Authorization: Bearer
Devuelve, para cada tipo de habitación, el número de habitaciones disponibles y la tarifa base de cada día. Está pensado para vistas de calendario y mapas de calor de tarifas; para obtener precios exactos y comprobar restricciones, usa la lista de habitaciones.
Parámetros de consulta
hotelIDintegerobligatoriostartDatedatetimeobligatorioYYYY-MM-DD o YYYY-MM-DDTHH:MM:SS.endDatedatetimeobligatorioRespuesta
200 Lista diaria por tipo de habitación. availability -1 significa que no hay datos de disponibilidad para ese día; price "-" significa que no hay tarifa definida.
Respuestas de error
- 200
hotel_id_is_not_found,start_date_is_not_found,end_date_is_not_found— falta un parámetro.
curl "https://test.hms.gen.tr/external/room/type/hotel/availability?hotelID=1000&startDate=2026-08-18&endDate=2026-08-21" \
-H "Authorization: Bearer $HMS_TOKEN"const res = await fetch("https://test.hms.gen.tr/external/room/type/hotel/availability?hotelID=1000&startDate=2026-08-18&endDate=2026-08-21", {
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`
}
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/room/type/hotel/availability?hotelID=1000&startDate=2026-08-18&endDate=2026-08-21');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('HMS_TOKEN'),
],
]);
$data = json_decode(curl_exec($ch), true);{
"success": true,
"roomTypes": [
{
"name": "Habitación Estándar",
"id": 2,
"rate": 2,
"availability": [
{
"id": 20260818,
"start": "2026-08-18 12:00:00",
"end": "2026-08-19 12:00:00",
"availability": 5,
"price": "965.00"
},
{
"id": 20260819,
"start": "2026-08-19 12:00:00",
"end": "2026-08-20 12:00:00",
"availability": 3,
"price": "965.00"
},
{
"id": 20260820,
"start": "2026-08-20 12:00:00",
"end": "2026-08-21 12:00:00",
"availability": 0,
"price": "1,100.00"
},
{
"id": 20260821,
"start": "2026-08-21 12:00:00",
"end": "2026-08-22 12:00:00",
"availability": -1,
"price": "-"
}
]
}
],
"currency": "TRY"
}