Implement a Trainline partner API booking flow for UK and European rail with split-ticketing awareness
domain: thetrainline.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Authenticate to the Trainline Partner API using OAuth 2.0 bearer token
POST a journey search request specifying origin and destination NLC or UIC station codes, outward date, and passenger count
Parse the fares response and identify split-ticket options indicated by the isSplitTicket flag
Select a journey and add tickets to a basket via POST /baskets/{basketId}/journeys
Provide passenger details and payment information to confirm the booking
Retrieve the booking confirmation with QR code ticket data or print-at-home PDF URL
Known gotchas
Split tickets on Trainline are legally valid but require passengers to board the correct train; automated agents should warn users that split tickets may not always be honored by train staff at the barrier
UK rail fares use a complex fare-basis system; the same origin-destination pair can have dozens of fares with different booking classes and validity windows that must be filtered by journey time
Trainline partner access requires a separate commercial agreement; sandbox credentials provide UK-only content, while European rail content is gated behind additional carrier activation
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp