クーポン
ホテルが管理パネルで設定したオンライン割引クーポンを検証します。割引は自社側で適用し、予約送信時には割引後の金額を送信してください。
クーポンを検証#
POST
/external/online/coupon/search認証: Authorization: Bearer · ボディ: application/x-www-form-urlencoded または multipart/form-data
クーポンコードがこのホテルで有効、期限内、かつ利用可能であることを確認し、割引の種類と割引率を返します。
フォームフィールド
hotelIDinteger必須ホテル ID。
couponstring必須ゲストが入力したクーポンコード。
レスポンス
200 成功。
cupon.idintegerクーポン ID。
cupon.changeinteger割引の種類:
0 割合(rate は %)、1 定額(rate はホテルの通貨での金額)。cupon.ratestring割引率または割引額。
エラーレスポンス
- 200
online_cupon_is_not_found— コードが存在しない、無効、または期限切れ。hotel_id_is_not_found—hotelIDがない。
curl "https://test.hms.gen.tr/external/online/coupon/search" \
-H "Authorization: Bearer $HMS_TOKEN" \
-d "hotelID=1000" \
-d "coupon=SUMMER2026"const res = await fetch("https://test.hms.gen.tr/external/online/coupon/search", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.HMS_TOKEN}`
},
body: new URLSearchParams([
["hotelID", "1000"],
["coupon", "SUMMER2026"]
])
});
const data = await res.json();$ch = curl_init('https://test.hms.gen.tr/external/online/coupon/search');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('HMS_TOKEN'),
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'hotelID' => '1000',
'coupon' => 'SUMMER2026',
]),
]);
$data = json_decode(curl_exec($ch), true);{
"success": true,
"cupon": {
"id": 12,
"change": 0,
"rate": "10.00"
}
}{
"success": false,
"message": "online_cupon_is_not_found"
}