Chambres et tarifs
Deux endpoints alimentent les résultats de recherche du moteur de réservation : la liste des chambres, qui renvoie les types de chambre vendables, les types de pension et les prix pour les dates et l’occupation demandées, et la disponibilité, qui renvoie la disponibilité et les tarifs jour par jour pour les vues calendrier.
/external/online/roomTypeListe des chambres et tarifsGET/external/room/type/hotel/availabilityDisponibilités en calendrierListe des chambres et tarifs#
/external/online/roomTypeAuthentification: Authorization: Bearer · Corps: application/x-www-form-urlencoded ou multipart/form-data
Renvoie les types de chambre de l’hôtel ouverts à la vente en ligne pour les dates et l’occupation demandées. Pour chaque type de chambre sont calculés le nombre de chambres disponibles (roomCount), les restrictions (durée minimale de séjour, fermeture à l’arrivée ou au départ), les types de pension et les options de prix. S’il y a des enfants, envoyez leur âge avec childAges[] ; la tarification enfant dépend de l’âge.
Règles de validation : arrivée aujourd’hui ou plus tard, départ après l’arrivée, 30 nuits au maximum, 1 à 40 adultes, 0 à 10 enfants (de 0 à 16 ans).
Champs de formulaire
hotelIDintegerobligatoirestartDatedateobligatoireYYYY-MM-DD.endDatedateobligatoireYYYY-MM-DD.adultCountintegerobligatoirechildCountintegerpar défaut: 0childAges, c’est la longueur de la liste des âges qui prime.childAges[]integer[]childAges[]=7&childAges[]=12.languagestringpar défaut: trbuildingIDintegerRéponse
200 Liste des types de chambre. Les prix se trouvent sous chaque type de pension, dans l’objet prices, avec des clés de la forme "<persons>-<1|0>" : -1 désigne le tarif standard (remboursable), -0 le tarif non remboursable ([NR]). En tarification par chambre, les clés sont 1-1 / 1-0.
items[].id / nameinteger / stringroomTypeID dans la réservation.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 devient ratePlanID dans la réservation. priceType : 0 tarification par personne, 1 tarification par chambre.…accommodationTypes[].prices{}objecttotal nombre de nuits, price montant total, currency, nonRefundable ("[NR]" signifie non remboursable), id identifiant de sélection, prices[] tarifs par nuit (price, tarih au format jj.mm.aaaa).items[].roomFeatures[]object[]title, icon.countintegererrorMessage / errorCodestring | integer | nullRéponses d’erreur
- 200
errorCode10001 hôtel introuvable · 10002 paramètre manquant · 10003 hôtel fermé à la vente en ligne · 10004 aucun type de chambre ouvert à la vente · 10022 paramètres de date/occupation invalides · 20001–20004 disponibilité insuffisante.
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": "Chambre standard",
"capacityAdult": 2,
"capacityTotal": 3,
"totalBed": 1,
"totalBathroom": 1,
"roomSize": 24,
"currency": "TRY",
"detail": "<p>Chambre standard de 24 m², vue sur le jardin.</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": "Petit-déjeuner inclus",
"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": "Climatisation",
"icon": "fa-snowflake"
},
{
"title": "Wi-Fi gratuit",
"icon": "fa-wifi"
}
],
"capacityChildren": 1
}
],
"count": 1,
"errorMessage": null,
"errorCode": null
}{
"success": false,
"errorMessage": "Disponibilité insuffisante pour le nombre d’adultes.",
"errorCode": 20001
}Disponibilités en calendrier#
/external/room/type/hotel/availabilityAuthentification: Authorization: Bearer
Renvoie, pour chaque type de chambre, le nombre de chambres disponibles et le tarif de base jour par jour. Conçu pour les vues calendrier et les cartes de chaleur tarifaires ; utilisez la liste des chambres pour obtenir les prix exacts et vérifier les restrictions.
Paramètres de requête
hotelIDintegerobligatoirestartDatedatetimeobligatoireYYYY-MM-DD ou YYYY-MM-DDTHH:MM:SS.endDatedatetimeobligatoireRéponse
200 Liste journalière par type de chambre. availability à -1 signifie qu’aucune donnée de disponibilité n’existe pour ce jour ; price à "-" signifie qu’aucun tarif n’est défini.
Réponses d’erreur
- 200
hotel_id_is_not_found,start_date_is_not_found,end_date_is_not_found— paramètre manquant.
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": "Chambre standard",
"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"
}