curl --request GET \
--url https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}', 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://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balanceStatus": "PROCESSING",
"sessionStatus": "CREATED",
"charger": {
"chargingStationName": "Drive_API_Test1_Station1",
"city": "Solna",
"connectorLabel": "1",
"evseId": "SE*CND*EC1*1",
"streetName": "Rättarvägen"
},
"balanceAmountMinor": "-2160",
"chargingKeyType": "virtual",
"connectorId": "O9UXK+YI5Q6i0FoI4qHwcA==",
"duration": "PT28.913S",
"energy": {
"unit": "WH",
"value": 57
},
"paymentMethod": "CREDIT_CARD",
"price": {
"currencyCode": "EUR",
"minorExclVat": 2785,
"minorInclVat": 1,
"vat": "17.5"
},
"receiptAvailable": true,
"sessionId": "AAdmD55q8Vz",
"site": "Drive_API_Test1",
"startTime": "2021-01-30T10:00:00.111111111Z",
"transactions": [
{
"paymentMethod": "CREDIT_CARD",
"paymentOutcome": "CHARGE",
"amount": {
"currencyCode": "EUR",
"minorExclVat": 2785,
"minorInclVat": 1,
"vat": "17.5"
},
"time": "2021-01-30T10:00:00.111111111Z"
}
]
}{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}Get details of a specific charging session
Retrieves detailed information about a specific charging session. This includes: - Session status (completed or in-progress) - Energy consumption and duration - Cost and payment status - Charging location details - Charging key used This endpoint can be used to track both completed sessions and monitor ongoing ones.
curl --request GET \
--url https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}', 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://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balanceStatus": "PROCESSING",
"sessionStatus": "CREATED",
"charger": {
"chargingStationName": "Drive_API_Test1_Station1",
"city": "Solna",
"connectorLabel": "1",
"evseId": "SE*CND*EC1*1",
"streetName": "Rättarvägen"
},
"balanceAmountMinor": "-2160",
"chargingKeyType": "virtual",
"connectorId": "O9UXK+YI5Q6i0FoI4qHwcA==",
"duration": "PT28.913S",
"energy": {
"unit": "WH",
"value": 57
},
"paymentMethod": "CREDIT_CARD",
"price": {
"currencyCode": "EUR",
"minorExclVat": 2785,
"minorInclVat": 1,
"vat": "17.5"
},
"receiptAvailable": true,
"sessionId": "AAdmD55q8Vz",
"site": "Drive_API_Test1",
"startTime": "2021-01-30T10:00:00.111111111Z",
"transactions": [
{
"paymentMethod": "CREDIT_CARD",
"paymentOutcome": "CHARGE",
"amount": {
"currencyCode": "EUR",
"minorExclVat": 2785,
"minorInclVat": 1,
"vat": "17.5"
},
"time": "2021-01-30T10:00:00.111111111Z"
}
]
}{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}Authorizations
API key for authentication
Path Parameters
The unique identifier of the user who owns the charging session
The unique identifier of the charging session
Response
Session
Detailed charging session information.
Current lifecycle status of the session.
CREATED, WAITING_TO_START, STARTED, WAITING_TO_STOP, STOPPED, COMPLETE, FAILED, UNKNOWN, STOP_FAILED Only available after a session has successfully started.
"O9UXK+YI5Q6i0FoI4qHwcA=="
Unique identifier of the charging session.
"AAdmD55q8Vz"
Transactions linked to this charging session.
Show child attributes
Show child attributes
Balance state after applying session costs.
PROCESSING, PAID, DEBT, REFUND Charger location and connector metadata.
Show child attributes
Show child attributes
Type "Long". This field is not relevant for External Clearing (only used when using Plugsurfing's Payment Service Provider). Represents the remaining amount to be paid, expressed as a negative number. A value of 0 indicates the balance is fully paid. -2160 means there is an outstanding amount of 21.60 in the currency of the session.
"-2160"
Only available after a session has successfully started. Possible values are "tag", "card", "virtual" or "plug_and_charge".
"virtual"
The value is in ISO 8601 duration format
"PT28.913S"
Energy consumed during the session.
Show child attributes
Show child attributes
Returns the paymentMethod of the transaction with the earliest timestamp. This field is DEPRECATED and will be removed in future versions. Use session.transactions[].paymentMethod instead. Migration note: WRITE_OFF was renamed to NONE, where session.transactions[].paymentOutcome=WRITE_OFF is the replacement
CREDIT_CARD, EXTERNAL, PREPAID, WRITE_OFF Total session price.
Show child attributes
Show child attributes
Indicates whether a receipt can be downloaded.
Human-readable charging site name.
"Drive_API_Test1"
UTC timestamp when the session started.
"2021-01-30T10:00:00.111111111Z"