客室と料金

予約エンジンの検索結果を支える2つのエンドポイントです。指定した日付と人数で販売可能な客室タイプ、食事条件、料金を返す客室一覧と、カレンダー表示用に日ごとの空室状況と料金を返す空室状況があります。

客室一覧と料金#

POST/external/online/roomType

認証: Authorization: Bearer · ボディ: application/x-www-form-urlencoded または multipart/form-data

指定した日付と人数で、オンライン販売が有効なホテルの客室タイプを返します。客室タイプごとに、販売可能室数(roomCount)、制限(最低宿泊数、チェックイン不可・チェックアウト不可)、食事条件、料金オプションが計算されます。子どもが同行する場合は childAges[] で年齢を送信してください。子ども料金は年齢によって決まります。

検証ルール:チェックインは本日以降、チェックアウトはチェックインより後、最大30泊、大人1–40名、子ども0–10名(0–16歳)。

フォームフィールド

hotelIDinteger必須
ホテル ID。トークンのホテルと一致している必要があります。
startDatedate必須
チェックイン日(YYYY-MM-DD)。
endDatedate必須
チェックアウト日(YYYY-MM-DD)。
adultCountinteger必須
大人の人数(1–40)。
childCountintegerデフォルト: 0
子どもの人数(0–10)。childAges と一致しない場合は、年齢リストの長さが優先されます。
childAges[]integer[]
子どもそれぞれの年齢(0–16)。フォームフィールドとして繰り返します:childAges[]=7&childAges[]=12
languagestringデフォルト: tr
レスポンスの言語(客室名、設備名、エラーメッセージ)。
buildingIDinteger
この建物(ブロック)の客室のみを返します。

レスポンス

200 客室タイプの一覧。料金は各食事条件の prices オブジェクトに、"<persons>-<1|0>" をキーとして格納されます。-1 は標準(返金可)料金、-0 は返金不可([NR])料金です。客室単位の料金設定では、キーは 1-1 / 1-0 になります。

items[].id / nameinteger / string
客室タイプの ID と名前。予約時に roomTypeID として送信します。
items[].capacityAdult / capacityChildren / capacityTotalinteger
大人・子ども・合計の定員。
items[].roomCountinteger
この日程で販売可能な室数。0 は販売不可を意味し、その理由は roomRestrictionMessage に入ります。
items[].roomRestrictionMessagestring | null
販売制限。
closed_to_checkinclosed_to_checkoutpassive_salesminimum_staymaximum_stayclosed_to_arrivalprice_not_found
items[].nonRefundable / refundableboolean
客室タイプで返金不可料金と返金可料金のどちら(または両方)を提供しているか。
items[].images[]string[]
画像パス(API のベース URL からの相対パス)。
items[].accommodationTypes[]object[]
食事条件。id は予約時の ratePlanID になります。priceType:0 は人数単位、1 は客室単位の料金設定。
…accommodationTypes[].prices{}object
料金オプション。各オプションの内容:total 泊数、price 合計金額、currencynonRefundable"[NR]" は返金不可)、id 選択 ID、prices[] 1泊ごとの料金(pricetarih は dd.mm.yyyy 形式)。
items[].roomFeatures[]object[]
客室設備:titleicon
countinteger
返された客室タイプの数。
errorMessage / errorCodestring | integer | null
失敗時に設定されます。コード一覧:エラーコード

エラーレスポンス

  • 200 errorCode 10001 ホテルが見つからない · 10002 パラメーター不足 · 10003 ホテルのオンライン販売が停止中 · 10004 販売可能な客室タイプがない · 10022 日付・人数のパラメーターが不正 · 20001–20004 空室不足。
リクエスト
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"
レスポンス · 200
{
    "success": true,
    "items": [
        {
            "id": 2,
            "name": "スタンダードルーム",
            "capacityAdult": 2,
            "capacityTotal": 3,
            "totalBed": 1,
            "totalBathroom": 1,
            "roomSize": 24,
            "currency": "TRY",
            "detail": "<p>ガーデンビュー、24 m² のスタンダードルーム。</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": "朝食付き",
                    "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": "エアコン",
                    "icon": "fa-snowflake"
                },
                {
                    "title": "無料 Wi-Fi",
                    "icon": "fa-wifi"
                }
            ],
            "capacityChildren": 1
        }
    ],
    "count": 1,
    "errorMessage": null,
    "errorCode": null
}
レスポンス · 200(空室なし)
{
    "success": false,
    "errorMessage": "大人の空室が不足しています。",
    "errorCode": 20001
}

カレンダー空室状況#

GET/external/room/type/hotel/availability

認証: Authorization: Bearer

客室タイプごとに、日別の販売可能室数と基本料金を返します。カレンダーや料金ヒートマップの表示向けです。正確な料金や制限のチェックには客室一覧を使用してください。

クエリパラメーター

hotelIDinteger必須
ホテル ID。
startDatedatetime必須
開始日(YYYY-MM-DD または YYYY-MM-DDTHH:MM:SS)。
endDatedatetime必須
終了日(この日を含む)。

レスポンス

200 客室タイプごとの日別リスト。availability が -1 の場合はその日の空室データなし、price"-" の場合は料金未設定を意味します。

エラーレスポンス

  • 200 hotel_id_is_not_foundstart_date_is_not_foundend_date_is_not_found — パラメーター不足。
リクエスト
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"
レスポンス · 200
{
    "success": true,
    "roomTypes": [
        {
            "name": "スタンダードルーム",
            "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"
}