POST/ bestOffers/feed

POST /best-offers/feed v1

The bestOffers/feed endpoint provides the best available fare offers in a specific date interval. This enpoint should be used in a "batch" context.

The best fare offer could be the lowest available fare, the lowest promotional fare or a dedicated promotional fare in the requested date interval. 

HOW TO USE

The POST method should be used to find the best offer and to feed an external tool with the best proposed offer.

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.airfranceklm.com/travel/offers/v1/best-fare-offers/feed

QUERY PARAMETERS

n/a

POST PARAMETERS

Level Name Type Multiplicity Description
1 bookingFlow String 1

Booking flow associated to the search . 

Possible values : REWARD, CORPORATE, LEISURE, STAFF 

1 passengers Object 1 The specification of the passengers for which the offer is requested.
2 id Integer 1 Contains the Id of the passenger
2 type String 1

Passenger type

Possible values : ADT, CHD, INF, C14, YTH, YCD...

1 commercialCabin String 1 Code for requested commercial Cabin
Possible values :  ECONOMY, PREMIUM, BUSINESS, FIRST
1 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).

1 dateInterval Object 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 the best fares for the requestedConnections. 

The 2 dates of the interval need to be set on a chronological way.

Default value : date of the day / date of the day + 360

 

1 requestedConnections Object 1 A chronologically ordered list of connections for which the best fare offers is requested.
2 origin Object 1 The origin for the requested connection
3 code String 1

The code in 3-letters of the origin

Ex: CDG

3 type Enum 1 The type of the origin code : CITY, AIRPORT, BUS_STATION, HELIPORT, RAILWAY_STATION, FERRY_STATION.
2 destination Object 1 The destination for the requested connection
3 code String 1

The code in 3-letters of the destination

Ex: NCE

3 type String 1 The type of the destination code : CITY, AIRPORT, BUS_STATION, HELIPORT, RAILWAY_STATION, FERRY_STATION.
1 Filters Object 0..1 Filters to be applied on the offers
2 maximumNumberOfSegments Integer 0..1 number of segments on each connection -> 1 = direct flight only
2 marketingCarriers Array of String 0..1

IATA airline code for the marketing carrier of the flight

Ex :  ["AF","KL"]

 

RESPONSE PARAMETERS

Level Name Type Multiplicity  Description
1 connections Array of Object 0..2 A chronologically ordered list of connections the best fare offer applies to.
2 origin Object 1 Origin of the connection
3 code String 1

The code in 3-letters of the origin

Ex: CDG

3 type String 1 The type of the origin code : CITY, AIRPORT, BUS_STATION, HELIPORT, RAILWAY_STATION, FERRY_STATION.
2 destination Object 1 Destination of the connection
3 code String 1

The code in 3-letters of the destination

Ex: CDG

3 type String 1 The type of the destination code : CITY, AIRPORT, BUS_STATION, HELIPORT, RAILWAY_STATION, FERRY_STATION.
2 commercialCabin String 0-1 The commercialCabin applicable for the fare for the connection (matching the request).
1 price Object 0-1 Offer price
2 displayPrice String 1 Price to be displayed. Applies to a single adult. Depending on the displayType it includes taxes and/or fees.
2 totalPrice String 1 Total price. Price for all passengers including taxes and fees.
2 pricePerPassengers Array of Objects 0..9 Price specification per passenger type.
3 id String 1 Integer to uniquely identify a passenger within a product.
3 passengerType String 1 Type of the passenger. ADT, C14, CHD, INF, YCD, YTH, B12, B13, B14, B15.
3 fare String 1 The fare price as applicable for the Passenger Type.
3 taxes String 1 The taxes price as applicable for the Passenger Type.
3 surcharges Object 0..1 Surcharges applicable per passenger. Conditional: Surcharge applies either to passenger or to PNR.
4 code String 1 Code of the surcharge. E.g. to indicate it is a booking fee.
4 amount String 1 Amount applicable to the Surcharge.
2 currency String 1 The currency used for prices in response. Three letter currency code according to ISO 4217.
2 displayType String 1 Indicates the rules used for the display price. TAX, FARE or FEE, FARE_MILES
1 promoFare boolean 0-1 Indicates whether a the fare returned is a promotion or not.
1 bookingDateInterval Object 0-1 date interval where the booking should be done
2 from
String 1 Beginning date
2 to
String 1 Ending date
1 dataReference String 1 Data reference that can be used to identify fare conditions linked ot the offer
1 warning Object 0-99 Warning details
2 code Number 1 Functional warning codes (1000-1999)
2 name String 1 Name of the warning. 
Ex: OFA/FUNCTIONAL/INVALID_VALUE
2 description String 1 Description of the warning
3 errorinInputPath String 1 Description of the input Path where the warning occured
1 errors Object 0-1 Error details
2 code Number 1 Functional error codes (1000-1999)
Technical error codes (2000-2999)
Internal error codes (3000-3999)
2 name String 1 Name of the error. 
Ex: OFA/TECHNICAL/INVALID_VALUE - logger/Typology/name
2 description String 1 Description of the error
3 errorinInputPath String 1 Description of the input Path where the error occured

 

HTTP STATUS CODES

HTTP status

Type

200 OK

400

BAD REQUEST

500

INTERNAL_SERVER_ERROR


SAMPLE POST REQUEST

{   
 "commercialCabin": "ECONOMY", 	
 "bookingFlow": "LEISURE", 	
 "promoType": "LOWEST_FARE",     
 "dateInterval": "2020-05-23/2021-04-30", 	  
 "passengers": [{ 		
 "id": 0, 		
 "type": "ADT" 	
 }],   
 "requestedConnections": [     {       
 "origin": {                
 "code": "LHR",           
 "type": "AIRPORT"               
 },       
 "destination": {                   
 "code": "AMS",           
 "type": "AIRPORT"       
 }     },       
 {       
 "origin": {                
 "code": "AMS",           
 "type": "AIRPORT"       
 },       
 "destination": {            
 "code": "LHR",           
 "type": "AIRPORT"       
 }     
 }   ], 	
 "filterBy": { 		
 "maximumNumberOfSegments": 5, 		
 "marketingCarriers": ["AF","KL"] 	
 } }
    "bestOffers": [
        {
            "connections": [
                {
                    "travelDateIntervals": [
                        {
                            "from": "2020-06-06",
                            "to": "2020-08-06"
                        },
                        {
                            "from": "2020-07-06",
                            "to": "2020-11-12"
                        }
                    ],
                    "origin": {
                        "code": "LHR",
                        "type": "AIRPORT"
                    },
                    "destination": {
                        "code": "AMS",
                        "type": "AIRPORT"
                    },
                    "commercialCabin": "ECONOMY"
                },
                {
                    "travelDateIntervals": [
                        {
                            "from": "2020-06-06",
                            "to": "2020-08-06"
                        },
                        {
                            "from": "2020-07-06",
                            "to": "2020-11-12"
                        }
                    ],
                    "origin": {
                        "code": "AMS",
                        "type": "AIRPORT"
                    },
                    "destination": {
                        "code": "LHR",
                        "type": "AIRPORT"
                    },
                    "commercialCabin": "ECONOMY"
                }
            ],
            "price": {
                "displayPrice": 89.00,
                "totalPrice": 89.00,
                "pricePerPassengers": [
                    {
                        "id": 0,
                        "passengerType": "ADT",
                        "fare": 26.00,
                        "taxes": 62.00,
                        "surcharges": [
                            {
                                "code": "BookingFee",
                                "amount": 1.00
                            }
                        ]
                    }
                ],
                "currency": "EUR",
                "displayType": "FEE"
            },
            "bookingDateInterval": {
                "from": "2020-06-06",
                "to": "2020-08-06"
            },
            "promoFare": false,
            "dataReference": "AHs4MSPRJ5XYTmwTXXyaZjXtXF1P2zAU_SuTn9PJcZN-5K2ilCI6hlDZgJkHWkDiZX8A5b_vXjt27MSmBBgK9Ep7WO342k6Oj-85Dnli_p7AgPgCRgQr_jwxnZawwk6nOJgfsYQ5StatvLq6VpWONoZqwQUfpPAvh0rDaKzAAeHY2n2YMME-zADCfQjh9aEmDJNnXgaEM64zFjXRxztWpM5lJkWB0DPgkYQ13D1WCBw7Nht2apaZZlm42cFyHmqWm2Yi3Oz4dBEeJM69kT7h9F8z3zJhodxB4ccx9uB-WjJM7AJNapJOKqKDoYW1JSs4VDVFK8Z9ZheBaC2NBU2wk5YOh1kq5oE6o94xes3_iWGOxFIJBNrtxRjEJcx1p6C7w4tziBXIFqFO72HYxDOw9LpsemtQis-hnb5gBdR4-haCV5SVMMemhWKzK-CYbLap1oXN3eGqn7-Prs_GzNxZvG0rVs9Nj9DOr4x3ElBCatmZNNIjmydmNHd73WOG5FKKWKfDIs8Lzr9zznEIHm2EQ2l-CYSaFKkbqnZVMFITXc7sZ4v6cp0NQiEf5iMs9nNKDcmAZMVw3pmCHx_CV14K_j4-_7Y4V0kRQq12ye214aFY286JPR4LrDJmDD62JRKsa4eqBRmXqBitJWoVv9QZPcRdnmBHnqCHwKVaWA3_EgiPc8RmS0apsL4hbxddJzwFQSAUCATvhqcgNMVwzac-NF-Mp_kqgKfJKB33B0_px-NJvAVPWZ5H8CRieLoJ8VbD5sGhPkmLO4nAk1Uz-AH_N4CBX9KDjGSJVKBRNRFGkzBF6WLwuaAA6XhQh9t00BqNOmYTj7p0q-sl4MBtpqGgKpBcdJWPTKmgKUPY1KE9dAZ6w84qjOoyi1LdnYNTr018gBavjd4As_oCg1pVulqqeB5yJUJXPoNdHbmFXom8JR38qh6WJ7pbD8NSg1i2USw1LcoQjqsOfCRLA2WEaX3Q4TLNxQ-Vpln_HTtPnHwO9_YqmYPy10A9isoG2XaCenT9NGj3VVCfryJQRwruO9TTHkBdvAfUkbFjUBf_G-olbhbP279E_UT9n4T6vVdhqoqE7XxBplazxPvE-5-A99-I8zIJ2YIRo26Xvxcx6na5iV39vapZ3tFNdC3R8Blwtb094h3O4La3wmtAztcKQY0usE3p2azGdOx8N1l1qKaex1-rQPNxmmXDyYSLKRpUzlseRoPzbJBmay6AEYwGN8GqIzwvpLIV6rfN0P1yTxwSQ4C1OCWnas-cKlxsBi7i3eBCRtQXNaLKG6TZ2JuEFb-SXuhZHvXp9AICifamfd-b7NmbsTJ-Vaeb6nVk_L06m6aHF3gS2PijEP1YnHdGodNSiz5SeT1jp0-n8jqxE6VCXzQVarHTZYOdLjuyk5Lq9oVnvOGasB4NQLvKVRGWq51V_G65OiG5SikByVXi6J5xNMlVkqskV2lvIrlKcpXkKqVCe5wK9UWuHp8u3kWuxk-Pd8nVoZKhJFcpJSC5ShzdJ44muUpyleQq7U0kV0muklylVGiPU6GPlat5VK4eLOcRuZqH5WrXt5ZfcLo6JblKKQHJVeLonnE0yVWSqyRXaW8iuUpyleQqpUJ7nAp9hFwtvQ-b4eDYwzTfDMejzeBhs00H2V22GUy399lgJPLb--12KsZ3t2q8wQ9W6-8V6trq69ZuUf0da1NqPlQNPZ_NzmcLPpnNatB4313HR-B-k7P8Bw=="
        }
    ]
}
<span style="font-size: 12px; white-space: normal;" _mce_style="font-size: 12px; white-space: normal;"> </span>

Docs Navigation