API Specification

Tour Voucher API

v1.2.0 Active API Key Required

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 Parameter
Required for all endpoints

Enjoy 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: demo_123456789
Get your production key in Agent Portal

Request Parameters

FieldTypeRequiredDescription
BookingIdintegerRequiredUnique booking ID
BookingRefstringOptionalBooking 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