This guide will walk you through how to book a trip from scratch and make changes to an order.

Before getting started, you need to understand the glossaries offered in Glossary.

For security reasons, our APIs are under access control. Thus, you need to get Authentication and Authorization from Trip.com before accessing any of our APIs.

Overview

Based on the basic workflow of order processing, this guide will walk you through how to

  1. Shopping: request and retrieve available offers from Trip.com according to passengers' needs and preferences;

  2. Booking: create an order based on the selected offers from the offers returned;

  3. Payment: notify Trip.com of order payment so that Trip.com can confirm the order with the airline and go on to issue tickets.;

  4. Order: retrieve the details of a flight ticket order and an ancillary product order by the OrderID of the flight ticket order;

  5. Rebooking (optional): rebook or change a passenger’s itinerary because they can not travel as originally planned due to voluntary or involuntary reasons (e.g. date change);

  6. Refunding (optional): refund an issued order of passengers who can not travel as originally planned due to voluntary or involuntary reasons;

  7. Ticketing: retrieve the ticketing details for each flight in the order (e.g. the ticket number of a passenger’s flight);

  8. Settlement: you and Trip.com respectively pay for the delivered orders and services of a billing/settlement cycle through a certain settlement method (the billing/settlement cycle and the settlement methods are agreed between you and Trip.com in advance).

Please refer to the respective sections for details.

Shopping

It all begins with the passengers and an itinerary. So, let’s welcome John and his family and help them book a nice trip:

John, Alice, and their Son Ben want to fly from Shanghai to Beijing.

They’ll be leaving on 11th July and returning on 20th July (local time).

John and his family would like to fly business class.

What should we do?

  1. Search for flights

  2. Retrieve the search results

For more details about Shopping, you can find it here.

  1. The departure datetime and the arrival datetime of any flight are in local time.

  2. If there is no offer returned, you may need to change the search criteria, e.g. use fewer filters or clear all, change the origin or the destination. Then request again.

  3. Ancillary products may also be shown together with different offers. Ancillary products can be booked when you are booking flights or be booked separately after you have booked flights.

The offer requesting part is done, now you need to actually book a nice trip for John’s family by creating an order with Trip.com after selecting a suitable offer for John’s family.

Next please refer to Booking.

Booking

Assuming that you have shown the offers you have retrieved to John in your user interface, John now can select flights for his family.

What should we do?

  1. Select an offer based on the needs and preferences of John’s family

  2. Create a booking based on the selected offer

  3. Submit the order to Trip.com

You can retrieve the order and its details by its OrderID after submitting the order to Trip.com.

For more details about Booking, you can find it here.

Now you are only one step away from a successful booking with Trip.com!

Next please refer to Payment to notify Trip.com of order payment to finish booking.

Ancillary products can be booked when you are booking flights or be booked separately after you have booked flights.

Payment

Assuming that you have submitted John’s order to Trip.com, you now need to notify Trip.com of the payment of the order before you want Trip.com to confirm this order with the airline and go on to issue tickets.

This section will walk you through how to use the payment service to finish booking.

Here is where payment should happen:

  1. Search for flights

  2. Select an offer

  3. Create a booking based on the selected offer

  4. Submit the order to Trip.com

  5. Notify Trip.com of order payment

You need to pass the OrderID to Trip.com when using the API for order payment notification, which will let Trip.com know that you want Trip.com to confirm the order corresponding to this OrderID with the airline and go on to issue tickets. Meanwhile, Trip.com will change the status of the order to "paid" accordingly after order payment notification.

All set! The order status is now changed to "paid" and booking is now successful.

John and his family have been booked on their flights, and the ancillary products, if John has selected any, are also purchased successfully.

For more details about Payment, you can find it here.

For how and when you should pay Trip.com for the products and services you received from Trip.com, please refer to Settlement.

Please pay attention to the difference between the two concepts:

  1. notifying Trip.com of order payment

  2. you paying Trip.com for the products and services you received from Trip.com

The former means the passenger paying for the order they placed with you.

The latter means you paying for the order you submitted to Trip.com.

Order

Assuming that

  1. after the flight ticket order is paid, John wants to know the details of the flight ticket order that he has placed with you, such as the order status or any updates about his flights from the airline, as well as the AncillaryOrderID of the purchased ancillary products included in the flight ticket order, you now need to retrieve the order details from Trip.com and show them to John in your user interface;

  2. after the AncillaryOrderID is retrieved and John wants to know the details of the ancillary products he has purchased, such as the ancillary order status or the exact location of the lounge service he has purchased, you now need to retrieve the ancillary order details from Trip.com and show them to John in your user interface;

  3. What is more, John wants to cancel the purchased lounge service, because he does not need it anymore.

What do you need to start?

All you need is the OrderID of the flight ticket order that John is looking for.

What should we do?

  1. Retrieve a flight ticket order and its details by its OrderID.

  2. Retrieve an ancillary order and its details by its AncillaryOrderID that can be obtained from the 1st step.

  3. Cancel or refund an ancillary product

For more details about Order, you can find it here.

Rebooking

Assuming that John, Alice and their son Ben have booked flights from Shanghai to Beijing, leaving on 11th July and returning on 20th July.

Now they want to delay their return date by a week, coming back on 27th July instead.

What do you need to start?

  • All you need to get started with rebooking is the OrderID of the order you’d like to rebook.

  • In addition, you need to make sure that the passengers who want to rebook understand the applicable rebooking rules for their flights and the possibility of incurring rebooking-related fees.

We will walk you through how to rebook John’s family’s order that has been booked.

The rebooking process happens in 5 steps:

  1. Query the applicable rebooking rules for John’s family’s flights

  2. Request and select rebooking offers

  3. Confirm rebooking offers

  4. Create a rebooking application

  5. Notify Trip.com of the payment of the order

For more details about Rebooking, you can find it here.

Refunding

Assuming that after the order is paid and issued, John’s family wants to refund the order: they decide to cancel their travel plan simply because they do not want to travel.

What do you need to start?

  • All you need to get started with refunding is the OrderID of the order you’d like to refund or cancel.

  • In addition, you need to make sure that the passengers who want to refund understand the difference between the two concepts of voluntary and involuntary.

  • Refunding is not available for all orders. You need to check whether individual flight in an order can be refunded by querying its refundability.

  • Purchased ancillary products, if there is any, can be refunded or cancelled at the same time.

We will walk you through how to refund John’s family’s order that has been booked.

The refunding process happens in just 2 steps:

  1. Query the applicable refunding rules for John’s family’s flights

  2. Query refund details

For more details about Refunding, you can find it here.

Ticketing

Assuming that John wants to know the ticketing details of the flights that he has booked, such as the ticket number for each flight (often used for seat selection, refund or rebooking).

  • Only after you have notified Trip.com of the payment of the order by using the order payment notification API will Trip.com confirm this order with the airline and go on to issue tickets.

  • The ticketing details of the purchased ancillary products, if there is any, will be retrieved at the same time.

This section will help you learn how to use the ticketing service.

Here is what the ticketing service offers you at the moment:

  1. Get ticketing details

For more details about Ticketing, you can find it here.

Settlement

Assuming that all of John’s orders within the past month have been delivered and now you would like to pay Trip.com for the products and services you received from Trip.com that had helped you deliver John’s orders (you have agreed with Trip.com to a monthly billing cycle in advance).

Trip.com’s settlement staff will then add up the charges for all orders during the past month and generate a billing ID (SettlementBillID), which, together with the settlement notification, will then be sent to you by Trip.com through the notification service.

After receiving the settlement notification, you can use the settlement service to pay your bill which usually will include fees for the ticketing, rebooking, refunding of every order as well as the purchasing of ancillary products.

What do you need to start?

You need to choose a payment method and get your payment account ready.

Make sure that your payment account has sufficient balance.

Trip.com often bills its distributors for products and services over a billing/settlement cycle that is agreed upon between you and Trip.com in advance, e.g. every one week, every one month.

Here is what the settlement service offers you at the moment:

  1. Retrieve a single bill and its details

  2. Retrieve the settlement details of individual order included in the bill

  3. Submit payment information for settlement

For more details about Settlement, you can find it here.