Skip to content

Cleartrip Flights Create Itinerary Search

SoumyaSian edited this page Feb 28, 2018 · 9 revisions

3.3 Create Itinerary

Intent

oneway_create_itinerary

Request Params Description

KEYWORD DESCRIPTION
ADULTS No. of Adults travelling
CHILDREN No. of Children travelling
INFANTS No. of Infants travelling
ITINERARY Key is 'itinerary', Object which has complete info of segments and fare of flight
ITINERARY.CABIN_TYPE route Id of bus
ITINERARY.FARE_DETAILS Fare Details of the onward flight
ITINERARY.FARE_DETAILS.AMOUNT Total price of the journey
ITINERARY.FARE_DETAILS.FARE_KEY Fare key of the journey
ITINERARY.FLIGHTS Object with flight info
ITINERARY.FLIGHTS.SEGMENTS Object with no. of flights based on the stops
ITINERARY.FLIGHTS.SEGMENTS.DAPARTURE_AIRPORT Departure Airport code
ITINERARY.FLIGHTS.SEGMENTS.ARRIVAL_AIRPORT Arrival airport code
ITINERARY.FLIGHTS.SEGMENTS.FLIGHT_NUMBER Flight number
ITINERARY.FLIGHTS.SEGMENTS.AIRLINE Airline code
ITINERARY.FLIGHTS.SEGMENTS.DEPARTURE_DATE Departure Date of the journey
ITINERARY.FLIGHTS.SEGMENTS.OPERATING_AIRLINE Operating Airline

Payload

 {
  "adults":$ADULTS,
    "children":$CHILDREN,
    "infants":$INFANTS,
    "$ITINERARY": {
      "cabin_type": "$CABIN_TYPE",
      "$FARE_DETAILS": [
        {
          "amount": $AMOUNT,
          "fare_key": "$FARE_KEY"
        }
      ],
      "$FLIGHTS": [
        {
          "$SEGMENTS": {
            "1": {
              "departure_airport": "$DAPARTURE_AIRPORT",
              "arrival_airport": "$ARRIVAL_AIRPORT",
              "flight_number": "$FLIGHT_NUMBER",
              "airline": "$AIRLINE",
              "operating_airline": "$OPERATING_AIRLINE",
              "departure_date": "$DEPARTURE_DATE"
            }
          }
        }
      ]
    }
}

Response Params Description

KEY DESCRIPTION
$ITINERARYID Itinerary Id from cleartrip
$FLIGHTS Array with flight info
$FLIGHTS.SEGMENTS Object with no. of flights based on the stops
$FLIGHTS.SEGMENTS Object with no. of flights based on the stops
$FLIGHTS.SEGMENTS.AIRLINE Airline code
$FLIGHTS.SEGMENTS.FLIGHT_NUMBER Flight Number
$FLIGHTS.SEGMENTS.ARRIVAL_DATE Arrival date of the flight
$FLIGHTS.SEGMENTS.ARRIVAL_AIRPORT Arrival Airport code of the flight
$FLIGHTS.SEGMENTS.DEPARTURE_DATE Departure Date of the flight
$FLIGHTS.SEGMENTS.DEPARTURE_AIRPORT Departure Airport code of the flight
$FLIGHTS.SEGMENTS.OPERATING_AIRLINE Operating Airline of the flight
$FLIGHTS.SEGMENTS.STOPS No of Stops
$FLIGHTS.SEGMENTS.INDEX Index of the flight
$PAX_INFO_LIST Array with passenger details
PAX_INFO_LIST.FIRST_NAME First Name of the passenger
PAX_INFO_LIST.LAST_NAME Last Name of the passenger
PAX_INFO_LIST.TITLE Title of the Passenger , Ex: Mr,Miss,Mstr,Mrs etc
PAX_INFO_LIST.INDEX Index of the passneger
PAX_INFO_LIST.TYPE Type of the passenger, Ex: ADT,INF,CHD
BAGGAGE_ALLOWANCES Object which has details about baggage
BAGGAGE_ALLOWANCES.ARRIVAL_AIRPORT_DEPARTURE_AIRPORT combination of arrival airport code and departure airport key
BAGGAGE_ALLOWANCES.ARRIVAL_AIRPORT_DEPARTURE_AIRPORT.CAB Cab baggage allowance
BAGGAGE_ALLOWANCES.ARRIVAL_AIRPORT_DEPARTURE_AIRPORT.CIB Cib baggage allowance
IS_MULTI_CITY 'true' or 'false', True represents the journey type
PRICING_SUMMARY.TAXES Taxes for the journey
PRICING_SUMMARY.BASE_FARE Base fare of the journey
PRICING_SUMMARY.DISCOUNT Discount of the journey
PRICING_SUMMARY.MARKUP Markup of the journey
PRICING_SUMMARY.TOTAL_FARE Total fare of the journey
PRICING_INFO_LIST.FARE_BASIS_CODE Fare basis code of the fare
PRICING_INFO_LIST.PRICING_ELEMENTS.CODE code
PRICING_INFO_LIST.PRICING_ELEMENTS.CATEGORY what kind of category this price belong to
PRICING_INFO_LIST.PRICING_ELEMENTS.AMOUNT Price of the fare
BOOKING_INFO_LIST.BOOKING_STATUS Avaliable or not
BOOKING_INFO_LIST.SEGMENT_INDEX Index of the flight
BOOKING_INFO_LIST.CABIN_TYPE Type of the cabin class
BOOKING_INFO_LIST.BOOKING_CLASS Booking class of ticket
BOOKING_INFO_LIST.TICKET_TYPE Type of the ticket

Response Body

{
    "itinerary_id": "$ITINERARYID",
    "$FLIGHTS": [
        {
            "segments": {
                "1": {
                    "airline": "$AIRLINE",
                    "flight_number": "$FLIGHT_NUMBER",
                    "arrival-date": "$ARRIVAL_DATE",
                    "arrival_airport": "$ARRIVAL_AIRPORT",
                    "departure_date": "$DEPARTURE_DATE",
                    "departure_airport": "$DEPARTURE_AIRPORT",
                    "operating_airline": "$OPERATING_AIRLINE",
                    "stops": $STOPS,
                    "index": $INDEX,
                    "duration": $DURATION
                }...,
            }
        }
    ],
    "$PAX_INFO_LIST": [
        {
            "first_name": "$FIRST_NAME",
            "last_name": "$LAST_NAME",
            "title": "$TITLE",
            "index": $INDEX,
            "type": "$TYPE"
        }
    ],
    "$BAGGAGE_ALLOWANCES": {
        "1": [
            {
                "ARRIVAL_AIRPORT_DEPARTURE_AIRPORT": {
                    "cab": "$CAB",
                    "cib": "$CIB"
                }
            }...,
            
        ]
    },
    "is_multi_city": $IS_MULTI_CITY,
    "PRICING_SUMMARY": {
        "taxes": $TAXES,
        "base_fare": $BASE_FARE,
        "discount": $DISCOUNT,
        "markup": $MARKUP,
        "total_fare": $TOTAL_FARE
    },
    "PAX_PRICING_INFO_LIST": [
        {
            "PRICING_INFO_LIST": [
                {
                    "fare_basis_code": "$FARE_BASIS_CODE",
                    "pricing_elements": [
                        {
                            "code": "$CODE",
                            "category": "$CATEGORY",
                            "amount": $AMOUNT
                        }...,
                    ],
                    "index": $INDEX
                }
            ],
            "pax_info_index": $PAX_INFO_INDEX,
            "booking_info_list": [
                {
                    "booking_status": "$BOOKING_STATUS",
                    "segment_index": $SEGMENT_INDEX,
                    "cabin_type": "$CABIN_TYPE",
                    "booking_class": "$BOOKING_CLASS",
                    "ticket_type": "$TICKET_TYPE",
                    "pricing_info_index": $PRICING_INFO_INDEX,
                    "index": $INDEX
                }...,
            ]
        }
    ],
    "insurance": {
        "insured": $INSURED
    }
}

Error messages

Some error messages, you might get an invalid search request. The HTTP response code, in this case, will be 400.

Status Error message Description
512 The flight you were trying to book is no longer available. Please pick a different flight option. Flight is not avaliable
Clone this wiki locally