API Specification
Tour Voucher API
Download or fetch tour booking voucher
Endpoint
POST
/api/b2b/tour/voucher.php
This API returns the tour booking voucher which can be shared with the customer or used during the trip.
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 |
BookingRef | string | Optional | Booking reference (optional) |
Request Example
JSON Response
{
"api_key": "YOUR_API_KEY",
"BookingId": 65432
}
cURL Example
curl -X POST "https://enjoyholidayhub.com/api/b2b/tour/voucher.php" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: demo_123456789" \
-d '{
"BookingId": 65432,
"api_key": "demo_123456789"
}'
Response Example
JSON Response
{
"status": true,
"data": {
"booking_id": 65432,
"booking_ref": "TRX987654",
"tour_name": "Manali Adventure Trip",
"travel_date": "2026-06-10",
"no_of_people": 2,
"contact_name": "Rahul Sharma",
"contact_phone": "9876543210",
"voucher_url": "https://example.com/tour-voucher/65432.pdf"
}
}
Response (Error)
ERROR / NOTICE
Voucher not available
JSON Response
{
"status": false,
"message": "Voucher not available"
}
Important Notes
- 📄 Voucher must be presented during the tour
- 📥 Use voucher_url to download PDF
- 🔑 Booking reference is required for verification
- 🌍 Ensure booking status is confirmed before fetching voucher
- 📧 Voucher can be shared via email or WhatsApp