This guide will help you understand the NDC API workflow for booking with card payment. For booking with payment, you need to provide the origin and a destination of your journey. While shopping for an itinerary, you may want to add additional information such as preferences, specific date, time, and cabin type.
Once you get the details in response, you can compare the offers and apply them to process the booking order. The booking with payment workflow uses the following endpoints to create a booking:
- AirShopping
- AirOfferPrice
- CardManagement/Storecard
- AirOrderCreate
What do you need to start?
To get started with booking air tickets, you will require various payload data to process other requests. We suggest you to collect relevant information from the responses for completing the booking workflow.
Step 1. Air Shopping
You can use the AirShopping
endpoint to get itinerary list from a variety of sources, including GDS, NDC, and direct airlines before creating an order. Execute AirShopping to get the shopping response ID and other details required to complete the booking.
Note: While sending the flight search request, personalize their search results by setting preferences such as fare types, cabin type, alternate days, direct flights, refundable tickets, nearby airports, and free baggage.
The air tickets can be booked using the following three options available through our APIs.
- One-way: This option is for searching flight details on a one-way journey.
- Return: This option is for searching return flights.
- Openjaw/Multicity: This option is for searching flights when the user wants to travel to multiple destinations or multiple stoppages.
What is a Core Query?
A Core Query is the API request sent with the origin and destination details of the passenger’s journey. The following example describes the core query with the request payload that is required for searching the flights.
curl --location --request POST 'http://newapi.tltid.com/AirShopping' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token> \
--data-raw '{
"AirShoppingRQ": {
"CoreQuery": {
"OriginDestinations": {
"OriginDestination": [
{
"Departure": { //Contains details of the airport code and date of travel of the source. In this example, the search is for a flight from Los Angeles International Airport (LAX) on 18th October.
"AirportCode": "LAX",
"Date": "2021-10-18"
},
"Arrival": { //Contains airport code of the destination. In this example, the destination airport is London Heathrow Airport (LHR).
"AirportCode": "LHR"
}
}
]
}
},
"DataLists": {
"PassengerList": {
"Passenger": [
{
"PassengerID": "T1",
"PTC": "ADT"
}
]
}
},
"Preference": {
"TripType": "Oneway",
"CabinType": "Y",
"FareType": [
"70J"
],
"Currency": "CAD"
}
}
}'
Parameters: While passing the request payload, you must provide values for the parameters like Departure
, Arrival
, Passenger
, and TripType
.
Note: Request payload will vary based on the travel options such as
one-way
,return
, andmulticity
you select.
The following payload options can be used for searching the air tickets.
Option 1 - One-way
"CoreQuery": {
"OriginDestinations": {
"OriginDestination": [
{
"Departure": {
"AirportCode": "LAX",
"Date": "2021-10-20"
},
"Arrival": {
"AirportCode": "LHR"
}
}
]
}
}
Option 2 - Return
"CoreQuery": {
"OriginDestinations": {
"OriginDestination": [
{
"Departure": {
"AirportCode": "LAX",
"Date": "2021-10-20"
},
"Arrival": {
"AirportCode": "LHR"
}
"Departure": {
"AirportCode": "LHR",
"Date": "2021-10-28"
},
"Arrival": {
"AirportCode": "LAX"
}
}
]
}
}
Option 3 - Multicity
Note: The user can include a maximum of five cities while booking a multicity ticket.
"CoreQuery": {
"OriginDestinations": {
"OriginDestination": [
{
"Departure": {
"AirportCode": "LAX",
"Date": "2021-10-20"
},
"Arrival": {
"AirportCode": "LHR"
}
"Departure": {
"AirportCode": "LAX",
"Date": "2021-10-20"
},
"Arrival": {
"AirportCode": "LHR"
}
"Departure": {
"AirportCode": "LAX",
"Date": "2021-10-20"
},
"Arrival": {
"AirportCode": "LHR"
}
}
]
}
}
Conditions for Applying Passenger Details
There are a few criteria that qualify the booking for a passenger. You must provide more information about the passengers such as their names and dates of birth, when you create the booking. The booking must have:
- At least one adult passenger on the list.
- Infant object count must be less than or equal to the adult count.
- More than nine passengers are not permitted on a single booking.
What will you get in return?
Based on the preferences applied during the flight search, multiple offers will be provided in the return. Each offer is unique in terms of itinerary and pricing. For each request made, you will receive a/an:
- Shopping response ID for the request made
- Offer ID for each offer for the request made
- Passenger ID for each passenger
The following payload describes the return data.
"ShoppingResponseId": "1626189240200388752",
"Query": {
"Offer": [
{
"OfferID": "78064811626189245156140959"
}
]
},
"DataLists": {
"PassengerList": {
"Passenger": [
{
"PassengerID": "T1",
"PTC": "ADT"
}
]
}
}
Step 2. Availing Offers
There will be specific price offers associated with the corresponding flight search results. These offers can be applied on the selected air-shopping itinerary to avail some additional discounts or services. The following services will fetch the offer details.
The services mentioned below are the optional services available and are not mandatory.
- Air fare rules: To retrieve the fare rules for the selected offer.
- Air seat map: To retrieve the seat map for selecting seats.
- Air service list: To check the availability of services like extra baggage or meals associated with an offer.
- Air get branded fare offers: To get branded fare offers with additional charges.
Note: This service is only applicable to one-way booking.
Visit AirOfferPrice to know more about Offer Price and the relevant parameters.
What will you get in return?
As a result of this request, you will get:
- Offer response ID
- Fare details
- Penalty details
- Flight details
- Payment modes available
You will need these details while creating your order.
curl --location --request POST 'http://newapi.tltid.com/AirOfferPrice' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token> \
--data-raw '{
"OfferPriceRQ": {
"ShoppingResponseId": "1628076217550132868",
"Query": {
"Offer": [
{
"OfferID": "78064811628076221781723810"
}
]
},
"DataLists": {
"PassengerList": {
"Passenger": [
{
"PassengerID": "T1",
"PTC": "ADT"
}
]
}
}
}
}'
Parameters: While passing this request, the payload must contain ShoppingResponseID
, OfferID
, and Passenger
.
Step 3. Adding Payment Details
You need to provide your Booking request ID and Form ID. You must also give your payment information based on your payment method. Further the user must provide their payment details. All these details are collected using storeCard
. Visit storeCard to know more about adding payment details and the relevant parameters.
Note: Booking request ID and Form ID are randomly generated alphanumeric values.
At the time of finalizing the air-shopping, the user must provide the payment details. The user will have the option to do the air-shopping with the payment and without the payment.
curl --location --request POST 'https://newapi.tltid.com/StoreCardDetail' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token>' \
--data-raw '{
"booking_req_id": "222427D", #random alphanumeric value
"form_id": "23245DD536", #random alphanumeric value
"card_number": "NDExMTExMTExMTExMTExMQ==", #(base64 encoded)
"cvv_code": "MjM0", #(base64 encoded)
"expire_month": "MTI=", #(base64 encoded)
"expire_year": "MjAyNQ==", #(base64 encoded)
"card_type": "MA", #(MA-master card,AX-american express,VI-visa card,DC-daniel club)
"card_holder_name": "Karthick Test Card",
"card_code": "CC", #(CC - credit card,DC- debit card)
"payment_method": "pay_by_card"
}
'
While passing the storeCard
request, the raw data must have all the payment related details.
All these details are stored in a separate database and a token is generated. This token number gets associated with the BookingRequestID
and the CardNumber
for future references.
Step 4. Placing the Order
The booking process has reached the last step. With the AirOrderCreate
endpoint, the order is processed and OrderID
and GdsBookingReference
is generated. You can use the OrderID
or the GdsBookingReference
number for future references.
Note: The values for the parameters like CardNumber, SeriesCode, CardHolderName, ExpirationMonth, and ExpirationYear are passed by using the token that is obtained by passing the payment details in Storecard endpoint.
The convention to pass these values followed is as mentioned in the below example:
"CardNumber": "card_number_<token_obtained>"
"SeriesCode": "cvv_<token_obtained>"
"CardHolderName": "card_holder_name_<token_obtained>"
"ExpirationYear": "Expiration_Year_<token_obtained>"
"ExpirationMonth": "Expiration_Month_<token_obtained>"
Visit AirOrderCreate to know more about adding payment details and the relevant parameters.
curl --location --request POST 'http://newapi.tltid.com/AirOrderCreate' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token>' \
--data-raw '{
"OrderCreateRQ": {
"ShoppingResponseId": "1628076217550132868",
"OfferResponseId": "1628076387571829827",
"Query": {
"Order": {
"Offer": [
{
"OfferID": "78064811628076221781723810"
}
]
}
},
"BookingType": "BOOK",
"Payments": {
"Payment": [
{
"Type": "CARD",
"PassengerID": "ADT1",
"Amount": 604.93,
"Method": {
"PaymentCard": {
"CardType": "CC",
"CardCode": "VI",
"CardNumber": "card_number_a2ea604e51fd6c546a49f52c4211912288aba23a1067e057cd9237d7",
"SeriesCode": "cvv_a2ea604e51fd6c546a49f52c4211912288aba23a1067e057cd9237d7",
"CardHolderName": "card_holder_name_a2ea604e51fd6c546a49f52c4211912288aba23a1067e057cd9237d7",
"EffectiveExpireDate": {
"Effective": "",
"Expiration": "exp_year_a2ea604e51fd6c546a49f52c4211912288aba23a1067e057cd9237d7-exp_month_a2ea604e51fd6c546a49f52c4211912288aba23a1067e057cd9237d7"
}
}
},
"Payer": {
"ContactInfoRefs": "CTC1"
}
}
]
},
"DataLists": {
"PassengerList": {
"Passenger": [
{
"PassengerID": "ADT1",
"PTC": "ADT",
"BirthDate": "2000-07-21",
"NameTitle": "Mr",
"FirstName": "downey",
"MiddleName": "",
"LastName": "Robert",
"Gender": "Male",
"ContactInfoRef": "CTC1"
}
]
},
"ContactList": {
"ContactInformation": [
{
"ContactID": "CTC1",
"AgencyName": "kathir",
"EmailAddress": "kathir@gmail.com",
"Phone": {
"ContryCode": "+91",
"AreaCode": "",
"PhoneNumber": "9854785465"
},
"Mobile": {
"ContryCode": "+91",
"MobileNumber": "9854785465"
},
"Address": {
"Street": [
"testing address1",
null
],
"CityName": "chennai",
"StateProv": "AX",
"PostalCode": "123465",
"CountryCode": "AX"
},
"PassengerContact": {
"EmailAddress": "mosris@gmail.com",
"Phone": {
"ContryCode": "",
"AreaCode": "",
"PhoneNumber": "9856325698"
}
}
}
]
}
}
}
}'
While passing the create order request, you must pass the payload with complete details such as ShoppingResponseId
, OfferResponseId
, BookingType
, Payment
, Passenger
, and the ContactInformation
of the passenger.
The following code snippet explains the response data that you can refer for fetching the order details.
Order Response Example
"Order": [
{
"OrderID": "LZVRC19L",
"GdsBookingReference": "MRYMXE",
"OrderStatus": "SUCCESS",
"NeedToTicket": "N",
"OfferID": "78064811628076221781723810",
"Owner": "B6",
"OwnerName": "JetBlue Airways",
"IsBrandedFare": "N",
"BrandedFareOptions": [],
"CabinOptions": [],
"IsAdditionalCabinType": "N",
"Eticket": "true",
"TimeLimits": {
"OfferExpirationDateTime": "2021-08-04T13:30:10",
"PaymentExpirationDateTime": "2021-08-06 03:00:00"
},
"BookingCurrencyCode": "CAD",
"EquivCurrencyCode": "CAD",
"HstPercentage": "",
"RewardSettings": {
"RewardAvailable": "N",
"PointTypes": [],
"PointValues": {}
},
"BookingFeeInfo": {
"FeeType": "",
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"TotalPrice": {
"BookingCurrencyPrice": 604.93,
"EquivCurrencyPrice": 604.93
},
"BasePrice": {
"BookingCurrencyPrice": 355,
"EquivCurrencyPrice": 355
},
"TaxPrice": {
"BookingCurrencyPrice": 249.93,
"EquivCurrencyPrice": 249.93
},
"Commission": {
"AgencyCommission": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"AgencyYqCommission": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
}
},
"PortalCharges": {
"Markup": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"Surcharge": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"Discount": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
}
},
"AgentMarkupInfo": {
"OnflyMarkup": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"OnflyDiscount": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"OnflyHst": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"PromoDiscount": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0,
"PromoCode": ""
}
},
"Penalty": {
"ChangeFee": {
"Before": {
"BookingCurrencyPrice": 250,
"EquivCurrencyPrice": 250
},
"After": {
"BookingCurrencyPrice": 250,
"EquivCurrencyPrice": 250
}
},
"CancelationFee": {
"Before": {
"BookingCurrencyPrice": 375,
"EquivCurrencyPrice": 375
},
"After": {
"BookingCurrencyPrice": "NA",
"EquivCurrencyPrice": "NA"
}
}
},
"PaxSeatInfo": [],
"OfferItem": [
{
"OfferItemID": "OFFERITEMID1",
"Refundable": "false",
"PassengerType": "ADT",
"PassengerQuantity": 1,
"TotalPriceDetail": {
"TotalAmount": {
"BookingCurrencyPrice": 604.93,
"EquivCurrencyPrice": 604.93
}
},
"Service": [
{
"ServiceID": "SV1",
"PassengerRefs": "ADT1",
"FlightRefs": "Flight1"
}
],
"FareDetail": {
"PassengerRefs": "ADT1",
"Price": {
"TotalAmount": {
"BookingCurrencyPrice": 604.93,
"EquivCurrencyPrice": 604.93
},
"BaseAmount": {
"BookingCurrencyPrice": 355,
"EquivCurrencyPrice": 355
},
"TaxAmount": {
"BookingCurrencyPrice": 249.93,
"EquivCurrencyPrice": 249.93
},
"Commission": {
"AgencyCommission": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"AgencyYqCommission": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
}
},
"BookingFee": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"PortalCharges": {
"Markup": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"Surcharge": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
},
"Discount": {
"BookingCurrencyPrice": 0,
"EquivCurrencyPrice": 0
}
},
"Taxes": [
{
"TaxCode": "YR",
"BookingCurrencyPrice": 213.48,
"EquivCurrencyPrice": 213.48
},
{
"TaxCode": "US",
"BookingCurrencyPrice": 23.84,
"EquivCurrencyPrice": 23.84
},
{
"TaxCode": "AY",
"BookingCurrencyPrice": 6.99,
"EquivCurrencyPrice": 6.99
},
{
"TaxCode": "XF",
"BookingCurrencyPrice": 5.62,
"EquivCurrencyPrice": 5.62
}
]
}
},
"FareComponent": [
{
"PriceClassRef": "PCR_1",
"SegmentRefs": "Segment1 Segment2",
"FareBasis": {
"FareBasisCode": {
"Refs": "FG_1 FG_2",
"Code": "SI2QBEL1 ML8LBXL1"
},
"RBD": "L L",
"CabinType": "Y Y",
"SeatLeft": "9 9"
}
}
]
}
],
"BaggageAllowance": [
{
"SegmentRefs": "Segment1 Segment2",
"PassengerRefs": "ADT1",
"BaggageAllowanceRef": "Bag1"
}
],
"SplitPaymentInfo": [
{
"AirItineraryId": "78064811628076221781723810",
"MultipleFop": "Y",
"MaxCardsPerPax": 2,
"MaxCardsPerPaxInMFOP": 1
}
],
"BookingToEquivExRate": 1,
"FopRef": "FOP_264_264_648_0_ALL_PUB"
}
],
The OrderID
and GdsBookingReference
are mandatory for fetching the order details that may be required for updating the booking details, adding preferences, and cancellation of tickets.
Congratulations! You have completed your air-shopping.