API Specification
Seat Layout API
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 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 |
|---|---|---|---|
SearchTokenId | string | Required | Token received from search API |
ResultIndex | string | Required | Selected 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