curl --request PUT \
--url https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"targetFleetId": "a2mPQRst8x"
}
'import requests
url = "https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer"
payload = { "targetFleetId": "a2mPQRst8x" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({targetFleetId: 'a2mPQRst8x'})
};
fetch('https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer', 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/emp/v1/charging-keys/{keyIdentifier}/transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'targetFleetId' => 'a2mPQRst8x'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer"
payload := strings.NewReader("{\n \"targetFleetId\": \"a2mPQRst8x\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.put("https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"targetFleetId\": \"a2mPQRst8x\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"targetFleetId\": \"a2mPQRst8x\"\n}"
response = http.request(request)
puts response.read_body{
"name": "SE6F1K2C3",
"keyIdentifier": "3633e0e0",
"validTo": "2022-01-24T11:25:54.210Z",
"fleetId": "a2mPQRst8x",
"contractId": "DE-9FS-C045DS363-E",
"visualNumber": "6285629402937",
"enabled": true,
"whitelist": "NEVER"
}{
"message": "Charging key must belong to a fleet"
}{
"message": "Target fleet belongs to a different EMP"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}Transfer a charging key
Transfers a charging key from its current fleet to another existing fleet. The target fleet must belong to the same EMP parent as the source fleet and must already have an external payment option configured.
curl --request PUT \
--url https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"targetFleetId": "a2mPQRst8x"
}
'import requests
url = "https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer"
payload = { "targetFleetId": "a2mPQRst8x" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({targetFleetId: 'a2mPQRst8x'})
};
fetch('https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer', 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/emp/v1/charging-keys/{keyIdentifier}/transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'targetFleetId' => 'a2mPQRst8x'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer"
payload := strings.NewReader("{\n \"targetFleetId\": \"a2mPQRst8x\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.put("https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"targetFleetId\": \"a2mPQRst8x\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/emp/v1/charging-keys/{keyIdentifier}/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"targetFleetId\": \"a2mPQRst8x\"\n}"
response = http.request(request)
puts response.read_body{
"name": "SE6F1K2C3",
"keyIdentifier": "3633e0e0",
"validTo": "2022-01-24T11:25:54.210Z",
"fleetId": "a2mPQRst8x",
"contractId": "DE-9FS-C045DS363-E",
"visualNumber": "6285629402937",
"enabled": true,
"whitelist": "NEVER"
}{
"message": "Charging key must belong to a fleet"
}{
"message": "Target fleet belongs to a different EMP"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}Authorizations
API key for authentication
Path Parameters
keyIdentifier provided when creating the charging key
Body
Request payload to transfer an EMP charging key to another fleet.
Customer-facing external ID of the fleet to transfer the charging key into. The target fleet must exist, belong to the same EMP parent as the source fleet, and already have an external payment option configured.
"y1nNLJqb7m"
Response
Charging key transferred successfully.
EMP charging key details returned by key management endpoints.
Name of the Charging key
"SE6F1K2C3"
Charging key identifier in hexadecimal, little-endian format with usually 8 or 14 characters.
"3633e0e0"
UTC timestamp when the charging key expires.
"2022-01-24T11:25:54.210Z"
Fleet id
"y1nNLJqb7m"
Charging key contract id
"DE-9FS-C045DS363-E"
Identifier printed on the physical key
"6285629402937"
Charging key is enabled or disabled
true
Defines whether the CPO may allow a session for this charging key when it cannot get a response from the EMP, or must always rely on realtime authorization from the EMP. Possible values: ALLOWED_OFFLINE, NEVER.
ALLOWED_OFFLINE, NEVER "NEVER"