Taxi Rides
Taxi rides are only available within Sweden. They are run by our partner Flygtaxi through its Tågtaxi service.
Travelers can book a taxi with their train tickets, either to the station before the train (a drop-off) or from the station after it (a pickup). The price is in the booking's currency and is added to the booking's total.
You add a taxi to a booking you have already created, in three steps:
- Find the stations where a taxi can drop off or pick up.
- Get offers for the traveler's address.
- Add the offer the traveler picks to the booking.
Taxis to choose from
There are four kinds of taxi. Which ones are offered depends on the address and on how many passengers are on the booking.
| Taxi | product.id |
Description |
|---|---|---|
| Taxi | taxi |
A taxi of their own, for up to four passengers. |
| Large taxi | large_taxi |
A larger taxi of their own, for up to six passengers. |
| Shared taxi | shared_taxi |
A seat in a taxi shared with other travelers going the same way, at a set pickup time. |
| Taxi with child seat | child_seat_taxi |
A taxi of their own with a child seat, for up to four passengers including the child. |
Each offer has the same details in maxPassengers, shared, childSeat and pickupTimeFixed. Use those instead of hard-coding this table.
Finding the stations
taxiAvailability lists where on the booking a taxi can be booked. Each entry is one end of a segment:
TO_ORIGINis a drop-off at the station the segment departs from.FROM_DESTINATIONis a pickup at the station the segment arrives at.
The list is empty when no station on the booking has taxis. That isn't an error.
The list also includes stations where the traveler changes trains. Most travelers only want a taxi at the start and end of their journey, so the All Aboard checkout only offers a drop-off at the first station and a pickup at the last.
Example: Find the stations with taxis
query GetTaxiAvailability {
taxiAvailability(bookingId: "booking_04j29685a4m7g4g3s732k7t137") {
id
direction
segment {
origin {
name
}
destination {
name
}
}
}
}{
"data": {
"taxiAvailability": [
{
"id": "taxi_to_04j29685a4m7g4g3s732k7t137",
"direction": "TO_ORIGIN",
"segment": {
"origin": { "name": "Göteborg Central" },
"destination": { "name": "Stockholm Central" }
}
},
{
"id": "taxi_from_04j29685a4m7g4g3s732k7t137",
"direction": "FROM_DESTINATION",
"segment": {
"origin": { "name": "Göteborg Central" },
"destination": { "name": "Stockholm Central" }
}
}
]
}
}Getting offers
taxiRideOffers returns an offer for each taxi that drives to the address, in the order you should show them. Taxis too small for everyone on the booking are left out.
The address
The API doesn't search for addresses. It takes a street and house number, plus coordinates or a city to tell apart streets with the same name in different towns.
Let the traveler find their address with an address lookup in your own interface, such as OpenStreetMap's Nominatim, and send the street, number and coordinates of the address they choose. Coordinates are a GeoJSON point, longitude first: { type: "Point", coordinates: [18.0647, 59.3305] }.
Each offer comes back with the address as Flygtaxi understood it. Show it to the traveler before they pick.
The pickup time
pickupAt is optional. If you leave it out, Flygtaxi picks the time. A drop-off gets the latest pickup that still makes the train, and a pickup gets the earliest one after the train arrives. To ask for another time, give a local time without a time zone, YYYY-MM-DDThh:mm.
A shared taxi has a set pickup time and ignores pickupAt. Always read the time back from each offer.
Example: Get offers for a pickup in Stockholm
query GetTaxiRideOffers {
taxiRideOffers(
availabilityId: "taxi_from_04j29685a4m7g4g3s732k7t137"
address: { street: "Drottninggatan", number: "10", city: "Stockholm" }
) {
id
product {
id
name
maxPassengers
shared
childSeat
pickupTimeFixed
}
address {
street
number
locality
}
pickupAt
arriveAt
price {
amount
currency
}
}
}{
"data": {
"taxiRideOffers": [
{
"id": "taxi_offer_01k9b3x8r5e7y2m4q6t8w0a1c2",
"product": {
"id": "taxi",
"name": "Taxi",
"maxPassengers": 4,
"shared": false,
"childSeat": false,
"pickupTimeFixed": false
},
"address": {
"street": "Drottninggatan",
"number": "10",
"locality": "Norrmalm (Stockholm)"
},
"pickupAt": "2026-11-01T18:20",
"arriveAt": "2026-11-01T18:35",
"price": { "amount": 54900, "currency": "SEK" }
},
{
"id": "taxi_offer_01k9b3x8r5e7y2m4q6t8w0a1c3",
"product": {
"id": "shared_taxi",
"name": "Shared taxi",
"maxPassengers": 4,
"shared": true,
"childSeat": false,
"pickupTimeFixed": true
},
"address": {
"street": "Drottninggatan",
"number": "10",
"locality": "Norrmalm (Stockholm)"
},
"pickupAt": "2026-11-01T18:25",
"arriveAt": "2026-11-01T18:50",
"price": { "amount": 29500, "currency": "SEK" }
}
]
}
}Offers are valid for as long as the booking is.
Adding the taxi
addTaxiRide adds an offer to the booking. Pass the Passenger.id of each passenger who rides in it. Not everyone on the booking has to ride, and passengers going to different addresses can each have their own taxi from the same station. Passengers on different cost centers can share a taxi.
A passenger can only be in one taxi per drop-off or pickup. To switch taxis, remove the ride and add the new offer.
A taxi with child seat needs childAge, from 0 to 12. The child doesn't have to be a passenger on the booking.
Flygtaxi checks the offer again when it's added, and the price can change. Read the price back from the booking's taxiRides.
Example: Add a shared taxi for one passenger
mutation AddTaxiRide {
addTaxiRide(
bookingId: "booking_04j29685a4m7g4g3s732k7t137"
taxiOfferId: "taxi_offer_01k9b3x8r5e7y2m4q6t8w0a1c3"
passengerIds: ["pax_01k9b3x8r5e7y2m4q6t8w0a1c4"]
) {
taxiRides {
id
direction
pickupAt
pickupInstructions
passengers {
id
}
price {
amount
currency
}
}
totalPrice {
amount
currency
}
}
}{
"data": {
"addTaxiRide": {
"taxiRides": [
{
"id": "taxi_01k9b3x8r5e7y2m4q6t8w0a1c5",
"direction": "FROM_DESTINATION",
"pickupAt": "2026-11-01T18:25",
"pickupInstructions": "The taxi waits at the taxi rank outside the main entrance.",
"passengers": [{ "id": "pax_01k9b3x8r5e7y2m4q6t8w0a1c4" }],
"price": { "amount": 29500, "currency": "SEK" }
}
],
"totalPrice": { "amount": 118500, "currency": "SEK" }
}
}
}removeTaxiRide takes a taxi off the booking again.
Booking the taxi
Create and finalize the order as usual. The taxi is booked with Flygtaxi at the same time as the tickets. Show the traveler the ride's pickupInstructions, which say where the taxi waits at the station.
For the codes a failed call can return, see Taxi ride errors.