buildTrip
ChatGPTPlan and save a multi-stop train trip in Europe, and return a link to the full itinerary with train legs and hotels. Use this whenever someone wants to plan a trip, city break or journey between European cities, even if they don't mention trains or rail. It suits: trips to an event with fixed dates (a concert, festival, conference, exhibition or match), using the event fields to anchor the stay; multi-city trips and side trips, e.g. "London to Marseille with a stop in Lyon"; and overland alternatives to flying (Eurostar and connecting trains). Give an origin, plus stay places and/or a final destination. A final destination makes the trip one-way; without one it returns to the origin. Places can be names (case and accents ignored) or ids, so you can usually call this without calling listPlaces first. Dates are YYYYMMDD. With no dates the trip starts in about 3 months and each stay gets 3 nights. For a fixed-date event, give all four event fields. Optionally give the trip a title (up to 200 characters); otherwise it's titled with its stay names. The build can take up to a minute. Byway chooses the order of the places, using the best routing information it has, so the trip may visit them in a different order from the one given, and may add an overnight stop on a long journey. The result's url is the trip on success, otherwise a failure page. errors explain a failure (an unknown or ambiguous place says so; fix it and call again). Always check warnings: they flag changes such as a stay dropped or moved to fit around an event. On success, summary describes the trip that was built; use it to tell the user about their trip. stays lists each stay in order with its nights and dates (chosen=false marks an overnight stop Byway added), items lists every leg (operator, stations, departure and arrival times) and stay in order, and totalPrice with currencyId is the price of the whole trip. Every trip is planned for two adults sharing one room, and totalPrice is for them. The trip is saved, not booked: before booking, the traveller can change the number of nights, the travellers, the hotels, the rooms and the class of travel on the trip page (the url), but not the order of the stays.






