API Specification
Block Room API
Temporarily reserve hotel rooms before booking
Endpoint
POST
/api/b2b/hotels/block-room.php
This API blocks selected hotel rooms temporarily before final booking. It ensures availability and locks pricing for a short duration.
API Key Authentication
Authenticate requests via HTTP Header or Request ParameterEnjoy Holiday Hub APIs authenticate requests using your unique secret API Key. You can provide your key in either of the following standard formats:
Method 1: Header (Recommended)
Send key in standard HTTP header:
X-API-Key: demo_123456789
Method 2: Body / Query
Send key in JSON payload or query param:
"api_key": "demo_123456789"
Demo Sandbox Key:
Get your production key in Agent Portal
demo_123456789
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
SearchTokenId | string | Required | Token received from hotel search |
ResultIndex | string | Required | Selected hotel result index from search |
HotelCode | string | Required | Selected hotel code from search |
HotelName | string | Required | Hotel name from search result |
NoOfRooms | integer | Required | Number of rooms to block |
HotelRoomsDetails | array | Required | Selected rooms from room-info, at minimum RoomIndex |
HotelRoomsDetails Object
JSON Response
{
"RoomIndex": 1
}
Request Example
JSON Response
{
"api_key": "YOUR_API_KEY",
"SearchTokenId": "SEARCH_TOKEN_HERE",
"ResultIndex": "TBO10",
"HotelCode": "6440547",
"HotelName": "Western Blu",
"NoOfRooms": 1,
"HotelRoomsDetails": [
{
"RoomIndex": 1
}
]
}
cURL Example
curl -X POST "https://enjoyholidayhub.com/api/b2b/hotels/block-room.php" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: demo_123456789" \
-d '{
"SearchTokenId": "SEARCH_TOKEN",
"ResultIndex": "TBO10",
"HotelCode": "6440547",
"HotelName": "Western Blu",
"NoOfRooms": 1,
"HotelRoomsDetails": [
{
"RoomIndex": 1
}
],
"api_key": "demo_123456789"
}'
Response (Success)
SUCCESS
Room blocked successfully
JSON Response
{
"status": true,
"message": "Room blocked successfully",
"data": {
"block_id": "HTL123456",
"expires_at": "2026-05-01T12:00:00"
}
}
Response (Error)
ERROR / NOTICE
Room not available or price changed
JSON Response
{
"status": false,
"message": "Room not available or price changed"
}
Important Notes
- ⏳ Room is blocked for limited time (usually 5–15 minutes)
- ⚠️ Booking must be completed before expiry
- 🔑 Use block_id for booking API
- 💰 Price may change if block expires
- 🌐 System handles all internal processing securely