POST /flights-availability v1

POST / flights-availability v1

The FlightsAvailability endpoint provides the availability on flights by sellingClass that can be provided for a (set of) date(s)/OnD. 

HOW TO USE

The POST method should be used to start a search for flights availability.

HEADERS TO USE FOR REQUESTS

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/opendata/offers/v1/flights-availability/

QUERY PARAMETERS

n/a

POST PARAMETERS

Level Name Type Multiplicity Description
1 officeId String 0.1 Office ID used to target availability
1 bookingFlow Enumeration 1

Describe the specific flow for this call :

  • STAFF
  • LEISURE
  • CORPORATE
  • REWARD
1 searchType Enumeration 1

Search Option:             

  • AN - Availability request             
  • SN - Schedule request             
  • TN - Time table request
1 sortType Enumeration 1

Display options:           

  • TA - arrival time           
  • TD - departure time           
  • TE - elapsed time           
  • TN - neutral order           
  • TT - Negotiated Space Availability           
  • SF - Specific Flight Restricted to specific users
1

Passenger

Object 0..9 The passengers are required ONLY for UM flow
2

id

Integer 1 Mandatory
2

PassengerType

Object

PassengerType option:

  • ADT
  • CHD
  • ...

Only CHD will be used for UM flow

 

2

birthDate

LocalDate

birthDate of the passenger Mandatory for UM flow

1

FlightsAvailabilityFilter 

Object 0.1

Filter by airlines and number of segments

2

maximumNumberOfSegments 

int 0.1

The maximum number of segments needed by connection

2

AirlineFilter

Object 1

Filter by airlines requested

3

marketedBy

List of Object 0..99

Marketing airlines

4

code

String 1 Marketing code requested  regexp = "[A-Z0-9]{2,5}"
4

operatedBy

List of Object 0..99 Oprating airlines
5

code

String 1 Oprating code requested  regexp = "[A-Z0-9]{2,5}"
5

withOptions

List of Enumeration 0.3

Operating airline option needed:

  • BLOCK_SPACE
  • FREE_FLOW
  • FRANCHISED
1 connection Object 1 The connection requested for the availability that contain an OnD, Date/Time
2 origin Object The origin for the requested connection
3 airport Object 0.1 For this object origin, the object could be an airport
4 code String 1 The code in 3-letters for the Airport (ex : CDG)
3 city Object 0.1 For this object origin, the object could be a city
4 code String 1 The code in 3-letters for the City (ex : PAR)
2 destination Object 1 The destination for the requested connection
3 airport Object 0.1 For this object origin, the object could be an airport
4 code String 1 The code in 3-letters for the Airport (ex : CDG)
3 city Object 0.1 For this object origin, the object could be a city
4 code String 1 The code in 3-letters for the City (ex : PAR)
2 departureDate Date 1

Departure date of the journey that is requested:

format : YYYY-MM-DD

2 departureTime Object 0.1

Departure Time min of the journey 

format : HH:mm

2 arrivalDate String 0.1

Arival date of the journey (optional) that is requested:

format : YYYY-MM-DD

2 arrivalTime Integer 0.1

Arival Time max of the journey 

Format HH:mm

2 departureDate String 0-1 String representing the departure date requested for the Connection

 

RESPONSE PARAMETERS

Level Name Type Multiplicity Description
1

connections

Array of Objects

0..N

The list of connection that can be proposed for a client for an OnD

2

departureDate

Date

0-1

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

2 duration Integer 0-1 Total duration of the Connection in minutes.
2

origin

Object

1-n

The origin of the connection

3 airport Object 0.1 For this object origin, the object should be an airport
4 code String 1 The code in 3-letters for the Airport (ex : CDG)
2

desitnation

Object

0-n

The destination of the connection

3 airport Object 0.1 For this object origin, the object should be an airport
4 code String 1 The code in 3-letters for the Airport (ex : CDG)
2

SegmentResponses

Array of Objects

1

The list of segments for the proposed connection

3

departureDateTime

DateTime

1

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

3

arrivalDateTime

DateTime

1

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

3 flightDuration Integer 1 The duration of the flight
3

origin

Object

0-1

The origin airport of the connection.

4

code

String

1

IATA location code of the airport.

4

name

String

0.1

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

4

city

Object

0-1

The city the airport is located in.

5

code

String

1

IATA location code of the city.

5

name

String

1

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

3

destination

Object

0-1

The destination airport of the connection. 

4

code

String

1

IATA location code of the airport.

4

name

String

1

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

4

city

Object

0-1

The city the airport is located in.

5

code

String

1

IATA location code of the city.

5

name

String

1

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

4

marketingFlight

Object

1

Describes the marketing flight for the segment.

5

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.

5

carrier

Object

1

Marketing carrier of the flight.

6

code

String

1

IATA airline code.

6

name

String

1

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

3 highestPriority Boolean 1 Flag to define if the considered segment has the highest priority over the other segment(s) of the connection. The segment with the highest priority is set to True, other is(are) set to False.
NB currently computed from Haul type.
3 departureTerminal String 0.1 Departure Terminal 
3 arrivalTerminal String 0.1 Arrival Terminal
3 aircraftType String 0.1 The type of the aircraft (ex : 321)
3 numberOfStops Integer 1 Number of technical stop for this segment
3 classDetails List of Object 1.N List of ClassDetail an object that contains selling class and availability
4 sellingClass String 1 a letter for the selling class 
4 availabilityStatus String 1

Availability status:           

  • A - Ticketless Access Carrier           
  • C - Closed           
  • L - Waitlist only           
  • R - Request only           
  • S - Waitlist closed           
  • X - FLIGHT CANCELED           
  • _ - FLIGHT DEPARTED or shuttle class or blank char           
  • 0-9 - Number of available seats
4
commercialCabin
String 1

commercial cabin:

  • ECONOMY
  • PREMIUM
  • BUSINESS

 

HTTP STATUS CODE

HTTP status

Type

200 OK

400

FOA/DISCOUNT_CODE_INELIGIBLE

500

INTERNAL_SERVER_ERROR

500

FOA/INTERNAL_SERVER_ERROR/UNSUPPORTED_CAPABILITY

SAMPLE POST REQUEST (outbound query)

 

{
               "searchType":"AN",
               "bookingFlow": "STAFF",
               "sortType":"TD",
               "connection": {
                            "departureDate" : "2020-03-30",
                            "departureTime" : "00:00",
                            "arrivalDate" : "2020-03-30",
                              "origin": {
                                              "airport": {
                                                              "code": "CDG"
                                              }
                              },
                              "destination": {
                                              "airport": {
                                                              "code": "BEY"
                                              }
                              }
               }
}

 

SAMPLE POST RESPONSE (outbound query) 

 

{
    "connections": [
        {
            "destination": {
                "airport": {
                    "code": "BEY"
                }
            },
            "duration": 250,
            "origin": {
                "airport": {
                    "code": "CDG"
                }
            },
            "segments": [
                {
                    "arrivalDateTime": "2020-03-30T14:15:00",
                    "departureDateTime": "2020-03-30T09:05:00",
                    "destination": {
                        "city": {
                            "code": "BEY"
                        },
                        "code": "BEY"
                    },
                    "marketingFlight": {
                        "number": "0566",
                        "carrier": {
                            "code": "AF"
                        }
                    },
                    "origin": {
                        "city": {
                            "code": "PAR"
                        },
                        "code": "CDG"
                    },
                    "highestPriority": false,
                    "dateVariation": 0,
                    "flightDuration": 250,
                    "departureTerminal": "2E",
                    "aircraftType": "77W",
                    "haulType": "LH",
                    "numberOfStops": 0,
                    "classDetails": [
                        {
                            "sellingClass": "A",
                            "availabilityStatus": "9",
                            "commercialCabin": "PREMIUM"
                        },
                        {
                            "sellingClass": "B",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "C",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "D",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "E",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "F",
                            "availabilityStatus": "3",
                            "commercialCabin": "FIRST"
                        },
                        {
                            "sellingClass": "H",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "I",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "J",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "K",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "L",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "M",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "N",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "O",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "P",
                            "availabilityStatus": "4",
                            "commercialCabin": "FIRST"
                        },
                        {
                            "sellingClass": "Q",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "R",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "S",
                            "availabilityStatus": "9",
                            "commercialCabin": "PREMIUM"
                        },
                        {
                            "sellingClass": "T",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "U",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "V",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "W",
                            "availabilityStatus": "9",
                            "commercialCabin": "PREMIUM"
                        },
                        {
                            "sellingClass": "X",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "Y",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "Z",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        }
                    ]
                }
            ]
        },
        {
            "destination": {
                "airport": {
                    "code": "BEY"
                }
            },
            "duration": 255,
            "origin": {
                "airport": {
                    "code": "CDG"
                }
            },
            "segments": [
                {
                    "arrivalDateTime": "2020-03-30T15:15:00",
                    "departureDateTime": "2020-03-30T10:00:00",
                    "destination": {
                        "city": {
                            "code": "BEY"
                        },
                        "code": "BEY"
                    },
                    "marketingFlight": {
                        "number": "5104",
                        "carrier": {
                            "code": "AF"
                        },
                        "operatingFlight": {
                            "carrier": {
                                "code": "ME"
                            }
                        }
                    },
                    "origin": {
                        "city": {
                            "code": "PAR"
                        },
                        "code": "CDG"
                    },
                    "highestPriority": false,
                    "dateVariation": 0,
                    "flightDuration": 255,
                    "departureTerminal": "2E",
                    "aircraftType": "332",
                    "haulType": "LH",
                    "numberOfStops": 0,
                    "operatingType": "CODESHARE",
                    "codeShareType": "BLOCK_SPACE",
                    "classDetails": [
                        {
                            "sellingClass": "B",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "C",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "D",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "E",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "H",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "I",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "J",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "K",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "L",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "M",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "N",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "O",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "Q",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "R",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "T",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "U",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "V",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "X",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "Y",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "Z",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        }
                    ]
                }
            ]
        },
        {
            "destination": {
                "airport": {
                    "code": "BEY"
                }
            },
            "duration": 255,
            "origin": {
                "airport": {
                    "code": "CDG"
                }
            },
            "segments": [
                {
                    "arrivalDateTime": "2020-03-30T18:55:00",
                    "departureDateTime": "2020-03-30T13:40:00",
                    "destination": {
                        "city": {
                            "code": "BEY"
                        },
                        "code": "BEY"
                    },
                    "marketingFlight": {
                        "number": "5106",
                        "carrier": {
                            "code": "AF"
                        },
                        "operatingFlight": {
                            "carrier": {
                                "code": "ME"
                            }
                        }
                    },
                    "origin": {
                        "city": {
                            "code": "PAR"
                        },
                        "code": "CDG"
                    },
                    "highestPriority": false,
                    "dateVariation": 0,
                    "flightDuration": 255,
                    "departureTerminal": "2E",
                    "aircraftType": "332",
                    "haulType": "LH",
                    "numberOfStops": 0,
                    "operatingType": "CODESHARE",
                    "codeShareType": "BLOCK_SPACE",
                    "classDetails": [
                        {
                            "sellingClass": "B",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "C",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "D",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "E",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "H",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "I",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "J",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "K",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "L",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "M",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "N",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "O",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        },
                        {
                            "sellingClass": "Q",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "R",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "T",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "U",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "V",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "X",
                            "availabilityStatus": "8",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "Y",
                            "availabilityStatus": "9",
                            "commercialCabin": "ECONOMY"
                        },
                        {
                            "sellingClass": "Z",
                            "availabilityStatus": "9",
                            "commercialCabin": "BUSINESS"
                        }
                    ]
                }
            ]
        }
    ]
}

Docs Navigation