Submit route optimization
Submit a route for optimization. The request is processed asynchronously and returns HTTP 202 with identifiers to track the job.
Use the returned job_id to poll GET /planner/jobs/{job_id} for status. Once status is succeeded, retrieve the result via GET /planner/optimizations/{optimization_id}/result.
curl --request POST \
--url https://api.fryte.com/planner/v2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"battery_level_end": 0.2,
"battery_level_start": 0.8,
"poi_info": {
"connector_pos": "RIGHT",
"connector_type": [
"CCS"
],
"min_kW": 150,
"truck_approved": "T"
},
"section_list": [
{
"payload_kg": 19300,
"section_id": "section_0",
"service_time_min": 30,
"start_pos": [
48.7758,
9.1829
],
"stop_pos": [
49.4521,
11.0767
]
}
],
"start_time_tour": "08:00:00",
"vehicle_id": "010160700001"
}
'import requests
url = "https://api.fryte.com/planner/v2"
payload = {
"battery_level_end": 0.2,
"battery_level_start": 0.8,
"poi_info": {
"connector_pos": "RIGHT",
"connector_type": ["CCS"],
"min_kW": 150,
"truck_approved": "T"
},
"section_list": [
{
"payload_kg": 19300,
"section_id": "section_0",
"service_time_min": 30,
"start_pos": [48.7758, 9.1829],
"stop_pos": [49.4521, 11.0767]
}
],
"start_time_tour": "08:00:00",
"vehicle_id": "010160700001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
battery_level_end: 0.2,
battery_level_start: 0.8,
poi_info: {
connector_pos: 'RIGHT',
connector_type: ['CCS'],
min_kW: 150,
truck_approved: 'T'
},
section_list: [
{
payload_kg: 19300,
section_id: 'section_0',
service_time_min: 30,
start_pos: [48.7758, 9.1829],
stop_pos: [49.4521, 11.0767]
}
],
start_time_tour: '08:00:00',
vehicle_id: '010160700001'
})
};
fetch('https://api.fryte.com/planner/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
battery_level_end: 0.2,
battery_level_start: 0.8,
poi_info: {
connector_pos: 'RIGHT',
connector_type: ['CCS'],
min_kW: 150,
truck_approved: 'T'
},
section_list: [
{
payload_kg: 19300,
section_id: 'section_0',
service_time_min: 30,
start_pos: [48.7758, 9.1829],
stop_pos: [49.4521, 11.0767]
}
],
start_time_tour: '08:00:00',
vehicle_id: '010160700001'
})
};
fetch('https://api.fryte.com/planner/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.fryte.com/planner/v2");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"battery_level_end\": 0.2,\n \"battery_level_start\": 0.8,\n \"poi_info\": {\n \"connector_pos\": \"RIGHT\",\n \"connector_type\": [\n \"CCS\"\n ],\n \"min_kW\": 150,\n \"truck_approved\": \"T\"\n },\n \"section_list\": [\n {\n \"payload_kg\": 19300,\n \"section_id\": \"section_0\",\n \"service_time_min\": 30,\n \"start_pos\": [\n 48.7758,\n 9.1829\n ],\n \"stop_pos\": [\n 49.4521,\n 11.0767\n ]\n }\n ],\n \"start_time_tour\": \"08:00:00\",\n \"vehicle_id\": \"010160700001\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fryte.com/planner/v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'battery_level_end' => 0.2,
'battery_level_start' => 0.8,
'poi_info' => [
'connector_pos' => 'RIGHT',
'connector_type' => [
'CCS'
],
'min_kW' => 150,
'truck_approved' => 'T'
],
'section_list' => [
[
'payload_kg' => 19300,
'section_id' => 'section_0',
'service_time_min' => 30,
'start_pos' => [
48.7758,
9.1829
],
'stop_pos' => [
49.4521,
11.0767
]
]
],
'start_time_tour' => '08:00:00',
'vehicle_id' => '010160700001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.fryte.com/planner/v2")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"battery_level_end\": 0.2,\n \"battery_level_start\": 0.8,\n \"poi_info\": {\n \"connector_pos\": \"RIGHT\",\n \"connector_type\": [\n \"CCS\"\n ],\n \"min_kW\": 150,\n \"truck_approved\": \"T\"\n },\n \"section_list\": [\n {\n \"payload_kg\": 19300,\n \"section_id\": \"section_0\",\n \"service_time_min\": 30,\n \"start_pos\": [\n 48.7758,\n 9.1829\n ],\n \"stop_pos\": [\n 49.4521,\n 11.0767\n ]\n }\n ],\n \"start_time_tour\": \"08:00:00\",\n \"vehicle_id\": \"010160700001\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fryte.com/planner/v2"
payload := strings.NewReader("{\n \"battery_level_end\": 0.2,\n \"battery_level_start\": 0.8,\n \"poi_info\": {\n \"connector_pos\": \"RIGHT\",\n \"connector_type\": [\n \"CCS\"\n ],\n \"min_kW\": 150,\n \"truck_approved\": \"T\"\n },\n \"section_list\": [\n {\n \"payload_kg\": 19300,\n \"section_id\": \"section_0\",\n \"service_time_min\": 30,\n \"start_pos\": [\n 48.7758,\n 9.1829\n ],\n \"stop_pos\": [\n 49.4521,\n 11.0767\n ]\n }\n ],\n \"start_time_tour\": \"08:00:00\",\n \"vehicle_id\": \"010160700001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"battery_level_end\": 0.2,\n \"battery_level_start\": 0.8,\n \"poi_info\": {\n \"connector_pos\": \"RIGHT\",\n \"connector_type\": [\n \"CCS\"\n ],\n \"min_kW\": 150,\n \"truck_approved\": \"T\"\n },\n \"section_list\": [\n {\n \"payload_kg\": 19300,\n \"section_id\": \"section_0\",\n \"service_time_min\": 30,\n \"start_pos\": [\n 48.7758,\n 9.1829\n ],\n \"stop_pos\": [\n 49.4521,\n 11.0767\n ]\n }\n ],\n \"start_time_tour\": \"08:00:00\",\n \"vehicle_id\": \"010160700001\"\n}")
val request = Request.Builder()
.url("https://api.fryte.com/planner/v2")
.post(body)
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"job_id": "c3f1c944-a44c-4c07-ab52-7df7ba94024a",
"message": "202 - Job submitted.",
"optimization_id": 7658,
"tour_id": 7615
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Search corridor width in meters around the route for finding charging stations.
1000 <= x <= 20000Minimum charging session duration in minutes enforced by the optimizer's charge planning (pure charging time, excluding connecting/parking overhead). 0 disables the floor.
0 <= x <= 100Tenant ID
Body
Top-level request body for POST /planner and POST /planner/v2.
The unique identifier of the vehicle.
The starting battery level of the vehicle (from 0.1 to 1.0).
0.1 <= x <= 1A list of route sections to be processed.
1Show child attributes
Show child attributes
Filter criteria for charging stations along the route.
Show child attributes
Show child attributes
The desired battery level at the end of the tour (from 0.1 to 0.8).
0.1 <= x <= 0.8Service time at departure in minutes. Added to total tour duration.
Start time of the tour in HH:MM:SS or ISO-8601 format. A time-only value is interpreted as today's date in UTC.
Legacy POST /planner (v1) only: when true, the synchronous response includes all charging stations along the corridor. POST /planner/v2 results always include available_charging_stations.
Response
Successful Response
Response body for POST /planner/v2.
Human-readable status message.
Tour identifier.
Optimization identifier. Use this to retrieve the result via GET /planner/optimizations/{optimization_id}/result.
Job identifier (UUID). Use this to poll for status via GET /planner/jobs/{job_id}.
Warnings about the request, if any.
curl --request POST \
--url https://api.fryte.com/planner/v2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"battery_level_end": 0.2,
"battery_level_start": 0.8,
"poi_info": {
"connector_pos": "RIGHT",
"connector_type": [
"CCS"
],
"min_kW": 150,
"truck_approved": "T"
},
"section_list": [
{
"payload_kg": 19300,
"section_id": "section_0",
"service_time_min": 30,
"start_pos": [
48.7758,
9.1829
],
"stop_pos": [
49.4521,
11.0767
]
}
],
"start_time_tour": "08:00:00",
"vehicle_id": "010160700001"
}
'import requests
url = "https://api.fryte.com/planner/v2"
payload = {
"battery_level_end": 0.2,
"battery_level_start": 0.8,
"poi_info": {
"connector_pos": "RIGHT",
"connector_type": ["CCS"],
"min_kW": 150,
"truck_approved": "T"
},
"section_list": [
{
"payload_kg": 19300,
"section_id": "section_0",
"service_time_min": 30,
"start_pos": [48.7758, 9.1829],
"stop_pos": [49.4521, 11.0767]
}
],
"start_time_tour": "08:00:00",
"vehicle_id": "010160700001"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
battery_level_end: 0.2,
battery_level_start: 0.8,
poi_info: {
connector_pos: 'RIGHT',
connector_type: ['CCS'],
min_kW: 150,
truck_approved: 'T'
},
section_list: [
{
payload_kg: 19300,
section_id: 'section_0',
service_time_min: 30,
start_pos: [48.7758, 9.1829],
stop_pos: [49.4521, 11.0767]
}
],
start_time_tour: '08:00:00',
vehicle_id: '010160700001'
})
};
fetch('https://api.fryte.com/planner/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
battery_level_end: 0.2,
battery_level_start: 0.8,
poi_info: {
connector_pos: 'RIGHT',
connector_type: ['CCS'],
min_kW: 150,
truck_approved: 'T'
},
section_list: [
{
payload_kg: 19300,
section_id: 'section_0',
service_time_min: 30,
start_pos: [48.7758, 9.1829],
stop_pos: [49.4521, 11.0767]
}
],
start_time_tour: '08:00:00',
vehicle_id: '010160700001'
})
};
fetch('https://api.fryte.com/planner/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.fryte.com/planner/v2");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"battery_level_end\": 0.2,\n \"battery_level_start\": 0.8,\n \"poi_info\": {\n \"connector_pos\": \"RIGHT\",\n \"connector_type\": [\n \"CCS\"\n ],\n \"min_kW\": 150,\n \"truck_approved\": \"T\"\n },\n \"section_list\": [\n {\n \"payload_kg\": 19300,\n \"section_id\": \"section_0\",\n \"service_time_min\": 30,\n \"start_pos\": [\n 48.7758,\n 9.1829\n ],\n \"stop_pos\": [\n 49.4521,\n 11.0767\n ]\n }\n ],\n \"start_time_tour\": \"08:00:00\",\n \"vehicle_id\": \"010160700001\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fryte.com/planner/v2",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'battery_level_end' => 0.2,
'battery_level_start' => 0.8,
'poi_info' => [
'connector_pos' => 'RIGHT',
'connector_type' => [
'CCS'
],
'min_kW' => 150,
'truck_approved' => 'T'
],
'section_list' => [
[
'payload_kg' => 19300,
'section_id' => 'section_0',
'service_time_min' => 30,
'start_pos' => [
48.7758,
9.1829
],
'stop_pos' => [
49.4521,
11.0767
]
]
],
'start_time_tour' => '08:00:00',
'vehicle_id' => '010160700001'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.fryte.com/planner/v2")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"battery_level_end\": 0.2,\n \"battery_level_start\": 0.8,\n \"poi_info\": {\n \"connector_pos\": \"RIGHT\",\n \"connector_type\": [\n \"CCS\"\n ],\n \"min_kW\": 150,\n \"truck_approved\": \"T\"\n },\n \"section_list\": [\n {\n \"payload_kg\": 19300,\n \"section_id\": \"section_0\",\n \"service_time_min\": 30,\n \"start_pos\": [\n 48.7758,\n 9.1829\n ],\n \"stop_pos\": [\n 49.4521,\n 11.0767\n ]\n }\n ],\n \"start_time_tour\": \"08:00:00\",\n \"vehicle_id\": \"010160700001\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fryte.com/planner/v2"
payload := strings.NewReader("{\n \"battery_level_end\": 0.2,\n \"battery_level_start\": 0.8,\n \"poi_info\": {\n \"connector_pos\": \"RIGHT\",\n \"connector_type\": [\n \"CCS\"\n ],\n \"min_kW\": 150,\n \"truck_approved\": \"T\"\n },\n \"section_list\": [\n {\n \"payload_kg\": 19300,\n \"section_id\": \"section_0\",\n \"service_time_min\": 30,\n \"start_pos\": [\n 48.7758,\n 9.1829\n ],\n \"stop_pos\": [\n 49.4521,\n 11.0767\n ]\n }\n ],\n \"start_time_tour\": \"08:00:00\",\n \"vehicle_id\": \"010160700001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"battery_level_end\": 0.2,\n \"battery_level_start\": 0.8,\n \"poi_info\": {\n \"connector_pos\": \"RIGHT\",\n \"connector_type\": [\n \"CCS\"\n ],\n \"min_kW\": 150,\n \"truck_approved\": \"T\"\n },\n \"section_list\": [\n {\n \"payload_kg\": 19300,\n \"section_id\": \"section_0\",\n \"service_time_min\": 30,\n \"start_pos\": [\n 48.7758,\n 9.1829\n ],\n \"stop_pos\": [\n 49.4521,\n 11.0767\n ]\n }\n ],\n \"start_time_tour\": \"08:00:00\",\n \"vehicle_id\": \"010160700001\"\n}")
val request = Request.Builder()
.url("https://api.fryte.com/planner/v2")
.post(body)
.addHeader("Authorization", "Bearer <token>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute(){
"job_id": "c3f1c944-a44c-4c07-ab52-7df7ba94024a",
"message": "202 - Job submitted.",
"optimization_id": 7658,
"tour_id": 7615
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}