POST /search-context/Passengers

POST /search-context/Passengers

The SearchContext/Passengers endpoint provides the possibility to validate passengers

How to use?

The POST method should be used to start a search for available offers.

Headers to use for requests:

Parameter Value
Authorization Bearer {{token}}
Content-Type application/json
Accept application/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/search-context/passengers

 

QUERY PARAMETERS

n/a 

POST PARAMETERS

Level Name Type Multiplicity Description
1
commercialCabins
List of string 1 Code for requested commercialCabins
Cannot be empty
Can contain ECONOMY or PREMIUM or BUSINESS or FIRST
1
bookingFlow String
0-1

Can contain LEISURE, CORPORATE, REWARD

Default value: LEISURE
1
passengers Object
0-1
The specification of the passengers with birthdate for which the offer is requested
2
id Integer
0-1
Contain the Id of the passenger
2
type String
1
Can contain one of the following passenger types : ADT,CHD, INF, C14,YTH, YCD.
2 birthDate Object 0-1 Contain the birthdate of the passenger type
2 minAge Integer 0-1 Contain the minimum age of the passenger type
2 maxAge Integer 0-1 Contain the maximum age of the passenger type
1
requestedConnections
Array of Objects 1
A chronologically ordered list of connections for which the lowest fare offers is requested.
2
departureDate
Object
0-1
Object representing the departure date requested for the Connection
2
origin Object
0-1

The origin station of the connection.

3
airport
Object
0-1

The airport of origin.

Conditional: Either city or airport must be supplied.

4
code
String
1
IATA location code of the city.
3 city Object 0-1

The city of origin.

Conditional: Either city or airport must be supplied.

4 code String 1 IATA location code of the city.
2
destination
Object
0-1

The destination station of the connection.

3
airport
Object
0-1

The airport of destination.

Conditional: Either city or airport must be supplied.

4
code
String
1
IATA location code of the airport.
3
city
Object
0-1

The city of destination.

Conditional: Either city or airport must be supplied.

4 code String 1 IATA location code of the city.

 

RESPONSES PARAMETERS

Level Name Type Multiplicity Description
1 passengers Array of Objects 1-n List of passengers associated to the product (matching requested passenger count).
2 id integer 1 Integer to uniquely identify a passenger within a product.
2 type String 1 Type of the passenger. ADT, C14, CHD, INF, YCD or YTH
2 typeWithoutCard
2 availableCard
1 links Link to redirect the customer to the other website (HOP!)
1 errors Error details
2 code Functional error codes (1000-1999)
Technical error codes (2000-2999)
Internal error codes (3000-3999)
2 name Name of the error.
Ex: OFA/TECHNICAL/INVALID_VALUE - logger/Typology/name
2 description Description of the error
2 passengerId Integer to uniquely identify a passenger within a product.

 

HTTP STATUS CODES

HTTP status

Type

200 OK

400

FOA/DISCOUNT_CODE_INELIGIBLE

500

FOA/INTERNAL_SERVER_ERROR/UNSUPPORTED_CAPABILITY

500

INTERNAL_SERVER_ERROR

 

REQUEST EXAMPLE

{
    "commercialCabins" : [ "ECONOMY" ],
    "bookingFlow" : "LEISURE",
    "passengers" : [  {
            "id": 1,
            "type": "ADT"
        },{
            "id": 2,
            "type": "YCD"
        },{
            "id": 3,
            "type": "YTH",
            "birthDate": "2005-10-10"
        },{
            "id": 4,
            "type": "CHD",
            "birthDate": "2015-10-10"
        },{
            "id": 5,
            "type": "INF",
            "birthDate": "2018-10-10"
        }
    ],
    "requestedConnections" : [ {
        "departureDate" : "2019-04-17",
        "origin" : {
            "airport" : {
                "code" : "MAD"
            }
        },
        "destination" : {
            "airport" : {
                "code" : "CDG"
            }
        }
    }, {
        "departureDate" : "2019-04-20",
        "origin" : {
            "airport" : {
                "code" : "CDG"
            }
        },
        "destination" : {
            "airport" : {
                "code" : "MAD"
            }
        }
    } ]
}

 

RESPONSE EXAMPLE

{
    "passengers": [
        {
            "id": 1,
            "type": "YCD",
            "typeWithoutCard": "ADT",
            "availableCard": "SENIOR"
        }
    ],
    "_links": {
        "seniorCardSubscription": {
            "href": "https://carte-senior.hop.com/"
        }
    }
}

 

RESPONSE PARAMETERS

Docs Navigation