API Specification
Block Seat API
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 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 |
|---|---|---|---|
UserIp | string | Required | End-user IP address |
SearchTokenId | string | Required | Token received from search API |
ResultIndex | string | Required | Selected bus result index |
BoardingPointId | integer | Required | Selected boarding point |
DroppingPointId | integer | Required | Selected dropping point |
Passenger | array | Required | Passenger 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