API Specification
Hotel Booking Detail API
Fetch hotel booking status and voucher-ready booking information
Endpoint
POST
/api/b2b/hotels/booking-detail.php
This API returns hotel booking details from UP17 or manual inventory.
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 |
|---|---|---|---|
BookingId | string | Yes for API booking | UP17 booking ID |
SearchTokenId | string | Recommended for API booking | Search token used for the booking |
booking_id | integer | Yes for manual booking | Local booking ID |
booking_ref | string | Optional for manual booking | Local booking reference |
Request Example
JSON Response
{
"api_key": "YOUR_API_KEY",
"BookingId": "123456",
"SearchTokenId": "SEARCH_TOKEN_HERE"
}
cURL Example
curl -X POST "https://enjoyholidayhub.com/api/b2b/hotels/booking-detail.php" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: demo_123456789" \
-d '{
"BookingId": "123456",
"SearchTokenId": "SEARCH_TOKEN_HERE",
"api_key": "demo_123456789"
}'
Response (Success)
SUCCESS
Booking detail fetched successfully
JSON Response
{
"status": true,
"message": "Booking detail fetched successfully",
"data": {
"booking_id": 78901,
"status": "confirmed",
"hotel_name": "Grand Palace Hotel"
}
}
Response (Error)
ERROR / NOTICE
Booking not found
JSON Response
{
"status": false,
"message": "Booking not found"
}
Important Notes
- ๐งพ API booking detail requires BookingId
- ๐ Pass SearchTokenId whenever it is available
- ๐จ Manual bookings can be fetched by booking_id or booking_ref