API Specification

Tour Booking API

v1.2.0 Active API Key Required

Confirm tour booking using blocked seats

Endpoint

POST /api/b2b/tour/book.php

This API confirms a tour booking using a previously blocked request. Ensure the block is valid before booking.

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
BlockIdstringRequiredBlock ID received from block API
PassengersarrayRequiredPassenger details
ContactobjectRequiredPrimary contact details
CouponCodestringOptionalOptional discount coupon

Passenger Object

JSON Response
{
    "Name": "Rahul Sharma",
    "Age": 30,
    "Gender": "male",
    "Type": "adult"
}

Contact Object

JSON Response
{
    "Email": "rahul@example.com",
    "Phone": "9876543210"
}

Request Example

JSON Response
{
    "api_key": "YOUR_API_KEY",
    "BlockId": "TOURBLK123",
    "Passengers": [
        {
            "Name": "Rahul Sharma",
            "Age": 30,
            "Gender": "male",
            "Type": "adult"
        },
        {
            "Name": "Priya Sharma",
            "Age": 28,
            "Gender": "female",
            "Type": "adult"
        }
    ],
    "Contact": {
        "Email": "rahul@example.com",
        "Phone": "9876543210"
    },
    "CouponCode": "SUMMER10"
}

cURL Example

curl -X POST "https://enjoyholidayhub.com/api/b2b/tour/book.php" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-API-Key: demo_123456789" \
  -d '{
    "BlockId": "TOURBLK123",
    "api_key": "demo_123456789"
}'

Response (Success)

SUCCESS Tour booked successfully
JSON Response
{
    "status": true,
    "message": "Tour booked successfully",
    "data": {
        "booking_id": 65432,
        "booking_ref": "TRX987654",
        "status": "confirmed",
        "final_amount": 18900
    }
}

Response (Error)

ERROR / NOTICE Booking failed or block expired
JSON Response
{
    "status": false,
    "message": "Booking failed or block expired"
}

Important Notes

  • ๐Ÿงพ Booking requires valid BlockId
  • โณ Booking must be completed before block expiry
  • ๐Ÿ‘ฅ Passenger count must match blocked seats
  • ๐Ÿ’ฐ Coupon (if applied) affects final amount
  • ๐ŸŒ Booking reference is used for tracking