Authenticate with the Trainline Partner API using your partner credentials to obtain a session token for the booking flow
Submit a journey search request with origin and destination station codes, outbound date/time, and passenger details; receive a set of journey options with fares
Select a journey and fare combination, then call the basket or offer selection endpoint to reserve the offer and initiate the booking session
Provide passenger details, contact information, and delivery method (e-ticket, print-at-home, or collection reference); call the payment endpoint with the card or payment token
On successful payment, retrieve the booking confirmation with booking reference and ticket delivery details; store the booking reference for post-sale management
Known gotchas
Station codes used by Trainline may differ from NRS or CRS codes used in other UK rail systems — use Trainline's station lookup to resolve codes rather than assuming cross-system compatibility
Rail fare types (Advance, Off-Peak, Anytime) have strict validity and refund rules; surface these to the user before payment as they are non-negotiable
Trainline's Partner API availability and endpoint design may change across API versions — pin to a specific version and test against Trainline's sandbox before going live
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