Coupon
Validates the online discount coupons the hotel defined in the panel. Apply the discount on your side and send the discounted amounts in the booking push.
Validate a coupon#
POST
/external/online/coupon/searchAuthentication: Authorization: Bearer · Body: application/x-www-form-urlencoded or multipart/form-data
Checks that the coupon code is active, not expired and available for this hotel; returns the discount type and rate.
Form fields
hotelIDintegerrequiredHotel ID.
couponstringrequiredCoupon code entered by the guest.
Response
200 Success.
cupon.idintegerCoupon ID.
cupon.changeintegerDiscount type:
0 percentage (rate is a %), 1 fixed amount (rate in the hotel currency).cupon.ratestringDiscount rate or amount.
Error responses
- 200
online_cupon_is_not_found— unknown, inactive or expired code;hotel_id_is_not_found—hotelIDmissing.
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"
}