POST /direct-shopping

POST /direct-shopping

The Direct Shopping endpoint creates a shopping cart for a specific flight product to be able to proceed to checkout.

How to use?

The POST method should be used to start a search for direct shopping.

Use case flow is a MetaSearch customer that want to verify that the fare is still available and want to continue with the checkout in our own site.

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.klm.com/opendata/offers/flight-products/direct-shopping?sourceRequest=MS

 

Query Parameters

Name Type Multiplicity Description
- sourceRequest  String 0.1

Describe the source of the Request.

It can only be set to MS ( MetaSearch)


Post Parameters

Name Type Multiplicity   Description
cabinClass String 1 Code for requested cabin class.
ECONOMY or BUSINESS
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).
minimumAccuracy  Integer 0-1 Threshold for required accuracy. Overrides default threshold. When accuracy is below supplied threshold, backend will switch to more accurate source.
NB Currently TripPlanner GetDayData is fast, less accurate source and Amadeus FlexPricerUpsell is more accurate source.
passengerCount Object 1 The specification of the passengers for which the offer is requested.
..ADULT Integer 0-1 Number of adults. 16 years and older.
..CHILD Integer 0-1 Number of children. 2-11 years.
..INFANT Integer 0-1 Number of infants. Under 2 years.
..YOUNG_ADULT Integer 0-1 Number of young adults. 12-15 years.
requestedConnections  Array of Object   1-6 A chronologically ordered list of connections for which the lowest fare offers is requested.
..fareBasis String 0-1 The fare basis of the connection.
Conditional: Must not be supplied when origin & destination are supplied. Can be supplied when segments are supplied. In case it is supplied, the selling class must also be supplied in segments.
..segments Array of Object  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  String 1 DateTime of departure of the segment flight. It is specified as local time at origin of the segment.
….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.
….marketingCarrier Object 1 IATA airline code for the marketing carrier of the flight.
….sellingClass Object 0-1 Selling Class of the selected flight
id String 1 Id of the shopping cart created.
resourceStoreId String 1 Resource Store Id of the shopping cart created.
…._links Object 1 Container for all HATEOAS links
……ancillaryshops HATEOAS link  1 Represents a HATEOAS link related to the anscillary shop.
Supports the use case where the anscillaries want to be proposed to the customer.
……orderapi HATEOAS link  1 Represents a HATEOAS link related to the orderapi.

 

RESPONSE PARAMETERS

Name  Type  Multiplicity  Description
id  String  1  Id of the shopping cart created.
resourceStoreId  String  1  Resource Store Id of the shopping cart created.
…._links  Object  1  Container for all HATEOAS links
……ancillaryshops  HATEOAS link  1

 Represents a HATEOAS link related to the anscillary shop.

 Supports the use case where the anscillaries want to be proposed to the customer.
……orderapi  HATEOAS link  1  Represents a HATEOAS link related to the orderapi.
warning Object
0-99 Warning details
.code Number 1 Functional warning codes (1000-1999)
.name String 1

Name of the warning. Ex :OFA/FUNCTIONAL/INVALID_VALUE

- logger/Typology/name

.description String 1

Description of the warning

..errorinInputPath String 1 Description of the input Path where the warning occurred
.errors Object 0-1
Error details
.code Number 1 Functional error codes (1000-1999)
Technical error codes (2000-2999)
Internal error codes (3000-3999
.name String 1

Name of the error . Ex :OFA/TECHNICAL/INVALID_VALUE

- logger/Typology/name

.description String 1 Description of the error.
..errorinInputPath String 1 Description of the input Path where the error occurred

 

HTTP STATUS CODE

HTTP Type
200 OK
500 INTERNAL_SERVER_ERROR

 

SAMPLE QUERY

 

{
  "cabinClass": "ECONOMY",
  "minimumAccuracy": "100",
  "passengerCount": {
    "ADULT": "1"
  },
  "requestedConnections": [
    {
      "fareBasis": "VLP99FR",
      "segments": [
        {
          "marketingCarrier": "AF",
          "marketingFlightNumber": "0008",
          "sellingClass": "V",
          "origin": {
            "code": "CDG"
          },
          "destination": {
            "code": "JFK"
          },
          "departureDateTime": "2018-01-25T19:00:00"
        }
      ]
    },
    {
      "fareBasis": "VLP99FR",
      "segments": [
        {
          "marketingCarrier": "AF",
          "marketingFlightNumber": "0007",
          "sellingClass": "V",
          "origin": {
            "code": "JFK"
          },
          "destination": {
            "code": "CDG"
          },
          "departureDateTime": "2018-02-17T18:40:00"
        }
      ]
    }
  ]
}

 

 

SAMPLE RESPONSE

{
    "resourceStoreId": "76da0e98-173b-430e-b130-b24ddee138ee",
    "_links": {
        "ancillaryshops": {
            "href": "https://api.ute1.klm.com/travel/ancillaryshops/76da0e98-173b-430e-b130-b24ddee138ee"
        },
        "orderapi": {
            "href": "https://api.ute1.klm.com/travel/orders?conversationStateId=76da0e98-173b-430e-b130-b24ddee138ee"
        }
    },
    "id": "76da0e98-173b-430e-b130-b24ddee138ee"
}

 

 

Docs Navigation