API Specification
Fare Rule API
Get fare rules, cancellation and penalty details for a selected flight
Endpoint
POST
/api/b2b/flights/fare-rule.php
This API returns fare rules including cancellation charges, date change penalties, and refund policies for a selected flight.
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 flight search |
ResultIndex | string | Required | Selected fare_id/result_index from flight search |
Request Example
JSON Response
{
"api_key": "YOUR_API_KEY",
"SearchTokenId": "SEARCH_TOKEN_HERE",
"ResultIndex": "TOB0"
}
cURL Example
curl -X POST "https://enjoyholidayhub.com/api/b2b/flights/fare-rule.php" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: demo_123456789" \
-d '{
"SearchTokenId": "SEARCH_TOKEN_HERE",
"ResultIndex": "TOB0",
"api_key": "demo_123456789"
}'
Response Example
JSON Response
{
"status": true,
"data": {
"is_refundable": false,
"cancellation_charges": {
"0-24_hours": 3000,
"24-72_hours": 2500,
"72+_hours": 1500
},
"date_change_charges": {
"0-24_hours": 3500,
"24-72_hours": 3000,
"72+_hours": 2000
},
"no_show_penalty": 100,
"baggage": "15 Kg",
"cabin_baggage": "7 Kg"
}
}
Response (Error)
ERROR / NOTICE
Fare rules not available
JSON Response
{
"status": false,
"message": "Fare rules not available"
}
Important Notes
- 📜 Fare rules vary by airline and fare type
- ⚠️ Non-refundable tickets may still have partial tax refund
- 💰 Cancellation charges increase closer to departure time
- 🔁 Always show fare rules to users before booking
- ✈️ Use same SearchTokenId and ResultIndex