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

HeaderRequiredDescription
client-idYesYour unique client ID
client-secretYesYour client secret key
Content-TypeYesSet to application/json

Request Parameters

ParameterTypeRequiredDescription
trace_idstringYesThe trace ID from the flight search response, used to identify the specific search session
tokenstringYesThe encoded token containing flight details from the search results
client_referenceIdstringYesYour 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)

FieldTypeDescription
statusstringResponse status (SUCCESS for successful requests)
status_codestringHTTP status code as string
messagestringHuman-readable response message
dataobjectContains the fare rule details

Data Object

FieldTypeDescription
trace_idstringThe trace ID that was sent in the request
resultarrayArray of fare rule objects for the requested flight(s)

Result Object

FieldTypeDescription
originstringOrigin airport code (IATA code)
destinationstringDestination airport code (IATA code)
airlinestringAirline code (IATA code)
flight_idintegerFlight identifier (0 if not applicable)
departure_timestringDeparture time (format: YYYY-MM-DD HH:mm:ss)
return_timestringReturn time for round trips (format: YYYY-MM-DD HH:mm:ss)
fare_rulesstringDetailed fare rules and conditions (may contain HTML formatting)
fare_inclusionsarrayList of what's included in the fare
fare_restrictionstring/nullAny 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

  1. Perform Flight Search: Use the flight search API to get available options
  2. Extract Token & Trace ID: Save the token and trace_id from the search response
  3. Request Fare Rules: Use this API with the saved parameters
  4. Display Information: Present the fare rules to users before booking
  5. Store for Reference: Keep fare rule information for customer service purposes
Language
Click Try It! to start a request and see the response here!