API Specification

Block Seat API

v1.2.0 Active API Key Required

Temporarily reserve bus seats before confirming booking

Endpoint

POST /api/b2b/bus/blockseat.php

This API allows you to temporarily reserve selected seats before completing the booking. It ensures that seats are held for a short duration while the user proceeds to payment.

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
UserIpstringRequiredEnd-user IP address
SearchTokenIdstringRequiredToken received from search API
ResultIndexstringRequiredSelected bus result index
BoardingPointIdintegerRequiredSelected boarding point
DroppingPointIdintegerRequiredSelected dropping point
PassengerarrayRequiredPassenger seat details

Passenger Object

JSON Response
{
    "LeadPassenger": true,
    "Title": "Mr",
    "FirstName": "Rahul",
    "LastName": "Sharma",
    "Email": "rahul@example.com",
    "Phoneno": "9876543210",
    "Gender": "1",
    "Address": "New Delhi",
    "Age": "30",
    "SeatName": 1
}

Request Example

JSON Response
{
    "api_key": "YOUR_API_KEY",
    "UserIp": "103.120.45.10",
    "SearchTokenId": "SEARCH_TOKEN_HERE",
    "ResultIndex": "TB-35",
    "BoardingPointId": 1,
    "DroppingPointId": 1,
    "Passenger": [
        {
            "LeadPassenger": true,
            "Title": "Mr",
            "FirstName": "Rahul",
            "LastName": "Sharma",
            "Email": "rahul@example.com",
            "Phoneno": "9876543210",
            "Gender": "1",
            "Address": "New Delhi",
            "Age": "30",
            "SeatName": 1
        }
    ]
}

cURL Example

curl -X POST "https://enjoyholidayhub.com/api/b2b/bus/blockseat.php" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-API-Key: demo_123456789" \
  -d '{
    "UserIp": "103.120.45.10",
    "SearchTokenId": "SEARCH_TOKEN",
    "ResultIndex": "TB-35",
    "BoardingPointId": 1,
    "DroppingPointId": 1,
    "api_key": "demo_123456789"
}'

Response (Success)

SUCCESS Seats reserved successfully
JSON Response
{
    "status": true,
    "message": "Seats reserved successfully",
    "data": {
        "block_id": "BLK123456",
        "expires_at": "2026-05-01T10:10:00"
    }
}

Response (Error)

ERROR / NOTICE Selected seats are no longer available
JSON Response
{
    "status": false,
    "message": "Selected seats are no longer available"
}

Important Notes

  • ⏳ Seats are reserved for a limited time (typically 5–10 minutes)
  • ⚠️ Booking must be completed before expiry time
  • 🔑 Use the returned block_id in the booking API
  • 🔄 Expired reservations are automatically released