API Reference
Plug-in event
Send notification of a car being plugged in.
Tariff, vehicle and intent information may be optionally provided. If a tariff is included, it must comply with the OSM opening hours standard (https://wiki.openstreetmap.org/wiki/Key:opening_hours) for off-peak times and have a valid timezone, or a 400 error will be returned.
POST
/
entities
/
asset
/
{asset_id}
/
event
/
plug-in
Asset Plug In Event
curl --request POST \
--url https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"intent": {
"energy_required_kwh": 30,
"ready_by": "2026-01-16T07:00:00Z",
"ready_by_local_time": "07:00:00"
},
"vehicle": {
"charging_rate_kw": 7.4
},
"tariff": {
"off_peak_times": "Mo-Su 00:30-05:30",
"tariff_type": "dual_rate",
"timezone": "Europe/London"
}
}
'import requests
url = "https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in"
payload = {
"intent": {
"energy_required_kwh": 30,
"ready_by": "2026-01-16T07:00:00Z",
"ready_by_local_time": "07:00:00"
},
"vehicle": { "charging_rate_kw": 7.4 },
"tariff": {
"off_peak_times": "Mo-Su 00:30-05:30",
"tariff_type": "dual_rate",
"timezone": "Europe/London"
}
}
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({
intent: {
energy_required_kwh: 30,
ready_by: '2026-01-16T07:00:00Z',
ready_by_local_time: '07:00:00'
},
vehicle: {charging_rate_kw: 7.4},
tariff: {
off_peak_times: 'Mo-Su 00:30-05:30',
tariff_type: 'dual_rate',
timezone: 'Europe/London'
}
})
};
fetch('https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in",
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([
'intent' => [
'energy_required_kwh' => 30,
'ready_by' => '2026-01-16T07:00:00Z',
'ready_by_local_time' => '07:00:00'
],
'vehicle' => [
'charging_rate_kw' => 7.4
],
'tariff' => [
'off_peak_times' => 'Mo-Su 00:30-05:30',
'tariff_type' => 'dual_rate',
'timezone' => 'Europe/London'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in"
payload := strings.NewReader("{\n \"intent\": {\n \"energy_required_kwh\": 30,\n \"ready_by\": \"2026-01-16T07:00:00Z\",\n \"ready_by_local_time\": \"07:00:00\"\n },\n \"vehicle\": {\n \"charging_rate_kw\": 7.4\n },\n \"tariff\": {\n \"off_peak_times\": \"Mo-Su 00:30-05:30\",\n \"tariff_type\": \"dual_rate\",\n \"timezone\": \"Europe/London\"\n }\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))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"intent\": {\n \"energy_required_kwh\": 30,\n \"ready_by\": \"2026-01-16T07:00:00Z\",\n \"ready_by_local_time\": \"07:00:00\"\n },\n \"vehicle\": {\n \"charging_rate_kw\": 7.4\n },\n \"tariff\": {\n \"off_peak_times\": \"Mo-Su 00:30-05:30\",\n \"tariff_type\": \"dual_rate\",\n \"timezone\": \"Europe/London\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"intent\": {\n \"energy_required_kwh\": 30,\n \"ready_by\": \"2026-01-16T07:00:00Z\",\n \"ready_by_local_time\": \"07:00:00\"\n },\n \"vehicle\": {\n \"charging_rate_kw\": 7.4\n },\n \"tariff\": {\n \"off_peak_times\": \"Mo-Su 00:30-05:30\",\n \"tariff_type\": \"dual_rate\",\n \"timezone\": \"Europe/London\"\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Body
application/json
A minimal plug-in event requires no data.
Optionally intent, tariff and vehicle information can be supplied here too.
Intent to charge the vehicle.
Show child attributes
Show child attributes
Example:
{
"energy_required_kwh": 30,
"ready_by": "2026-01-16T07:00:00Z",
"ready_by_local_time": "07:00:00"
}
Vehicle information.
Show child attributes
Show child attributes
Example:
{ "charging_rate_kw": 7.4 }
Tariff information.
Show child attributes
Show child attributes
Example:
{
"off_peak_times": "Mo-Su 00:30-05:30",
"tariff_type": "dual_rate",
"timezone": "Europe/London"
}
Response
Plug-in event successfully processed
Was this page helpful?
⌘I
Asset Plug In Event
curl --request POST \
--url https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"intent": {
"energy_required_kwh": 30,
"ready_by": "2026-01-16T07:00:00Z",
"ready_by_local_time": "07:00:00"
},
"vehicle": {
"charging_rate_kw": 7.4
},
"tariff": {
"off_peak_times": "Mo-Su 00:30-05:30",
"tariff_type": "dual_rate",
"timezone": "Europe/London"
}
}
'import requests
url = "https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in"
payload = {
"intent": {
"energy_required_kwh": 30,
"ready_by": "2026-01-16T07:00:00Z",
"ready_by_local_time": "07:00:00"
},
"vehicle": { "charging_rate_kw": 7.4 },
"tariff": {
"off_peak_times": "Mo-Su 00:30-05:30",
"tariff_type": "dual_rate",
"timezone": "Europe/London"
}
}
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({
intent: {
energy_required_kwh: 30,
ready_by: '2026-01-16T07:00:00Z',
ready_by_local_time: '07:00:00'
},
vehicle: {charging_rate_kw: 7.4},
tariff: {
off_peak_times: 'Mo-Su 00:30-05:30',
tariff_type: 'dual_rate',
timezone: 'Europe/London'
}
})
};
fetch('https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in",
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([
'intent' => [
'energy_required_kwh' => 30,
'ready_by' => '2026-01-16T07:00:00Z',
'ready_by_local_time' => '07:00:00'
],
'vehicle' => [
'charging_rate_kw' => 7.4
],
'tariff' => [
'off_peak_times' => 'Mo-Su 00:30-05:30',
'tariff_type' => 'dual_rate',
'timezone' => 'Europe/London'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in"
payload := strings.NewReader("{\n \"intent\": {\n \"energy_required_kwh\": 30,\n \"ready_by\": \"2026-01-16T07:00:00Z\",\n \"ready_by_local_time\": \"07:00:00\"\n },\n \"vehicle\": {\n \"charging_rate_kw\": 7.4\n },\n \"tariff\": {\n \"off_peak_times\": \"Mo-Su 00:30-05:30\",\n \"tariff_type\": \"dual_rate\",\n \"timezone\": \"Europe/London\"\n }\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))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"intent\": {\n \"energy_required_kwh\": 30,\n \"ready_by\": \"2026-01-16T07:00:00Z\",\n \"ready_by_local_time\": \"07:00:00\"\n },\n \"vehicle\": {\n \"charging_rate_kw\": 7.4\n },\n \"tariff\": {\n \"off_peak_times\": \"Mo-Su 00:30-05:30\",\n \"tariff_type\": \"dual_rate\",\n \"timezone\": \"Europe/London\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.axle.energy/entities/asset/{asset_id}/event/plug-in")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"intent\": {\n \"energy_required_kwh\": 30,\n \"ready_by\": \"2026-01-16T07:00:00Z\",\n \"ready_by_local_time\": \"07:00:00\"\n },\n \"vehicle\": {\n \"charging_rate_kw\": 7.4\n },\n \"tariff\": {\n \"off_peak_times\": \"Mo-Su 00:30-05:30\",\n \"tariff_type\": \"dual_rate\",\n \"timezone\": \"Europe/London\"\n }\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
