How to Retrieve Fare Rules for a Flight
Before booking a flight, you can check the fare rules to understand cancellation policies, exchange options, and any associated penalties. The fare rules endpoint uses the cabinavailabilitytoken obtained from the availability check.
Endpoint
GET /flights/api/v2/farerules/{cabinavailabilitytoken}
Headers
| Header | Required | Description |
|---|
x-api-key | Yes | Your API key. |
x-correlation-id | Yes | Correlation ID from the autocomplete response. |
Path Parameters
| Parameter | Type | Required | Description |
|---|
cabinavailabilitytoken | string | Yes | The availability token from the availability endpoint response. |
Example Request
GET /flights/api/v2/farerules/cat_xyz789abc123
Example Response
JSON
{
"status": "success",
"data": {
"fare_type": "Published",
"fare_rules": [
{
"city_pair": "SFO - BLR",
"void_applicable": true,
"fareruletext": "CANCELLATIONS: Ticket is non-refundable after 24 hours of purchase. CHANGES: Changes permitted with a fee of USD 200 per passenger.",
"structuredpenaltyinfo": {
"cancellable": true,
"exchangeable": true,
"penalty_details": [
{
"passenger_type": "ADULT",
"cancellation_charge": {
"amount": 250,
"currency": "USD",
"type": "fixed"
},
"exchange_charge": {
"amount": 200,
"currency": "USD",
"type": "fixed"
}
},
{
"passenger_type": "CHILD",
"cancellation_charge": {
"amount": 250,
"currency": "USD",
"type": "fixed"
},
"exchange_charge": {
"amount": 200,
"currency": "USD",
"type": "fixed"
}
},
{
"passenger_type": "INFANT",
"cancellation_charge": {
"amount": 0,
"currency": "USD",
"type": "fixed"
},
"exchange_charge": {
"amount": 0,
"currency": "USD",
"type": "fixed"
}
}
]
}
}
]
},
"message": "Fare rules retrieved successfully"
}
Response Fields
Top-Level Fields
| Field | Type | Description |
|---|
faretype | string | The type of fare (e.g., "Published", "Private"). |
farerules | array | Array of fare rule objects, one per city pair in the itinerary. |
Fare Rule Object
| Field | Type | Description |
|---|
citypair | string | The origin-destination pair this rule applies to (e.g., "SFO - BLR"). |
voidapplicable | boolean | Whether the ticket can be voided (typically within 24 hours of purchase). |
fareruletext | string | Free-text fare rule description from the airline. Contains the full terms in plain language. |
structuredpenaltyinfo | object | Machine-readable penalty information. |
Structured Penalty Info
| Field | Type | Description |
|---|
cancellable | boolean | Whether the fare is cancellable. |
exchangeable | boolean | Whether the fare allows date or route changes. |
penalty_details | array | Penalty charges broken down by passenger type. |
Penalty Details (Per Passenger Type)
| Field | Type | Description |
|---|
passengertype | string | "ADULT", "CHILD", or "INFANT". |
cancellationcharge.amount | number | Cancellation penalty amount. |
cancellationcharge.currency | string | Currency of the penalty. |
cancellationcharge.type | string | Charge type (e.g., "fixed", "percentage"). |
exchangecharge.amount | number | Exchange/change penalty amount. |
exchangecharge.currency | string | Currency of the penalty. |
exchange_charge.type | string | Charge type. |
Understanding Fare Rules
Cancellable vs. Non-Cancellable
- If
cancellable is true, the booking can be cancelled, but a penalty may apply based on cancellation_charge. - If
cancellable is false, the ticket is non-refundable. You will not receive any refund if you cancel.
Exchangeable vs. Non-Exchangeable
- If
exchangeable is true, you can change the travel dates or route by paying the exchange_charge penalty. - If
exchangeable is false, no changes are permitted. You would need to cancel and rebook.
Void Window
If void_applicable is true, you may be able to void the ticket within a short window (often 24 hours after purchase) without penalty. Policies vary by airline.
Tips
- Always present fare rules to users before confirming a booking so they understand cancellation and change policies.
- The
fareruletext field contains the airline's official terms. Use this for display when detailed terms are needed. - The
structuredpenaltyinfo is best for programmatic logic, such as calculating potential refund amounts. - Fare rules can differ between city pairs on multi-segment itineraries. Check each entry in the
fare_rules array.
Related Articles