Searching and booking trains
Look up stations, search trains, pick a fare, and create a train booking.
Trains follow the standard four-step flow: search → fares → build → book.
Search and fares stream results as Server-Sent Events (SSE); build and book
return JSON. All requests require the consumer HMAC and a traveler bearer
token — omitted from the snippets below for brevity.
1. Look up stations
Resolve free-text input to station identifiers.
GET /v1/trains/stations?query=milano
Response — an array of TrainStationOut:
[
{
"code": "830000219",
"displayName": "Milano Centrale",
"city": "Milan",
"country": "IT"
}
]2. Search
POST /v1/trains/search streams train solutions as SSE.
Request body (TrainSearchRequest) — one leg per itinerary entry:
{
"itinerary": [
{ "origin": "830000219", "destination": "830008409", "date": "2026-02-10" }
],
"passengers": { "adults": 1 },
"travelClass": "economy"
}travelClass is one of economy, premium_economy, business, or first
(carrier-specific classes are mapped onto these). Each TrainLeg also accepts
departureAfter / departureBefore as HH:MM local-time windows. Each streamed
solution's id (used as the searchSolutionId in the next step) and its
solutionKey are both required to list fares.
3. List fares
POST /v1/trains/fares streams the bookable fares for a chosen solution. Both
searchSolutionId and solutionKey are required for trains.
Request body (TrainFaresBody):
{
"searchSolutionId": "018f...",
"solutionKey": "abc...",
"travelClass": "economy"
}4. Build the fare
POST /v1/trains/fares/build locks a specific fare and returns it as JSON
(201).
Request body (TrainBuildFareBody):
{ "fareId": "018f...", "solutionKey": "abc...", "searchSolutionId": "018f..." }5. (Optional) Protection plans
GET /v1/trains/fares/{fare_id}/protection-plans
6. Book
POST /v1/trains/bookings creates the booking from the built fareId. Send a
unique Idempotency-Key header (required — see
Bookings and trips).
Request body (TrainCreateBookingRequest):
{
"fareId": "018f...",
"passengers": [
{
"firstName": "Ada",
"lastName": "Lovelace",
"type": "adult",
"isHolder": true
}
],
"isPersonal": false,
"tripId": null
}Manage the booking lifecycle with the shared endpoints in
Bookings and trips.
See the API Reference for the complete request and
response schemas.
Reporting issues
This page is maintained by the BizAway integration team. To request changes or
report an error, contact your BizAway integration contact. Edits made directly
in the ReadMe dashboard are overwritten on the next publish.