post https://api.aeronpay.in/api/serviceapi-prod/api/flight/fare_rule
Fare Rule API
The Fare Rule API allows you to retrieve detailed fare rules, restrictions, and inclusions for specific flight options. This API is typically used after performing a flight search to get comprehensive information about the terms and conditions associated with a particular fare.
Endpoint
POST /flight/fare_rule
Headers
Header | Required | Description |
---|---|---|
client-id | Yes | Your unique client ID |
client-secret | Yes | Your client secret key |
Content-Type | Yes | Set to application/json |
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
trace_id | string | Yes | The trace ID from the flight search response, used to identify the specific search session |
token | string | Yes | The encoded token containing flight details from the search results |
client_referenceId | string | Yes | Your unique reference ID for tracking this request |
Example Request
{
"trace_id": "c8812945-36ab-481c-84e6-413aa438f511",
"token": "OB1[TBO]BwVNdj4P3j1AoCZQ+gmNK+0thztrQjDuTcA1EcRvENizNi6mw8IvRZBZOqDgt/YWFDvPACpKpP+bpgDFD008yjJrNQeEpOnZrtlczEYT9nR83cHVMntQTtty+JmqCXEaRg5D1RMSeB/GBH+5dY9GTw2fU0pLFWNP3IYGrPc+l9yZnkPgDYeUGDRf/y+TfUG0EfJJ8okrz1riCLL0l6vPHqU1MV2TAM8mkMP5aol/99kxsW+9mtoRKhrCBauxjUTsf3fk8PG19+iPBpOf4BnwxzXUZNxqcFqmIyUO1t6B/idkmsgcsissXNTv/NK6JLs4U+u42/+uyj4fjg777M/xpNFtPEAAez6KEn7WBVDbNwjBT++tt+4KtmztAxfkg3UytbOafNlM6kWe+16Yv/X/1w6eiyRP49Iwj2KbuuL0dO9BaT9Ja953lFPimTFQ9pFThDP4b75AycDv+k24vDBKYc5XXx2uJfLPzQLMhFjARZT8izmSP995al2P59ZUdGIcWvhmUj6qGQ5ArfbC2QLtE4T9hyNvITSXdH9AfkDilNFXxtsMLDRctoN3xcL7waRxq8hwUQ9JxHmvkXykZKAmRFX7j5ciUg29+NOjLvU9mYisc5/1VH/G3FiYNhrVCpkZe/Yrj8EYYEXBghSixtFMxCKZDjjoGBd+KlquKsA4yWY=",
"client_referenceId": "swg776774338278w"
}
Response Structure
Success Response (200)
Field | Type | Description |
---|---|---|
status | string | Response status (SUCCESS for successful requests) |
status_code | string | HTTP status code as string |
message | string | Human-readable response message |
data | object | Contains the fare rule details |
Data Object
Field | Type | Description |
---|---|---|
trace_id | string | The trace ID that was sent in the request |
result | array | Array of fare rule objects for the requested flight(s) |
Result Object
Field | Type | Description |
---|---|---|
origin | string | Origin airport code (IATA code) |
destination | string | Destination airport code (IATA code) |
airline | string | Airline code (IATA code) |
flight_id | integer | Flight identifier (0 if not applicable) |
departure_time | string | Departure time (format: YYYY-MM-DD HH:mm:ss) |
return_time | string | Return time for round trips (format: YYYY-MM-DD HH:mm:ss) |
fare_rules | string | Detailed fare rules and conditions (may contain HTML formatting) |
fare_inclusions | array | List of what's included in the fare |
fare_restriction | string/null | Any fare restrictions (null if none) |
Example Response
{
"status": "SUCCESS",
"status_code": "200",
"message": "Fare rules retrieved successfully.",
"data": {
"trace_id": "c8812945-36ab-481c-84e6-413aa438f511",
"result": [
{
"origin": "DEL",
"destination": "BOM",
"airline": "6E",
"flight_id": 0,
"departure_time": "0001-01-01 00:00:00",
"return_time": "0001-01-01 00:00:00",
"fare_rules": "The FareBasisCode is: Q0IP<br />Temp Fare Rules GG<br/> <br/><ul><li>APART FROM AIRLINE CHARGES,GST+RAF+ APPLICABLE CHARGES IF ANY, WILL BE CHARGED.</li><li>MENTIONED FEE ARE INDICATIVE PER PAX AND PER SECTOR.</li><li>FOR DOMESTIC BOOKINGS, PASSENGERS ARE REQUIRED TO SUBMIT THE CANCELLATION OR REISSUE REQUEST AT LEAST 2 HOURS BEFORE THE AIRLINES CANCELLATION AND REISSUE POLICY.</li><li>FOR INTERNATIONAL BOOKINGS, PASSENGERS ARE REQUIRED TO SUBMIT THE CANCELLATION OR REISSUE REQUEST AT LEAST 4 HOURS BEFORE THE AIRLINES CANCELLATION AND REISSUE POLICY.</li></ul>",
"fare_inclusions": [
"Temp Fare Rules GG"
],
"fare_restriction": null
}
]
}
}
Error Handling
If the request fails, you'll receive an error response with details about what went wrong. Common issues include:
- Invalid or expired token
- Mismatched trace_id
- Authentication failures
- Service unavailability
Make sure to handle these errors appropriately in your application and provide meaningful feedback to your users.
Integration Workflow
- Perform Flight Search: Use the flight search API to get available options
- Extract Token & Trace ID: Save the token and trace_id from the search response
- Request Fare Rules: Use this API with the saved parameters
- Display Information: Present the fare rules to users before booking
- Store for Reference: Keep fare rule information for customer service purposes