GET /lowest-fare-offers v2

GET /lowest-fare-offers v2

The LowestFareOffers endpoint provides the available flight offers with the lowest fare based on a certain period (Overall, Months or Days). 

HOW TO USE?

The POST method should be used to start a search for lowest fare offers.
Use case flow can then be followed by the consumer by requesting the GET methods (for LowestFareOffers & AvailableOffers) supplied as HATEOAS link in the POST response body.

The GET method returns the same response data structure as the POST method.

HEADERS TO USE FOR REQUEST

Parameter

Value

Authorization 

Bearer {{token}}

Content-Type 

application/json

Accept 

application/hal+json;profile=com.afklm.flightoffers.lowest-fare-offers.v2;charset=utf8

Accept-Language 

{{language}}-{{country}}

AFKL-TRAVEL-Host 

KL or AF

AFKL-TRAVEL-Country 

Country (overrides Accept-Language country)


GET

GET https://api.klm.com/opendata/flightoffers/lowest-fare-offers{?d,dateInterval ,displayPriceContent }

QUERY PARAMETERS

Name

Type

Multiplicity

Description

d

String

1

Encoded request body as a result of preceding POST request.

dateInterval

String

0-1

String representing a date interval. Format is: "YYYY-MM-DD/YYYY-MM-DD".

Date interval describes the range of dates that should be used to find lowest fares for the other Connection.

displayPriceContent

Enumeration

0-1

Content of displayPrice in response.

- If empty : displayPrice is the price for 1adt regarding point of sell

- ALL_PAX_ROUNDED : displayPrice is the price for all pax regarding point of sell rounded up

RESPONSE PARAMETERS

Name

Type

Multiplicity

Description

disclaimer

Object

1

The texts to be shown as legal disclaimers regarding fare, tax, fee, credit card surcharges etc.

..displayPriceText

String

1

The disclaimer text to be shown when display price is shown to the customer.

..totalPriceText

String

1

The disclaimer text to be shown when total price is shown to the customer.

itineraries

Array of Objects

0-n

List of itineraries matching the lowest fare offers request.

..connections

Array of Objects

1-6

A chronologically ordered list of connections the lowest fare offer applies to.

….dateInterval

String

0-1

String representing a date interval. Format is: "YYYY-MM-DD/YYYY-MM-DD".

Date interval describes the range of dates for the Connection that the lowest fare applies to.

Conditional: Must be supplied for at least 1 connection.

….fixConnectionDate

HATEOAS link

0-1

Represents a HATEOAS link to request the lowest fare for the other connection(s) in the product where this connection is fixed on the lowest fared product.

Supports the use case where a consumer selects an outbound date and continues finding an inbound date based on lowest fares.

Conditional: Only supplied for type=DAY.

….availableOffers

HATEOAS link

0-1

Represents a HATEOAS link to request the available offers on the date(s) of the connections of this flight product.

Supports the use case where a consumer selects an outbound date and continues finding a lowest priced flight on that same date.

Conditional: Only supplied for type=DAY.

….origin

Object

0-1

The origin station of the connection (matching the request).

......city

Object

0-1

The city of origin (matching the request).

….....code

String

1

IATA location code of the city.

……..name

String

1

Name of the station in the language as specified in ContentLanguage header.

......airport

Object

0-1

The airport of origin (matching the request).

….....code

String

1

IATA location code of the airport.

……..name

String

1

Name of the station in the language as specified in ContentLanguage header.

….destination

Object

0-1

The destination station of the connection (matching the request).

......city

Object

0-1

The city of destination (matching the request).

….....code

String

1

IATA location code of the city.

……..name

String

1

Name of the station in the language as specified in ContentLanguage header.

......airport

Object

0-1

The airport of destination (matching the request).

….....code

String

1

IATA location code of the airport.

……..name

String

1

Name of the station in the language as specified in ContentLanguage header.

….segments

Array of Objects

0-6

A chronologically ordered list of segments that describe the Connection.

Conditional: Either matching the request or specified when expand-suggested-flights=true.

……departureDateTime

DateTime

1

DateTime of departure of the segment flight. It is specified as local time at origin of the segment.

……arrivalDateTime

DateTime

1

DateTime of arrival of the segment flight. It is specified as local time at destination of the segment.

……origin

Object

0-1

The origin airport of the connection.

….....code

String

1

IATA location code of the airport.

……..name

String

1

Name of the station in the language as specified in ContentLanguage header.

……..city

Object

0-1

The city the airport is located in.

….......code

String

1

IATA location code of the city.

……….name

String

1

Name of the station in the language as specified in ContentLanguage header.

……destination

Object

0-1

The destination airport of the connection.

….....code

String

1

IATA location code of the airport.

……..name

String

1

Name of the station in the language as specified in ContentLanguage header.

……..city

Object

0-1

The city the airport is located in.

….......code

String

1

IATA location code of the city.

……….name

String

1

Name of the station in the language as specified in ContentLanguage header.

……marketingFlight

Object

1

Describes the marketing flight for the segment.

……..number

String

1

Flight number.

Max of four digits, when less than 3 then prefix with zeroes up till 3 digits. For example: 006, 022, 1001.

……..carrier

Object

1

Marketing carrier of the flight.

……….code

String

1

IATA airline code.

……….name

String

1

Name of the carrier in the language as specified in ContentLanguage header.

..flightProducts

Object

1

Flight product for the itinerary.

….type

String

1

Indicates the type of response (matching requested type).

OVERALL, MONTH or DAY.

….calculationTimestamp

DateTime

0-1

Timestamp of fare calculation. Only specified when fare comes from static cache of TripPlanner.

….passengers

Array of Objects

1-n

List of passengers associated to the product (matching requested passenger count).

…...id

Integer

1

Integer to uniquely identify a passenger within a product.

…...type

String

1

Type of the passenger.

ADT, C14, CHD or INF

….price

Object

1

Price specification for the product.

..….displayPrice

Number

1

Price to be displayed. Applies to a single adult.

Depending on the displayType it includes taxes and/or fees.

..….totalPrice

Number

1

Total price. Price for all passengers including taxes and fees.

…...currency

String

1

The currency used for prices in response.

Three letter currency code according to ISO 4217.

…...accuracy

Integer

1

The accuracy of the prices supplied. Accuracy is a percentage of the fares for a specific O&D delivered through TripPlanner (GetData or GetBudgetSearch) that match (within a certain range) the fares delivered through FlexPricer (Upsell).

..….displayType

String

0-1

Indicates the rules used for the display price.

TAX, FARE or FEE

…...dynamicWaiver

Boolean

0-1

Indicates whether a dynamic waiver applies to rebooking the ticket. Only applies to Rebooking a ticket.

…...flexibilityPenaltyWaiver

Boolean

0-1

Indicates whether a penalty waiver applies to rebooking the ticket (because the customer has bought flexibility). Only applies to Rebooking a ticket.

……surcharges

Object

0-n

Surcharges applicable per PNR.

Conditional: Surcharge applies either to passenger or to PNR.

…..…code

String

1

Code of the surcharge. E.g. to indicate it is a booking fee.

…..…amount

String

1

Amount applicable to the Surcharge.

…...pricePerPassengerTypes

Array of Objects

1-4

Price specification per passenger type.

…..…passengerType

String

1

Type of the passenger.

ADT, C14, CHD or INF

…..…fare

Number

1

The fare price as applicable for the Passenger Type.

…..…taxes

Number

1

The taxes price as applicable for the Passenger Type.

…..…penalty

Number

0-1

The penalty price as applicable for the Passenger Type. Only applies to Rebooking a ticket.

…..…surcharges

Object

0-n

Surcharges applicable per passenger.

Conditional: Surcharge applies either to passenger or to PNR.

…..…..code

String

1

Code of the surcharge. e.g. to indicate it is a booking fee.

……....amount

Number

1

Amount applicable to the Surcharge.

..connections

Array of Objects

1-6

A chronologically ordered list of connections the lowest fare offer applies to.

….numberOfSeatsAvailable

Integer

0-1

The number of seats available for the lowest fare for this connection.

….promotion

Object

0-1

Applicable promotion.

……id

Integer

1

Identification of the promotion.

……title

String

1

Title of the promotion in the language as specified in ContentLanguage header.

….fareBasis

Object

1

Fare basis applicable to the segment as selected.

…...code

String

1

Fare basis code for the segment.

….segments

Array of Objects

0-6

A chronologically ordered list of segments that describe the Connection.

Conditional: Either matching the request or specified when expand-suggested-flights=true.

……cabin

Object

1

Cabin for the segment

……..class

String

1

Cabin code.

Can be:

  • M == Economy
  • C == Business
  • W == Premium Economy
  • F == First (La Premiere)

……sellingClass

Object

1

Selling class for the segment

……..code

String

1

Selling class code

ERROR CODES

HTTP status

Type

500

INTERNAL_SERVER_ERROR

500

FOA/INTERNAL_SERVER_ERROR/UNSUPPORTED_CAPABILITY

400

FOA/DISCOUNT_CODE_INELIGIBLE

SAMPLE RESPONSE

{
    "flightProducts": [
        {
            "type": "DAY", 
            "connections": [
                {
                    "_links": {
                        "fixConnectionDate": {
                            "href": "https://api.klm.com/b2c/flightoffers/lowest-fare-offers?d=jjfdjhfjdkshjfdhsfgahggcgkfygclgagvbygvblfagk&dateInterval={dateInterval}", 
                            "templated": true
                        }, 
                        "availableOffers": {
                            "href": "https://api.klm.com/b2c/flightoffers/available-offers?d=hgfgsdgfdgfgdfgaggfhagfgGGUIFdbHGGGDYIGSjsjfhdshgsfdhgu-shkl"
                        }
                    }, 
                    "segments": [
                        {
                            "farebase": {
                                "code": "RSRNL"
                            }, 
                            "marketingFlight": {
                                "number": "1016", 
                                "carrier": {
                                    "code": "KL", 
                                    "name": "KLM"
                                }
                            }, 
                            "departureDateTime": "2015-04-05T13:30", 
                            "origin": {
                                "code": "AMS", 
                                "name": "Schiphol", 
                                "city": {
                                    "code": "AMS", 
                                    "name": "Amsterdam"
                                }
                            }, 
                            "destination": {
                                "code": "JFK", 
                                "name": "John F. Kennedy Airport", 
                                "city": {
                                    "code": "NYC", 
                                    "name": "New York"
                                }
                            }
                        }
                    ]
                }, 
                {
                    "_links": {
                        "fixConnectionDate": {
                            "href": "https://api.klm.com/b2c/flightoffers/lowest-fare-offers?d=jjfdjhfjdkshjfdhsfgahggcgkfygclgagvbygvblfagk&dateInterval={dateInterval}", 
                            "templated": true
                        }, 
                        "availableOffers": {
                            "href": "https://api.klm.com/b2c/flightoffers/available-offers?d=hgfgsdgfdgfgdfgaggfhagfgGGUIFdbHGGGDYIGSjsjfhdshgsfdhgu-shkl"
                        }
                    }, 
                    "dateInterval": "2015-04-06/2015-04-06", 
                    "origin": {
                        "city": {
                            "code": "NYC", 
                            "name": "New York"
                        }
                    }, 
                    "destination": {
                        "airport": {
                            "code": "AMS", 
                            "name": "Schiphol", 
                            "city": {
                                "code": "AMS", 
                                "name": "Amsterdam"
                            }
                        }
                    }
                }
            ], 
            "passengers": [
                {
                    "id": 1, 
                    "type": "ADT"
                }
            ], 
            "price": {
                "currency": "EUR", 
                "displayPrice": 787.15, 
                "totalPrice": 797.15, 
                "displayType": "TAX", 
                "pricePerPassengerType": [
                    {
                        "passengerType": "ADT", 
                        "fare": 487, 
                        "taxes": 300.15
                    }
                ], 
                "surcharges": [
                    {
                        "code": "BookingFee", 
                        "amount": 10
                    }
                ], 
                "accuracy": 77.9
            }
        }, 
        {
            "type": "DAY", 
            "connections": [
                {
                    "_links": {
                        "fixConnectionDate": {
                            "href": "https://api.klm.com/b2c/flightoffers/lowest-fare-offers?d=jjfdjhfjdkshjfdhsfgahggcgkfygclgagvbygvblfagk&dateInterval={dateInterval}", 
                            "templated": true
                        }, 
                        "availableOffers": {
                            "href": "https://api.klm.com/b2c/flightoffers/available-offers?d=hgfgsdgfdgfgdfgaggfhagfgGGUIFdbHGGGDYIGSjsjfhdshgsfdhgu-shkl"
                        }
                    }, 
                    "segments": [
                        {
                            "marketingFlight": {
                                "number": "1016", 
                                "carrier": {
                                    "code": "KL", 
                                    "name": "KLM"
                                }
                            }, 
                            "departureDateTime": "2015-04-05T13:30", 
                            "farebase": {
                                "code": "RSRNL"
                            }, 
                            "origin": {
                                "code": "AMS", 
                                "name": "Schiphol", 
                                "city": {
                                    "code": "AMS", 
                                    "name": "Amsterdam"
                                }
                            }, 
                            "destination": {
                                "code": "JFK", 
                                "name": "John F. Kennedy Airport", 
                                "city": {
                                    "code": "NYC", 
                                    "name": "New York"
                                }
                            }
                        }
                    ]
                }, 
                {
                    "_links": {
                        "fixConnectionDate": {
                            "href": "https://api.klm.com/b2c/flightoffers/lowest-fare-offers?d=jjfdjhfjdkshjfdhsfgahggcgkfygclgagvbygvblfagk&dateInterval={dateInterval}", 
                            "templated": true
                        }, 
                        "availableOffers": {
                            "href": "https://api.klm.com/b2c/flightoffers/available-offers?d=hgfgsdgfdgfgdfgaggfhagfgGGUIFdbHGGGDYIGSjsjfhdshgsfdhgu-shkl"
                        }
                    }, 
                    "dateInterval": "2015-04-07/2015-04-07", 
                    "origin": {
                        "city": {
                            "code": "NYC", 
                            "name": "New York"
                        }
                    }, 
                    "destination": {
                        "airport": {
                            "code": "AMS", 
                            "name": "Schiphol", 
                            "city": {
                                "code": "AMS", 
                                "name": "Amsterdam"
                            }
                        }
                    }
                }
            ], 
            "passengers": [
                {
                    "id": 1, 
                    "type": "ADT"
                }
            ], 
            "price": {
                "currency": "EUR", 
                "displayPrice": 932.45, 
                "totalPrice": 942.45, 
                "displayType": "TAX", 
                "pricePerPassengerType": [
                    {
                        "passengerType": "ADT", 
                        "fare": 700, 
                        "taxes": 232.45
                    }
                ], 
                "surcharges": [
                    {
                        "code": "BookingFee", 
                        "amount": 10
                    }
                ], 
                "accuracy": 88.9
            }
        }
    ]
}

Docs Navigation