API Specification
Tour Booking API
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 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 |
|---|---|---|---|
BlockId | string | Required | Block ID received from block API |
Passengers | array | Required | Passenger details |
Contact | object | Required | Primary contact details |
CouponCode | string | Optional | Optional 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