Switch to dark mode

Taxi Rides

A taxi to the station before the train, or home from it after, can be sold with the tickets. Taxi rides are currently available in Sweden only. A ride is added to the booking as an extra item, priced in the booking's currency and counted into its total, paid with the order and refunded whole.

The flow is three calls on a booking you have already created: find the segment ends a taxi serves, quote an address, and add the ride you want.

Where a taxi can be booked

taxiAvailability lists every end of the booking's segments where a taxi can be booked: TO_ORIGIN for a ride to the station before boarding, FROM_DESTINATION for a ride home after alighting. The list is empty when no segment ends at a station the taxi serves, so a booking with no taxi on offer is not an error.

Example: Find where a taxi can be booked

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": "Stockholm Central" },
          "destination": { "name": "Göteborg Central" }
        }
      },
      {
        "id": "taxi_from_04j29685a4m7g4g3s732k7t137",
        "direction": "FROM_DESTINATION",
        "segment": {
          "origin": { "name": "Stockholm Central" },
          "destination": { "name": "Göteborg Central" }
        }
      }
    ]
  }
}

Quoting a ride

taxiRideOffers prices a ride between one availability and an address: one offer per product the operator sells there, in display order, leaving out products the booking's passengers don't fit in. Give the street and house number, and either coordinates or a city to tell streets of the same name apart.

pickupAt is optional on the products that take a pickup time; leave it out for the operator's default, the latest pickup before a departure or the earliest after an arrival. It is a local time without a zone, YYYY-MM-DDThh:mm. Read the time back from each offer's pickupAt, since products with pickupTimeFixed ignore it.

Example: Quote a ride from the destination

query GetTaxiRideOffers {
  taxiRideOffers(
    availabilityId: "taxi_from_04j29685a4m7g4g3s732k7t137"
    address: { street: "Drottninggatan", number: "10", city: "Stockholm" }
  ) {
    id
    product {
      name
      maxPassengers
      shared
      childSeat
      pickupTimeFixed
    }
    address {
      street
      number
      locality
    }
    pickupAt
    arriveAt
    price {
      amount
      currency
    }
  }
}
{
  "data": {
    "taxiRideOffers": [
      {
        "id": "taxi_offer_01k9b3x8r5e7y2m4q6t8w0a1c3",
        "product": {
          "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. The address the operator resolved comes back on each offer, so show it to the traveler before they pick.

Adding the ride

addTaxiRide puts an offer on the booking for the booking passengers who ride, named by their Passenger.id. The ride is validated with the operator again and priced afresh, so read the price back from the booking's taxiRides. A child-seat product needs childAge, 0 to 12; the child need not be a passenger on the booking. Each passenger can have one ride per segment end, and passengers on different cost centers may share one.

Example: Add the ride 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 ride off again. Then create and finalize the order as usual: the ride is booked with the order, and pickupInstructions tells the traveler where the taxi waits at the station.

The codes these calls answer are under Taxi ride errors.

Next steps

Booking Tickets
The booking the ride is added to.
Refunds
A ride is refunded whole, as a generic item of the order.
Error Codes
What can go wrong when quoting or adding a ride.