POST /lowest-fare-offers v3

POST /LOWEST-FARE-OFFERS V3

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;charset=utf8

Accept-Language 

{{language}}-{{country}}

AFKL-TRAVEL-Host 

KL or AF

AFKL-TRAVEL-Country 

Country (overrides Accept-Language country)

POST

POST https://api.klm.com/opendata/flightoffers/v3/lowest-fare-offers{?expand-suggested-flights,type}

QUERY PARAMETERS

Name

Type

Multiplicity

Description

expand-suggested-flights

Boolean

0-1

When true the segment details are expanded in the response. Otherwise the response details for connections and segments match the request details.

type

String

1

Indicates the type of request being fired.

OVERALL, MONTH or DAY.

POST PARAMETERS

Name

Type

Multiplicity

Description

commercialCabins

List of string

1

1s
Cannot be empty
Can contain ECONOMY or PREMIUM or BUSINESS or FIRST

currency

String

0-1

Indicates the currency to be used for prices in response.

Three letter currency code according to ISO 4217.

This can be used to override the setting for the default currency of the country of the origin airport (also known as Point of Sale).

discountCode

String

0-1

code for IDC discount.

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

includeCarriers

Array of Strings

0-n

List of marketing carriers to include in the request. When shortest=true, includeCarriers cannot be supplied

reservationId

String

0-1

Identification of the reservation for which a rebooking is requested. Only supplied for Rebooking a ticket. reservationId is the conversation state identifier.

bookingFlow

String

1

Can contain LEISURE, CORPORATE, AWARD

customer

Object

1

The specification of the customer information

..profileId

String

1

Id of the Profile stored in resource store. It is the one received from searchContext. To be used in all our services to get FB details. To use in association with the contractKey to get the fare associated to the contract.

..corporateContractKey

Integer

1

Key of the contract stored in resource store. It is the one received from searchContext.  To use in association with the ProfileID in order to get the fare associated to the contract

passengerCount

Object

1

The specification of the passengers for which the offer is requested.

..ADT

Integer

0-1

Number of adults. 16 years and older.

..CHD

Integer

0-1

Number of children. 2-11 years.

..INF

Integer 

0-1

Number of infants. Under 2 years.

..YTH

Integer

0-1

Number of young adults. 12-15 years. Only available from UK

..YCD

Integer

0-1

Number of young. 12-18 years.

..C14

Integer

0-1

Number of seniors. +65 years.

requestedConnections

Array of Objects

1-6

A chronologically ordered list of connections for which the lowest fare offers is requested.

..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 Connection.

Conditional: Must be supplied for at least 1 connection.

..fareFamilyCode

String

0-1

The fare family of the connection.

Conditional: Must not be supplied when origin & destination are supplied. Can be supplied when segments are supplied.

..minDaysOfStay

Integer

0-1

Minimum days of stay between this and next connection.

Conditional: Either both or none of min/maxStayOfDays must be supplied.

..maxDaysOfStay

Integer

0-1

Maximum days of stay between this and next connection.

Conditional: Either both or none of min/maxStayOfDays must be supplied.

..origin

Object

0-1

The origin station of the connection.

Conditional: Either origin & destination are supplied or segments are supplied.

....city

Object

0-1

The city of origin.

Conditional: Either city or airport must be supplied.

…...code

String

1

IATA location code of the city.

....airport

Object

0-1

The airport of origin.

Conditional: Either city or airport must be supplied.

…...code

String

1

IATA location code of the airport.

..destination

Object

0-1

The destination station of the connection.

Conditional: Either origin & destination are supplied or segments are supplied.

....city

Object

0-1

The city of destination.

Conditional: Either city or airport must be supplied.

…...code

String

1

IATA location code of the city.

....airport

Object

0-1

The airport of destination.

Conditional: Either city or airport must be supplied.

…...code

String

1

IATA location code of the airport.

..segments

Array of Objects

0-6

A chronologically ordered list of segments that describe the Connection requested.

Conditional: Either origin & destination are supplied or segments are supplied.

….origin

Object

0-1

The origin airport of the connection.

…...code

String

1

IATA location code of the airport.

….destination

Object

0-1

The destination airport of the connection.

…...code

String

1

IATA location code of the airport.

….departureDateTime

DateTime

1

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

….marketingCarrier Object 1 IATA airline code for the marketing carrier of the flight
….marketingFlightNumber      
String 1

The marketing flight number for the segment.

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

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.
..departureDate String 0-1 String representing a departure date. Format is: "YYYY-MM-DD ".

Possible departure date where the fare can applied.
….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   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   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 String 1 Integer to uniquely identify a passenger within a product.
…...type String 1 Type of the passenger.
ADT, C14, CHD, INF, YCD or YTH
….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, INF, YCD or YTH
…..…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. Can be linked to discountCode in input or to promotion configured in PromoTool. All segments must match the promo fare basis.
……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.
....negotiatedFare Boolean 0-1 It is set to TRUE only if the fare is a Negotiated one.
..commercialCabin String 1 CommercialCabin applicable for the fare for the connection
ECONOMY or PREMIUM or BUSINESS or FIRST
….price Object 1 Price per connection
..….displayPrice Number 1 Price to be displayed. Applies to a single adult.

Depending on the displayType it includes taxes and/or fees.
Depending of displayPriceContent it is for one adult or for all pax rounded
..….totalPrice Number 1 Total price per connection. 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. The amount of the surcharge is applied only for the Inbound. No surcharge is applied on the outbound.
…..…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 and per connection
…..…passengerType String 1 Type of the passenger.
ADT, C14, CHD, INF, YCD or YTH
…..…fare Number   The fare price as applicable for the Passenger Type.
…..…taxes Number 1 The taxes price as applicable for the Passenger Type.
…..…penalty Number 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.
….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 POST REQUEST

{
"commercialCabins": [ "ECONOMY" ],
  "passengerCount": {
    "ADT": 2,
    "CHD": 1,
    "INF": 1
  },
  "requestedConnections": [
    {
      "origin": {
        "airport": {
          "code": "AMS"
        }
      },
      "destination": {
        "airport": {
          "code": "NCE"
        }
      },
      "dateInterval": "2018-06-01/2019-06-01"
    
    },
      {
      "origin": {
        "airport": {
          "code": "NCE"
        }
      },
      "destination": {
        "airport": {
          "code": "AMS"
        }
      }
    }
  ]
}

SAMPLE RESPONSE

 

{
    "itineraries": [
        {
            "connections": [
                {
                    "departureDate": "2018-12-03",
                    "destination": {
                        "airport": {
                            "name": "Cote D'Azur Airport",
                            "city": {
                                "name": "Nice",
                                "code": "NCE"
                            },
                            "code": "NCE"
                        }
                    },
                    "origin": {
                        "airport": {
                            "name": "Schiphol",
                            "city": {
                                "name": "Amsterdam",
                                "code": "AMS"
                            },
                            "code": "AMS"
                        }
                    }
                },
                {
                    "departureDate": "2018-12-18",
                    "destination": {
                        "airport": {
                            "name": "Schiphol",
                            "city": {
                                "name": "Amsterdam",
                                "code": "AMS"
                            },
                            "code": "AMS"
                        }
                    },
                    "origin": {
                        "airport": {
                            "name": "Cote D'Azur Airport",
                            "city": {
                                "name": "Nice",
                                "code": "NCE"
                            },
                            "code": "NCE"
                        }
                    }
                }
            ],
            "flightProducts": [
                {
                    "passengers": [
                        {
                            "id": 1,
                            "type": "ADT"
                        },
                        {
                            "id": 2,
                            "type": "ADT"
                        },
                        {
                            "id": 3,
                            "type": "CHD"
                        },
                        {
                            "id": 4,
                            "type": "INF"
                        }
                    ],
                    "price": {
                        "displayPrice": 98.02,
                        "totalPrice": 310.06,
                        "surcharges": [
                            {
                                "code": "BookingFee",
                                "amount": 10
                            }
                        ],
                        "accuracy": 66.73,
                        "pricePerPassengerTypes": [
                            {
                                "passengerType": "ADT",
                                "fare": 53,
                                "taxes": 45.02
                            },
                            {
                                "passengerType": "CHD",
                                "fare": 53,
                                "taxes": 45.02
                            },
                            {
                                "passengerType": "INF",
                                "fare": 6,
                                "taxes": 0
                            }
                        ],
                        "flexibilityWaiver": false,
                        "currency": "EUR",
                        "displayType": "TAX"
                    },
                    "connections": [
                        {
                            "numberOfSeatsAvailable": 0,
                            "fareBasis": {
                                "code": "GSRNL"
                            },
                            "price": {
                                "displayPrice": 49.01,
                                "totalPrice": 150.03,
                                "accuracy": 66.73,
                                "pricePerPassengerTypes": [
                                    {
                                        "passengerType": "ADT",
                                        "fare": 26.5,
                                        "taxes": 22.51
                                    },
                                    {
                                        "passengerType": "CHD",
                                        "fare": 26.5,
                                        "taxes": 22.51
                                    },
                                    {
                                        "passengerType": "INF",
                                        "fare": 3,
                                        "taxes": 0
                                    }
                                ],
                                "flexibilityWaiver": false,
                                "currency": "EUR",
                                "displayType": "TAX"
                            },
                            "segments": [
                                {
                                    "cabin": {
                                        "class": "M"
                                    },
                                    "sellingClass": {
                                        "code": "G"
                                    }
                                }
                            ]
                        },
                        {
                            "numberOfSeatsAvailable": 0,
                            "fareBasis": {
                                "code": "GSRNL"
                            },
                            "price": {
                                "displayPrice": 49.01,
                                "totalPrice": 160.03,
                                "surcharges": [
                                    {
                                        "code": "BookingFee",
                                        "amount": 10
                                    }
                                ],
                                "accuracy": 66.73,
                                "pricePerPassengerTypes": [
                                    {
                                        "passengerType": "ADT",
                                        "fare": 26.5,
                                        "taxes": 22.51
                                    },
                                    {
                                        "passengerType": "CHD",
                                        "fare": 26.5,
                                        "taxes": 22.51
                                    },
                                    {
                                        "passengerType": "INF",
                                        "fare": 3,
                                        "taxes": 0
                                    }
                                ],
                                "flexibilityWaiver": false,
                                "currency": "EUR",
                                "displayType": "TAX"
                            },
                            "segments": [
                                {
                                    "cabin": {
                                        "class": "M"
                                    },
                                    "sellingClass": {
                                        "code": "G"
                                    }
                                }
                            ]
                        }
                    ],
                    "type": "OVERALL"
                }
            ]
        }
    ],
    "disclaimer": {
        "displayPriceText": "Lowest available fares, incl. taxes and surcharges, excl. EUR 10 booking fee (credit card surcharge may apply). Prices shown may vary depending on fare availability. You will see the exact total price when selecting your payment method.",
        "totalPriceText": "Taxes, surcharges and booking fee of EUR 10 included (credit card surcharge may apply). Prices shown may vary depending on fare availability. You will see the exact total price when selecting your payment method."
    }
}

Docs Navigation