API Specification

Seat Layout API

v1.2.0 Active API Key Required

Fetch seat layout and availability for selected bus

Endpoint

POST /api/b2b/bus/seatlayout.php

This API returns the seat layout for a selected bus including seat availability, seat types, and pricing.

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
SearchTokenIdstringRequiredToken received from search API
ResultIndexstringRequiredSelected bus result index

Request Example

JSON Response
{
    "api_key": "YOUR_API_KEY",
    "SearchTokenId": "SEARCH_TOKEN_HERE",
    "ResultIndex": "TB-35"
}

cURL Example

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

Response Example

JSON Response
{
    "status": true,
    "data": {
        "layout": [
            {
                "seat_no": "A1",
                "row": 1,
                "column": 1,
                "type": "sleeper",
                "price": 1200,
                "is_available": true
            },
            {
                "seat_no": "A2",
                "row": 1,
                "column": 2,
                "type": "sleeper",
                "price": 1200,
                "is_available": false
            }
        ],
        "deck_type": "single"
    }
}

Response (Error)

ERROR / NOTICE Seat layout not available
JSON Response
{
    "status": false,
    "message": "Seat layout not available"
}

Important Notes

  • 🪑 Each seat contains position (row/column) for UI rendering
  • 💺 Seat types may include sleeper or seater
  • 🔁 Availability is dynamic and may change in real-time
  • 📌 Use available seats for block seat API