Exchange

This guide will help you understand the NDC API workflow to re-shop the existing booking after you have got the ticket, re-price the preferred offer, and change or upgrade the existing booking. You must remember that there is a possibility of a change in the fare when you go exchanging your tickets. The following endpoints are used in the exchange workflow:

  1. AirOrderReshop- Exchange Shop
  2. AirOrderReshop- Exchange Price
  3. CardManagement/Storecard
  4. AirOrderChange

Visit the Ticket user guide to learn how to create a booking and to get a ticket.

What do you need to start?

To get started with exchange, you will require a various payload data to process other requests. We recommend that you collect relevant information from the responses for completing the exchange workflow.

Step 1. Air Order Reshop- Exchange Shop

You can use this endpoint to re-shop the existing booking. The Order ID, GDS Booking Reference (where GDS stands for Global Distribution System), Passenger details, and other existing booking details are all required to complete this process. You can get these required details from the response to your current order.

To see all the parameters in this request and its response, refer to AirOrderReshop

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 re-shopping an existing booking.

curl --location --request POST 'http://newapi.tltid.com/OrderReshop' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token>' \
--data-raw '{
    "OrderReshopRQ": {
        "Query": {
            "OrderID": "84PXKUGX",
            "GdsBookingReference": [
                "EPDNDY"
            ],
            "Reshop": {
                "OrderServicing": {
                    "Add": {
                        "FlightQuery": {
                            "OriginDestinations": {
                                "OriginDestination": [
                                    {
                                        "PreviousDeparture": {
                                            "AirportCode": "MAA",
                                            "Date": "2021-10-25"
                                        },
                                        "PreviousArrival": {
                                            "AirportCode": "DXB"
                                        },
                                        "PreviousCabinType": "Y",
                                        "Departure": {
                                            "AirportCode": "MAA",
                                            "Date": "2021-10-29"
                                        },
                                        "Arrival": {
                                            "AirportCode": "XNB"
                                        },
                                        "CabinType": "Y"
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "DataLists": {
            "PassengerList": {
                "Passenger": [
                    {
                        "PassengerID": "T1",
                        "PTC": "ADT",
                        "NameTitle": "Mr",
                        "FirstName": "Crish",
                        "MiddleName": "",
                        "LastName": "Evans",
                        "DocumentNumber": "6073737613787"
                    }
                ]
            }
        },
        "Preference": {
            "CabinType": "Y"
        }
    }
}'

As a result of this request, you will get a list of possible offers and flights from which you can choose your new order.

Step 2. Air Order Reshop- Exchange Price

When you have already placed an order but want to change the price, you can run this endpoint. The Shopping Response ID, Offer ID, and Passenger details are all required to complete this process.

curl --location --request POST 'http://newapi.tltid.com/OrderReshop' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token>' \
--data-raw '{
    "OrderReshopRQ": {
        
        "ShoppingResponseId": "1626280803371223857",
        "Query": {
            "Reshop": {
                "OrderServicing": {
                    "Add": {
                        "Qualifier": {
                            "ExistingOrderQualifier": {
                                "OrderKeys": {
                                    "Offer": [
                                        {
                                            "OfferID": "78064811626280806841805394"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "DataLists": {
            "PassengerList": {
                "Passenger": [
                    {
                        "PassengerID": "T1",
                        "PTC": "ADT",
                        "NameTitle": "Mr",
                        "FirstName": "Crish",
                        "MiddleName": "",
                        "LastName": "Evans",
                        "DocumentNumber": "6073737613787"
                    }
                ]
            }
        }
    }
}'

As a result of this request, you will get a list of possible prices from which you can choose the one that suits your requirement.

To understand all the parameters, visit AirOrderReshop-ExchangePrice.

Once you’ve re-priced or re-shopped your order, you’ll need to provide payment information. For this, we provide Store Card endpoint in ClarityNDC API.

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 the payment details. All the 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 or without the payment.

curl --location --request POST 'https://uat-pdssapi.tltid.com/api/cardManagement/storeCard' \
--header 'Content-Type: application/json' \
--header 'portal-origin: localhost' \
--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 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 4. 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. To understand all the parameters of AirOrderChange endpoint, refer to AirOrderChange

curl --location --request POST 'http://newapi.tltid.com/AirOrderChange' \
--header 'Content-Type: application/json' \
--header 'Authorization: <$auth_token>' \
--data-raw '{
    "OrderChangeRQ": {
        "ShoppingResponseId": "1626280803371223857",
        "OfferResponseId": "1626280838101415762",
        "MetaData": {},
        "Query": {
            "OrderServicing": {
                "AcceptOffer": {
                    "Offer": [
                        {
                            "OfferID": "78064811626280806841805394"
                        }
                    ]
                }
            }
        },
        "BookingType": "BOOK",
        "Payments": {
            "Payment": [
                {
                    "Type": "CARD",
                    "PassengerID": "ALL",
                    "Amount": 19.95,
                    "Method": {
                        "PaymentCard": {
                            "CardType": "CC",
                            "CardCode": "VI",
                            "CardNumber": "card_number_a0ea604e51fd6c526a67f528403fbf6a8abb90701067d21ecebc15d748059f7e",
                            "SeriesCode": "cvv_a0ea604e51fd6c526a67f528403fbf6a8abb90701067d21ecebc15d748059f7e",
                            "CardHolderName": "card_holder_name_a0ea604e51fd6c526a67f528403fbf6a8abb90701067d21ecebc15d748059f7e",
                            "EffectiveExpireDate": {
                                "Effective": "",
                                "Expiration": "exp_year_a0ea604e51fd6c526a67f528403fbf6a8abb90701067d21ecebc15d748059f7e-exp_month_a0ea604e51fd6c526a67f528403fbf6a8abb90701067d21ecebc15d748059f7e"
                            }
                        }
                    },
                    "Payer": {
                        "ContactInfoRefs": "CTC1"
                    }
                }
            ]
        },
        "DataLists": {
            "PassengerList": {
                "Passenger": [
                    {
                        "PassengerID": "T1",
                        "PTC": "ADT",
                        "NameTitle": "Mr",
                        "FirstName": "Crish",
                        "MiddleName": "",
                        "LastName": "Evans",
                        "DocumentNumber": "6073737613787"
                    }
                ]
            },
            "ContactList": {
                "ContactInformation": [
                    {
                        "ContactID": "CTC1",
                        "AgencyName": "Flight travels",
                        "EmailAddress": "kalaiavis@gmail.com",
                        "Phone": {
                            "ContryCode": "+1684",
                            "AreaCode": "",
                            "PhoneNumber": null
                        },
                        "Mobile": {
                            "ContryCode": "",
                            "MobileNumber": "7708382004"
                        },
                        "Address": {
                            "Street": [
                                "guindy",
                                null
                            ],
                            "CityName": "chennai",
                            "StateProv": "TN",
                            "PostalCode": "6007001",
                            "CountryCode": "IN"
                        }
                    }
                ]
            }
        }
    }
}'

As a result of this request, you will get the changed order’s details. Below is a sample response to your order:

            {
                "OrderID": "84PXKUGX_A2UK4UJU",
                "GdsBookingReference": "EPDNDY",
                "NeedToTicket": "N",
                "OfferID": "78064811626280806841805394",
                "Owner": "EY",
                "OwnerName": "Etihad Airways",
                "IsBrandedFare": "Y",
                "BrandedFareOptions": [],
                "CabinOptions": [],
                "IsAdditionalCabinType": "N",
                "Eticket": "",
                "TimeLimits": {
                    "OfferExpirationDateTime": "2021-07-14T18:37:49"
                },

Congratulations! You have successfully completed the exchange workflow.