Migration Guide

This guide is intended for developers migrating from Chargetrip’s legacy Route service to the latest version of the Route service. If you have any additional questions, please contact our support team.

The new Route service delivers key improvements, including a streamlined and reorganized schema, per-country operator preferences, faster route computation, and greater maintainability. The legacy service will remain available until May 2026, after which all legacy operations will be removed from the schema.

Introduction

The new Route service consolidates the legacy five operations to four. While the operation names and schema have changed, the usage pattern for creating and retrieving routes continues to rely on the same type of GraphQL operations—query, mutation, and subscription.

The table below maps the legacy Route service operations to their corresponding operations in the new Route service:

Operation TypeLegacyNew
MutationnewRoute->createRoute
SubscriptionrouteUpdateByID->route
Queryroute->getRoute
QueryroutePath->getRoute
QueryRouteEmissions->getRouteEmissions

General schema changes

Below you can find an overview of general schema changes that apply to all operations.


Mutation changes

This section details all changes to the input schema between the legacy newRoute mutation and the new createRoute mutation. For complete schema definitions and usage, see mutate to create a new route.

Schema reorganization

The input field has been restructured in the new Route service. The legacy fields - routeRequest, ev, and telemetry — have been flattened and reorganized.

routeRequest

The routeRequest fields have been moved directly under the input and input.vehicle.charging.

LegacyNew
input.routeRequest.amenities->removed
input.routeRequest.amenity_preferences->removed
input.routeRequest.operatorRequired->removed
input.routeRequest.operatorIds->removed
input.routeRequest.operatorPrefer->removed
input.routeRequest.operators->input.operators
input.routeRequest.season->input.season
input.routeRequest.safeRiskMargin->input.vehicle.charging.risk_margin
input.routeRequest.chargeMode->input.vehicle.charging.mode
input.routeRequest.origin->input.origin
input.routeRequest.destination->input.destination
input.routeRequest.via->input.via
input.routeRequest.stationsAlongRouteRadius->input.alternative_station_radius
input.routeRequest.instructions->removed

EV

The ev fields are now structured under the vehicle object or redistributed across origin, via, and other typed properties.

LegacyNew
input.ev.id->input.vehicle.id
input.ev.battery->input.vehicle.battery
input.ev.plugs->input.vehicle.charging.connectors
input.ev.adapters->input.vehicle.charging.adapters
input.ev.minPower->input.vehicle.charging.minimum_power
input.ev.climate->input.vehicle.climate
input.ev.heatPump->input.vehicle.heat_pump
input.ev.cabin->input.vehicle.cabin
input.ev.cargo->input.origin.properties.vehicle.total_cargo_weight
input.via.properties.vehicle.total_cargo_weight
input.ev.occupants->input.origin.properties.vehicle.occupants
input.via.properties.vehicle.occupants
input.ev.consumption->input.vehicle.auxiliary_consumption
input.ev.bmsConsumption->removed

Telemetry

The telemetry fields are now structured under the vehicle object and moved into a strongly typed reference.

LegacyNew
input.telemetry->input.vehicle.heading
input.vehicle.motor_rpm
input.vehicle.odometer
input.vehicle.outside_temperature
input.vehicle.tire_pressure
input.vehicle.vehicle_speed

Extended operator preferences

Operator ranking levels have been simplified to low, medium, and high. Additionally, preferences can be scoped per country using the countries field. Note: To apply preferences globally (as in the legacy service), either omit the countries field or set it as an empty array.

Total occupant weight

Cargo and occupant information have been moved to properties.vehicle under origin and via location points. Moreover, the default occupants' weight can now be overridden by setting the total_occupant_weight. This field can only be used in combination with occupants.


Query / subscription changes

This section details all changes to the legacy route and routePath queries and the routeUpdateById subscription in comparison to the getRoute query and route subscription. For complete schema definitions and usage, see Subscribe to route updates and Query route details.

Schema reorganization

The new Route service response, for both the getRoute query and route subscription, has the following changes:

  • Consolidated top-level fields from 7 to 5.
  • Unified Input Representation under request_input.

Top level response

The table below maps the legacy route request / subscription fields to their corresponding query / subscription fields in the new Route service:

LegacyNew
route->recommended
alternatives->removed
ev->request_input
telemetry->request_input
routeRequest->request_input
app->meta.app_id
status->status

Route

The legacy route field has been renamed to recommended and reorganized to improve clarity and extensibility.

LegacyNew
route.id->id
recommended.id
route.type->removed
route.charges->recommended.charges
route.chargesAvailable->removed
route.chargesOccupied->removed
route.chargesUnknown->removed
route.chargesOutOfOrder->removed
route.distance->recommended.distance
route.duration->recommended.durations.total
route.consumption->recommended.consumption
route.chargeTime->recommended.durations.charging
route.rangeStartKwh
route.rangeStartPercentage
route.rangeStart
->recommended.range_at_origin
route.rangeEnd
route.rangeEndKwh
route.rangeEndPercentage
->recommended.range_at_destination
route.via->removed
route.polyline->recommended.polyline
route.pathPlot->recommended.path_plot
route.elevationUp->recommended.elevation.up
route.elevationDown->recommended.elevation.down
route.elevationMax->recommended.elevation.max
route.saving->recommended.savings
route.legs->recommended.legs
route.instructions->removed
route.stationsAlongRoute->recommended.alternative_stations
route.tags->recommended.tags
route.amenityRanking->removed
route.elevationPlot->recommended.path_plot.elevation

Legs

The legs field has been updated with several improvements. The origin.properties and destination.properties fields are now typed, replacing the previous free-form JSON format. Range data has been reorganized under range_at_origin and range_at_destination, and a new range_after_charge field has been added. Lastly, the steps field has been renamed to sections. See the “Steps” section below for more details.

LegacyNew
route.legs.id->removed
route.legs.distance->recommended.legs.distance
route.legs.duration->recommended.legs.durations
route.legs.consumption->recommended.legs.consumption
route.legs.rangeStart
route.legs.rangeStartKwh
route.legs.rangeStartPercentage
->recommended.legs.range_at_origin
route.legs.rangeEnd
route.legs.rangeEndKwh
route.legs.rangeEndPercentage
->recommended.legs.range_at_destination
route.legs.origin->recommended.legs.origin
route.legs.destination->recommended.legs.destination
route.legs.type->recommended.legs.type
route.legs.name->removed
route.legs.stationId->recommended.legs.station.station_id
route.legs.operatorId->removed
route.legs.operatorName->removed
route.legs.operatorRanking->removed
route.legs.chargeTime->recommended.legs.durations.charging
route.legs.evse->route.legs.station.evse_id
route.legs.connector->route.legs.station.connector_id
route.legs.plugsAvailable->removed
route.legs.plugsOccupied->removed
route.legs.plugsUnknown->removed
route.legs.plugsOutOfOrder->removed
route.legs.plugsCount->removed
route.legs.polyline->recommended.legs.polyline
route.legs.steps->recommended.legs.sections
route.legs.tags->recommended.legs.tags
route.legs.cargo->recommended.legs.destination.properties.total_cargo_weight
recommended.legs.origin.properties.total_cargo_weight
route.legs.occupants->recommended.legs.via.properties.occupants
recommended.legs.origin.properties.occupants

Steps

steps are now replaced with sections. Sections provide additional information — such as origin and destination — and make it easy to identify different road characteristics to display on a frontend.