Get Ticket Link
get_ticket_linkObtain a direct purchase link for SBB train tickets. The link opens in the SBB app with Halbtax or GA automatically selected. For family tickets, traveler names are needed with SwissTrip.
Instructions
Get a direct purchase link to buy a train ticket on SBB.ch. Only call this when the user wants to buy a specific ticket. On mobile with SBB app installed, opens directly in the app with Halbtax/GA applied automatically. Pass traveler_names for family tickets when connected to SwissTrip.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trip_id | Yes | Trip ID to purchase | |
| from_name | Yes | Origin station name (e.g. "Zürich HB") | |
| from_id | Yes | Origin station ID (e.g. "8503000") | |
| to_name | Yes | Destination station name (e.g. "Bern") | |
| to_id | Yes | Destination station ID (e.g. "8507000") | |
| date | Yes | Travel date YYYY-MM-DD | |
| time | Yes | Departure time HH:MM | |
| traveler_type | No | Traveler type (used when no traveler_names given) | ADULT |
| reduction_card | No | Swiss reduction card (used when no traveler_names given) | HALF_FARE |
| traveler_names | No | SwissTrip traveler names for family tickets. Requires SWISSTRIP_TOKEN. |