> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fryte.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get optimization result

> Retrieve the optimization result for a completed job.

Call this endpoint once `GET /planner/jobs/{job_id}` returns status `succeeded` or `not_drivable`.

A `succeeded` result contains route `sections` with charging stop details (`poi_summary`) and candidate charging stations (`poi_list`). If the route includes toll roads, a `toll_summary` is included. When status is `not_drivable`, the `not_drivable_reason` field explains why the route is not feasible.



## OpenAPI

````yaml /openapi.json get /planner/optimizations/{optimization_id}/result
openapi: 3.1.0
info:
  title: FRYTE Planner API
  version: 2.0.0
servers:
  - url: https://api.fryte.eu
security: []
paths:
  /planner/optimizations/{optimization_id}/result:
    get:
      tags:
        - planner
      summary: Get optimization result
      description: >-
        Retrieve the optimization result for a completed job.


        Call this endpoint once `GET /planner/jobs/{job_id}` returns status
        `succeeded` or `not_drivable`.


        A `succeeded` result contains route `sections` with charging stop
        details (`poi_summary`) and candidate charging stations (`poi_list`). If
        the route includes toll roads, a `toll_summary` is included. When status
        is `not_drivable`, the `not_drivable_reason` field explains why the
        route is not feasible.
      operationId: >-
        get_optimization_result_planner_optimizations__optimization_id__result_get
      parameters:
        - name: optimization_id
          in: path
          required: true
          schema:
            type: integer
            description: Optimization identifier returned by POST /planner/v2.
            title: Optimization Id
          description: Optimization identifier returned by POST /planner/v2.
        - name: tenant_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Tenant ID
            title: Tenant Id
          description: Tenant ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OptimizationResultResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HybridAuthBearer: []
        - HTTPBearer: []
components:
  schemas:
    OptimizationResultResponse:
      properties:
        optimization_id:
          type: integer
          title: Optimization Id
          description: Optimization identifier.
        tour_id:
          type: integer
          title: Tour Id
          description: Tour identifier.
        status:
          type: string
          title: Status
          description: 'Job lifecycle status: succeeded or not_drivable.'
        battery_level_start:
          type: number
          title: Battery Level Start
          description: Starting battery level (0-1).
        battery_level_end:
          type: number
          title: Battery Level End
          description: Battery level at the end of the tour (0-1).
        qualification:
          type: string
          title: Qualification
          description: >-
            Route feasibility result: Driveable or not_drivable. See status for
            job lifecycle.
        sections:
          items:
            $ref: '#/components/schemas/ResultSection'
          type: array
          title: Sections
          description: >-
            Route sections with charging stop details. May contain more sections
            than the request if charging stops were inserted.
        poi_list:
          items:
            $ref: '#/components/schemas/ResultPOI'
          type: array
          title: Poi List
          description: Charging stations considered as candidates along the route.
        poi_filter:
          anyOf:
            - $ref: '#/components/schemas/api__features__poi__schemas__POIInfo'
            - type: 'null'
          description: Charging station filter criteria applied to this optimization.
        optimal_departure_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Optimal Departure Time
          description: >-
            Optimal departure time (ISO-8601) for reaching all time windows, if
            applicable.
        time_windows_reachable:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Windows Reachable
          description: >-
            Whether all time windows could be reached: 'True', 'False', or 'Not
            considered'.
        available_charging_stations:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResultAvailableStation'
              type: array
            - type: 'null'
          title: Available Charging Stations
          description: >-
            All charging stations found within the route corridor. Only included
            when include_available_charging_stations is true.
        not_drivable_reason:
          anyOf:
            - $ref: '#/components/schemas/NotDrivableReason'
            - type: 'null'
          description: Reason why the route is not drivable.
        toll_summary:
          anyOf:
            - items:
                $ref: '#/components/schemas/TollSummary'
              type: array
            - type: 'null'
          title: Toll Summary
          description: Toll costs aggregated per toll system.
      type: object
      required:
        - optimization_id
        - tour_id
        - status
        - battery_level_start
        - battery_level_end
        - qualification
        - sections
        - poi_list
      title: OptimizationResultResponse
      example:
        battery_level_end: 0.41
        battery_level_start: 0.8
        optimization_id: 7658
        poi_list: []
        qualification: Driveable
        sections:
          - length_m: 215246
            payload_kg: 19300
            poi_summary:
              address: See Destination
              charge_time_min: 0
              coordinate_lat: 49.4521
              coordinate_lon: 11.0767
              energy_kWh: 0
              name: Destination
              sec_duration_min: 201.95
              sec_length_km: 215.25
              service_time_min: 0
              start_soc: 0.41
              stop_soc: 0.41
            polyline: BlX8w2pJ4wh4B...
            service_time_min: 30
            start_pos:
              - 48.7758
              - 9.1829
              - 0.8
            stop_pos:
              - 49.4521
              - 11.0767
              - 0.41
        status: succeeded
        toll_summary:
          - currency: EUR
            tollSystem: TOLL COLLECT GMBH
            total: 81.41
        tour_id: 7615
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ResultSection:
      properties:
        section_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Section Id
          description: Section identifier, if provided in the request.
        polyline:
          anyOf:
            - type: string
            - type: 'null'
          title: Polyline
          description: >-
            Encoded route geometry in HERE Flexible Polyline format (see
            https://github.com/heremaps/flexible-polyline).
        start_pos:
          anyOf:
            - items:
                type: number
              type: array
            - type: 'null'
          title: Start Pos
          description: Start coordinates [lat, lon, state_of_charge].
        stop_pos:
          anyOf:
            - items:
                type: number
              type: array
            - type: 'null'
          title: Stop Pos
          description: End coordinates [lat, lon, state_of_charge].
        payload_kg:
          anyOf:
            - type: number
            - type: 'null'
          title: Payload Kg
          description: Payload in kg.
        length_m:
          anyOf:
            - type: number
            - type: 'null'
          title: Length M
          description: Section length in meters.
        opening_time:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Opening Time
          description: Time window at the section end.
        service_time_min:
          anyOf:
            - type: number
            - type: 'null'
          title: Service Time Min
          description: Service time at the section destination in minutes.
        power_available_kW:
          anyOf:
            - type: number
            - type: 'null'
          title: Power Available Kw
          description: Charging power at the section end in kW.
        turnByTurnActions:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Turnbyturnactions
          description: Turn-by-turn navigation instructions from the HERE Routing API.
        tolls:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tolls
          description: Toll data for this section from the HERE Routing API.
        poi_summary:
          anyOf:
            - $ref: '#/components/schemas/ResultPOISummary'
            - type: 'null'
          description: Charging stop details for this section.
      additionalProperties: true
      type: object
      title: ResultSection
      description: A single route section in the optimization result.
    ResultPOI:
      properties:
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: Station name.
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
          description: Street address.
        distance_from_start:
          anyOf:
            - type: number
            - type: 'null'
          title: Distance From Start
          description: Distance from route start in meters.
        position_lat:
          anyOf:
            - type: number
            - type: 'null'
          title: Position Lat
          description: Station latitude.
        position_lon:
          anyOf:
            - type: number
            - type: 'null'
          title: Position Lon
          description: Station longitude.
        power:
          anyOf:
            - type: number
            - type: 'null'
          title: Power
          description: Charging power in kW.
        detour_from_route:
          anyOf:
            - type: number
            - type: 'null'
          title: Detour From Route
          description: Detour distance from the route in meters.
        section:
          anyOf:
            - type: number
            - type: 'null'
          title: Section
          description: Section index this station belongs to.
        position_lat_route:
          anyOf:
            - type: number
            - type: 'null'
          title: Position Lat Route
          description: Nearest point on route — latitude.
        position_lon_route:
          anyOf:
            - type: number
            - type: 'null'
          title: Position Lon Route
          description: Nearest point on route — longitude.
        poi_id:
          anyOf:
            - type: number
            - type: 'null'
          title: Poi Id
          description: Station identifier.
        mapping:
          anyOf:
            - type: number
            - type: 'null'
          title: Mapping
          description: Station grouping identifier.
        represents:
          anyOf:
            - type: number
            - type: 'null'
          title: Represents
          description: Whether this station represents its group.
        poi_crash:
          anyOf:
            - type: number
            - type: 'null'
          title: Poi Crash
          description: Position conflict flag.
        opening_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Opening Time
          description: Station opening time (ISO-8601).
        closing_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Closing Time
          description: Station closing time (ISO-8601).
        poi_arrival_time:
          anyOf:
            - type: string
            - type: 'null'
          title: Poi Arrival Time
          description: Estimated arrival time at this station (ISO-8601).
        bookable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Bookable
          description: Whether the station supports booking.
        location_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Id
          description: External location identifier (OCPI).
      additionalProperties: true
      type: object
      title: ResultPOI
      description: A candidate charging station from the optimizer's POI list.
    api__features__poi__schemas__POIInfo:
      properties:
        min_kW:
          anyOf:
            - type: number
            - type: 'null'
          title: Min Kw
          description: Minimum required power (in kW) for a charging station.
        max_kW:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Kw
          description: Maximum acceptable power (in kW) for a charging station.
        cpo:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Cpo
          description: A list of Charge Point Operators (CPO) to filter by.
        truck_approved:
          anyOf:
            - $ref: '#/components/schemas/api__features__poi__schemas__TruckApproved'
            - type: 'null'
          description: >-
            Truck-ready stations: T (tractor-only) or TT (truck and trailer). TT
            is a subset of T.
        connector_type:
          anyOf:
            - items:
                $ref: >-
                  #/components/schemas/api__features__poi__schemas__ConnectorType
              type: array
            - type: 'null'
          title: Connector Type
          description: List of connector types (e.g., CCS, MCS).
        connector_pos:
          anyOf:
            - $ref: '#/components/schemas/api__features__poi__schemas__ConnectorPos'
            - type: 'null'
          description: Position of the connector on the vehicle (e.g., LEFT, RIGHT).
        bookable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Bookable
          description: Only return bookable charging stations.
      type: object
      title: POIInfo
    ResultAvailableStation:
      properties:
        id:
          anyOf:
            - type: integer
            - type: string
            - type: 'null'
          title: Id
          description: Station identifier.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Station name.
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
          description: Street address.
        latitude:
          anyOf:
            - type: number
            - type: 'null'
          title: Latitude
          description: Latitude.
        longitude:
          anyOf:
            - type: number
            - type: 'null'
          title: Longitude
          description: Longitude.
        power_available_kW:
          anyOf:
            - type: number
            - type: 'null'
          title: Power Available Kw
          description: Charging power in kW.
        truck_approved:
          anyOf:
            - type: string
            - type: 'null'
          title: Truck Approved
          description: 'Truck approval: ''T'' (tractor) or ''TT'' (truck + trailer).'
        amenities:
          anyOf:
            - type: string
            - type: 'null'
          title: Amenities
          description: Available amenities.
        bookable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Bookable
          description: Whether the station supports booking.
        location_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Id
          description: External location identifier (OCPI).
        uses_company_vehicle_types:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Uses Company Vehicle Types
          description: Company vehicle type setting.
      additionalProperties: true
      type: object
      title: ResultAvailableStation
      description: A charging station found within the route corridor.
    NotDrivableReason:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
          description: 'Reason code: no_chargers_available or battery_depleted_mid_route.'
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Human-readable explanation.
      additionalProperties: true
      type: object
      title: NotDrivableReason
      description: Reason returned when the optimizer determines a route is not drivable.
    TollSummary:
      properties:
        tollSystem:
          anyOf:
            - type: string
            - type: 'null'
          title: Tollsystem
          description: Name of the toll system.
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
          description: Currency code (e.g. EUR).
        total:
          anyOf:
            - type: number
            - type: 'null'
          title: Total
          description: Total toll cost.
      type: object
      title: TollSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ResultPOISummary:
      properties:
        id:
          anyOf:
            - type: integer
            - type: string
            - type: 'null'
          title: Id
          description: Station identifier.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Station name or 'Destination' for the final stop.
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
          description: Street address.
        coordinate_lat:
          anyOf:
            - type: number
            - type: 'null'
          title: Coordinate Lat
          description: Latitude.
        coordinate_lon:
          anyOf:
            - type: number
            - type: 'null'
          title: Coordinate Lon
          description: Longitude.
        amenities:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Amenities
          description: Available amenities at the location.
        energy_kWh:
          anyOf:
            - type: number
            - type: 'null'
          title: Energy Kwh
          description: Energy recharged at this stop in kWh.
        power_available_kW:
          anyOf:
            - type: number
            - type: 'null'
          title: Power Available Kw
          description: Charging power at this station in kW.
        charge_time_min:
          anyOf:
            - type: number
            - type: 'null'
          title: Charge Time Min
          description: Charging duration in minutes.
        service_time_min:
          anyOf:
            - type: number
            - type: 'null'
          title: Service Time Min
          description: Total stop duration in minutes (charging + service + rest).
        arrival_time:
          anyOf:
            - type: number
            - type: string
            - type: 'null'
          title: Arrival Time
          description: Arrival time at this stop (ISO-8601).
        additional_stops:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Additional Stops
          description: Indicates whether additional stops are present.
        bookable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Bookable
          description: Whether the station supports booking.
        location_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Id
          description: External location identifier (OCPI).
        start_soc:
          anyOf:
            - type: number
            - type: 'null'
          title: Start Soc
          description: Battery state of charge on arrival (0-1).
        stop_soc:
          anyOf:
            - type: number
            - type: 'null'
          title: Stop Soc
          description: Battery state of charge on departure (0-1).
        alternatives:
          anyOf:
            - items:
                $ref: '#/components/schemas/ResultPOIAlternative'
              type: array
            - type: 'null'
          title: Alternatives
          description: Alternative charging stations nearby.
        sec_duration_min:
          anyOf:
            - type: number
            - type: 'null'
          title: Sec Duration Min
          description: Duration of this section in minutes.
        sec_energy_consumption_kWhkm:
          anyOf:
            - type: number
            - type: 'null'
          title: Sec Energy Consumption Kwhkm
          description: Energy consumption for this section in kWh/km.
        sec_length_km:
          anyOf:
            - type: number
            - type: 'null'
          title: Sec Length Km
          description: Section length in km.
      additionalProperties: true
      type: object
      title: ResultPOISummary
      description: Charging stop details attached to each response section.
    api__features__poi__schemas__TruckApproved:
      type: string
      enum:
        - T
        - TT
      title: TruckApproved
    api__features__poi__schemas__ConnectorType:
      type: string
      enum:
        - MCS
        - CCS
      title: ConnectorType
    api__features__poi__schemas__ConnectorPos:
      type: string
      enum:
        - LEFT
        - RIGHT
      title: ConnectorPos
    ResultPOIAlternative:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Station name.
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
          description: Street address.
        coordinate_lat:
          anyOf:
            - type: number
            - type: 'null'
          title: Coordinate Lat
          description: Latitude.
        coordinate_lon:
          anyOf:
            - type: number
            - type: 'null'
          title: Coordinate Lon
          description: Longitude.
      additionalProperties: true
      type: object
      title: ResultPOIAlternative
      description: Alternative charging station near a selected stop.
  securitySchemes:
    HybridAuthBearer:
      type: http
      scheme: bearer
    HTTPBearer:
      type: http
      scheme: bearer

````