How to independently create links to search results for flight tickets and hotels from Trip.com.
For most affiliate programs in Travelpayouts, links are formed according to one scenario, a description of which can be found in the article How to create a link to any page of the advertiser’s website.
For trip.com, you can get links not only to some content pages of their site, but also create links to the results of air tickets and hotels search.
Links to air tickets
Link format: https://{site}.trip.com/flights/welcome/?to=list&flighttype=s&dcity=[departurecitycode]&acity=[arrivecitycode]&startdate=[departuredate]&quantity=[number of adult]&tp=i
Link parameters:
- site (required) — site language, versions of site languages can be found to the link: https://www.trip.com/
- flighttype (required) — flight option:
- s — one way flight
- r — round trip flight
- m — complex search
- dcity (required) — IATA of the city of departure
- acity (required) — IATA of the city of arrival
- startdate (optional) — departure date
- returndate (optional) — return date (you can omit it for flighttype=s)
- quantity (optional) — number of passengers
- tp — flight type;
- d — if the departure and arrival city is inside China
- i — if the departure and arrival city is outside of China
Example of link: https://uk.trip.com/flights/ShowFareFirst?to=list&dcity=sha&acity=bjs&flighttype=R&startdate=2022-12-31&quantity=1
Links to hotels
Link format: https://{site}.trip.com/hotels/w/list/?city=[cityid]&checkin=[checkindate]&checkout=[checkoutdate]
Link parameters:
- site — the language of the site, see the language options on the site https://www.trip.com/
- city — ID of the city from the database trip.com (the city codes can be found in the Cityid file list.xlsx)
- checkin — check-in date
- checkout — check-out date
Example of link: https://uk.trip.com/hotels/w/list/?city=2&checkin=2022-12-19&checkout=2022-12-21
More examples of links can be found in the Universal Link file 0421.xlsx.
Create an affiliate link
Use any service that makes url encode to get a link of the following form:
https%3A%2F%2Fuk.trip.com%2Fflights%2FShowFareFirst%3Fto%3Dlist%26dcity%3Dsha%26acity%3Dbjs%26flighttype%3DR%26startdate%3D2022-12-31%26quantity%3D1
Put the link received after the equal sign of the custom_url parameter in a link of the following form:
https://c121.travelpayouts.com/click?shmarker=YOUR_AFFILIATE_ID.YOUR_SUB_ID&promo_id=5218&source_type=customlink&type=click&custom_url=
Note the shmarker parameter, where you need to specify your affiliate marker and a Sub ID after a dot (Sub ID may be skipped).
Example link for 78606 marker and tripcom is Sub ID:
https://c121.travelpayouts.com/click?shmarker=78606.tripcom&promo_id=5218&source_type=customlink&type=click&custom_url=https%3A%2F%2Fuk.trip.com%2Fflights%2FShowFareFirst%3Fto%3Dlist%26dcity%3Dsha%26acity%3Dbjs%26flighttype%3DR%26startdate%3D2022-12-31%26quantity%3D1