API Specification
Hotel Voucher API
Download or fetch hotel booking voucher
Endpoint
POST
/api/b2b/hotels/voucher.php
This API returns the hotel booking voucher which can be shared with the guest or presented at the hotel during check-in.
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 | integer | Required | Unique booking ID |
Request Example
JSON Response
{
"api_key": "YOUR_API_KEY",
"BookingId": 78901
}
cURL Example
curl -X POST "https://enjoyholidayhub.com/api/b2b/hotels/voucher.php" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: demo_123456789" \
-d '{
"BookingId": 78901,
"api_key": "demo_123456789"
}'
Response Example
JSON Response
{
"status": true,
"data": {
"booking_id": 78901,
"hotel_name": "Grand Palace Hotel",
"address": "Connaught Place, New Delhi",
"check_in": "2026-05-10",
"check_out": "2026-05-12",
"guest_name": "Rahul Sharma",
"rooms": 1,
"confirmation_no": "HCN456789",
"voucher_url": "https://example.com/voucher/78901.pdf"
}
}
Response (Error)
ERROR / NOTICE
Voucher not available
JSON Response
{
"status": false,
"message": "Voucher not available"
}
Important Notes
- 📄 Voucher must be presented at hotel during check-in
- 📥 Use voucher_url to download PDF
- 🔑 Confirmation number is required at hotel
- 🏨 Ensure booking status is confirmed before fetching voucher
- 📧 Voucher can be shared with customer via email or WhatsApp