This guide will help you understand the NDC API workflow for post-booking payment. For this workflow, you need to provide the origin and a destination. 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 without payment. You can add your card details and hold the booking for a specified time without making the payment. The payment details recorded in our database are retrieved at the moment of payment. The post-booking payment workflow uses the following endpoints to create a booking:
- AirShopping
- AirOfferPrice
- AirOrderCreate
- CardManagement/Storecard
- AirOrderChange
What do you need to start?
To get started with post-booking payment workflow, 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 booking 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 itinerary 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 you must provide values for the parameters like Origin and Destination
, passenger details
, and the Preferences
.
Note: Request payload will vary based on the travel options such as
one-way
,return
, andmulti-city
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.
- 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.
Request
curl --location --request POST 'http://newapi.tltid.com/AirOfferPrice' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token>' \
--data-raw '{
"OfferPriceRQ": {
"ShoppingResponseId": "1628078299923976004",
"Query": {
"Offer": [
{
"OfferID": "78064811628078302807755370"
}
]
},
"DataLists": {
"PassengerList": {
"Passenger": [
{
"PassengerID": "T1",
"PTC": "ADT"
}
]
}
}
}
}'
Parameters: While passing the request you must provide values for the parameters like ShoppingResponseID
, OfferID
, and the Passenger details
.
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.
Step 3. Placing the Order
With the AirOrderCreate
endpoint, you can place an order. At this stage your order is processed and OrderID
and GdsBookingReference
is generated. You can use the OrderID
and the GdsBookingReference
number for future references.
The following request example describes the Air Order Create Process.
curl --location --request POST 'http://newapi.tltid.com/AirOrderCreate' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token>' \
--data-raw '{
"OrderCreateRQ": {
"ShoppingResponseId": "1628078299923976004",
"OfferResponseId": "1628078324176393514",
"Query": {
"Order": {
"Offer": [
{
"OfferID": "78064811628078302807755370"
}
]
}
},
"BookingType": "HOLD",
"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": "CA"
},
"PassengerContact": {
"EmailAddress": "mosris@gmail.com",
"Phone": {
"ContryCode": "",
"AreaCode": "",
"PhoneNumber": "9856325698"
}
}
}
]
}
}
}
}'
Parameters: While passing the request you must provide values for the parameters like ShoppingResponseId
, OfferID
, and the Passenger
details.
What will you get in return?
Once the order is placed, the following response data is available for Order
and Passengers
based on which the booking is issued and relevant documents are created.
Below given are the examples of the code snippet from the same response:
Order Details
After booking the order, we receive the order details as shown below:
"ShoppingResponseId": "1628078299923976004",
"Success": {},
"Order": [
{
"OrderID": "L7SLU4XX",
"GdsBookingReference": "LWCMXC",
"OrderStatus": "SUCCESS",
"NeedToTicket": "N",
"OfferID": "78064811628078302807755370",
"Owner": "B6",
"OwnerName": "JetBlue Airways",
"IsBrandedFare": "N",
"BrandedFareOptions": [],
"CabinOptions": [],
"IsAdditionalCabinType": "N",
"Eticket": "true",
"TimeLimits": {
"OfferExpirationDateTime": "2021-08-04T13:59:53",
"PaymentExpirationDateTime": "2021-08-06 03:00:00"
},
Penalty Details
After booking the order, we receive the penalty details as shown below:
"Penalty": {
"ChangeFee": {
"Before": {
"BookingCurrencyPrice": 250,
"EquivCurrencyPrice": 250
},
"After": {
"BookingCurrencyPrice": 250,
"EquivCurrencyPrice": 250
}
},
"CancelationFee": {
"Before": {
"BookingCurrencyPrice": 375,
"EquivCurrencyPrice": 375
},
"After": {
"BookingCurrencyPrice": "NA",
"EquivCurrencyPrice": "NA"
}
}
},
Offer Details
After booking the order, we receive the offer details as shown below:
"OfferItem": [
{
"OfferItemID": "OFFERITEMID1",
"Refundable": "false",
"PassengerType": "ADT",
"PassengerQuantity": 1,
"TotalPriceDetail": {
"TotalAmount": {
"BookingCurrencyPrice": 616.93,
"EquivCurrencyPrice": 616.93
}
},
"Service": [
{
"ServiceID": "SV1",
"PassengerRefs": "ADT1",
"FlightRefs": "Flight1"
}
]
Fare Details
After booking the order, we receive the fare details as shown below:
"FareDetail": {
"PassengerRefs": "ADT1",
"Price": {
"TotalAmount": {
"BookingCurrencyPrice": 616.93,
"EquivCurrencyPrice": 616.93
},
"BaseAmount": {
"BookingCurrencyPrice": 367,
"EquivCurrencyPrice": 367
},
"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
}
]
}
},
Passenger Details
The following array describes the passenger data we receive after completing the order.
"Passenger": [
{
"PassengerID": "ADT1",
"PTC": "ADT",
"OnflyMarkup": "0.00",
"OnflyDiscount": "0.00",
"BirthDate": "2000-07-21",
"NameTitle": "Mr",
"FirstName": "downey",
"MiddleName": "",
"LastName": "Robert",
"Gender": "Male",
"TravelDocument": [
{
"DocumentNumber": "9658745",
"DocumentType": "P",
"ExpiryDate": "2024-01-01",
"IssuingCountry": "CA"
}
],
"ContactInfoRef": "CTC1"
}
]
Visit AirOrderCreate to know more about Offer Price and the relevant parameters.
Step 4. 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 the payment details. All these details are collected using storeCard.
Note: Booking request ID and Form ID are randomly generated alphanumeric values.
The following example describes the payment payload.
{
"booking_req_id": "2324SDD",
"form_id": "2324SDD434",
"card_number": "NDExMTExMTExMTExMTExMQ==",
"cvv_code": "MjM0",
"expire_month": "MTI=",
"expire_year": "MjAyNQ==",
"card_type": "MA",
"card_holder_name": "Karthick Test Card",
"card_code": "CC",
"payment_method": "pay_by_card"
}
The user needs to provide the payment details here.
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"
}
'
Parameters: While passing the storecard
request, the raw data must have all the payment related details.
All the details are stored in a separate database and a token is generated. This token number gets associated with the PassengerID
and the BookingID
for future references.
Step 5. Changing the Order
As explained earlier, you can hold on to paying for the fare for some time. When you are ready to proceed with the payment, you can start with this step.
To continue with paying the fare, you need two details and they are Order ID and GDS Booking Reference.
Note: The values for the parameters like
CardNumber
,SeriesCode
,CardHolderName
,ExpirationMonth
, andExpirationYear
are passed by using the token that is obtained by passing the payment details in store card endpoint.
The convention followed to pass these values is 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 AirOrderChange.
curl --location --request POST 'http://newapi.tltid.com/AirOrderChange' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token>' \
--data-raw '{
"OrderChangeRQ": {
"Query": {
"OrderID": "L7SLU4XX",
"GdsBookingReference": ["LWCMXC"]
},
"Payments": {
"Payment": [
{
"Type": "CARD",
"PassengerID": "ADT1",
"Amount": 616.93,
"Method": {
"PaymentCard": {
"CardType": "CC",
"CardCode": "AX",
"CardNumber": "card_number_a1d4524e51fd6c546a49f5294211912589958c761177fc56cfac2f9c",
"SeriesCode": "cvv_a1d4524e51fd6c546a49f5294211912589958c761177fc56cfac2f9c",
"CardHolderName": "card_holder_name_a1d4524e51fd6c546a49f5294211912589958c761177fc56cfac2f9c",
"EffectiveExpireDate": {
"Effective": "",
"Expiration": "exp_year_a1d4524e51fd6c546a49f5294211912589958c761177fc56cfac2f9c-exp_month_a1d4524e51fd6c546a49f5294211912589958c761177fc56cfac2f9c"
}
}
},
"Payer": {
"ContactInfoRefs": "CTC1"
}
}
]
},
"DataLists": {
"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": "CA"
},
"PassengerContact": {
"EmailAddress": "mosris@gmail.com",
"Phone": {
"ContryCode": "",
"AreaCode": "",
"PhoneNumber": "9856325698"
}
}
}
]
}
}
}
}'
Parameters: While passing this request, the payload must contain OrderID and GDSBookingReferenceNumber.
What will you get in return?
As a result of the successful request, you will get the status as Booked. Below is a sample response to your order.
{
OrderID": "V56N0138",
"GdsBookingReference": "ELKFSY",
"OrderStatus": "BOOKED",
"PaymentStatus": "PAID",
"TicketStatus": "NOT TICKETED",
"NeedToTicket": "N",
"OfferID": "83071211624517393927940491",
"Owner": "TS",
"OwnerName": "Air Transat",
"IsBrandedFare": "Y",
"BrandedFareOptions": [],
"CabinOptions": [],
"IsAdditionalCabinType": "N",
"Eticket": "",
"TimeLimits": {
"OfferExpirationDateTime": "2021-06-24T08:56:07"
}
Congratulations! your post-booking payment workflow is completed.