Create a fleet charging key order
curl --request POST \
--url https://{environment}.plugsurfing.com/emp/v1/orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fleetId": "fleet-123",
"productId": "Nk375yz7Gw",
"address": {
"firstName": "Jane",
"lastName": "Doe",
"addressLine1": "Example Street 1",
"addressLine2": "Floor 2",
"postalCode": "00100",
"city": "Helsinki",
"country": "FI",
"companyName": "Example Ltd"
},
"printing": {
"driverName": "Jane Doe",
"licensePlate": "FI000AA"
}
}
'import requests
url = "https://{environment}.plugsurfing.com/emp/v1/orders"
payload = {
"fleetId": "fleet-123",
"productId": "Nk375yz7Gw",
"address": {
"firstName": "Jane",
"lastName": "Doe",
"addressLine1": "Example Street 1",
"addressLine2": "Floor 2",
"postalCode": "00100",
"city": "Helsinki",
"country": "FI",
"companyName": "Example Ltd"
},
"printing": {
"driverName": "Jane Doe",
"licensePlate": "FI000AA"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fleetId: 'fleet-123',
productId: 'Nk375yz7Gw',
address: {
firstName: 'Jane',
lastName: 'Doe',
addressLine1: 'Example Street 1',
addressLine2: 'Floor 2',
postalCode: '00100',
city: 'Helsinki',
country: 'FI',
companyName: 'Example Ltd'
},
printing: {driverName: 'Jane Doe', licensePlate: 'FI000AA'}
})
};
fetch('https://{environment}.plugsurfing.com/emp/v1/orders', 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/orders",
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([
'fleetId' => 'fleet-123',
'productId' => 'Nk375yz7Gw',
'address' => [
'firstName' => 'Jane',
'lastName' => 'Doe',
'addressLine1' => 'Example Street 1',
'addressLine2' => 'Floor 2',
'postalCode' => '00100',
'city' => 'Helsinki',
'country' => 'FI',
'companyName' => 'Example Ltd'
],
'printing' => [
'driverName' => 'Jane Doe',
'licensePlate' => 'FI000AA'
]
]),
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/orders"
payload := strings.NewReader("{\n \"fleetId\": \"fleet-123\",\n \"productId\": \"Nk375yz7Gw\",\n \"address\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"addressLine1\": \"Example Street 1\",\n \"addressLine2\": \"Floor 2\",\n \"postalCode\": \"00100\",\n \"city\": \"Helsinki\",\n \"country\": \"FI\",\n \"companyName\": \"Example Ltd\"\n },\n \"printing\": {\n \"driverName\": \"Jane Doe\",\n \"licensePlate\": \"FI000AA\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://{environment}.plugsurfing.com/emp/v1/orders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fleetId\": \"fleet-123\",\n \"productId\": \"Nk375yz7Gw\",\n \"address\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"addressLine1\": \"Example Street 1\",\n \"addressLine2\": \"Floor 2\",\n \"postalCode\": \"00100\",\n \"city\": \"Helsinki\",\n \"country\": \"FI\",\n \"companyName\": \"Example Ltd\"\n },\n \"printing\": {\n \"driverName\": \"Jane Doe\",\n \"licensePlate\": \"FI000AA\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/emp/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fleetId\": \"fleet-123\",\n \"productId\": \"Nk375yz7Gw\",\n \"address\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"addressLine1\": \"Example Street 1\",\n \"addressLine2\": \"Floor 2\",\n \"postalCode\": \"00100\",\n \"city\": \"Helsinki\",\n \"country\": \"FI\",\n \"companyName\": \"Example Ltd\"\n },\n \"printing\": {\n \"driverName\": \"Jane Doe\",\n \"licensePlate\": \"FI000AA\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "aYnky297eG",
"address": {
"country": "FI",
"firstName": "Jane",
"lastName": "Doe",
"city": "Helsinki",
"postalCode": "00100",
"companyName": "Example Ltd",
"addressLine1": "Example Street 1",
"addressLine2": "Floor 2"
},
"quantity": 1,
"language": "en",
"product": {
"id": "Nk375yz7Gw"
},
"created": "2024-01-15T10:00:00Z",
"organizationId": "JoEl1xoP7r",
"status": "ORDER_PAID",
"updated": "2024-01-15T10:00:00Z",
"printing": {
"variables": {
"driverName": "Jane Doe",
"licensePlate": "FI000AA"
}
}
}{
"message": "Missing required field: productId"
}{
"message": "Resource not found"
}{
"message": "An unexpected error occurred."
}EMP Orders
Create a fleet charging key order
Creates a charging key order for a fleet organization.
POST
/
emp
/
v1
/
orders
Create a fleet charging key order
curl --request POST \
--url https://{environment}.plugsurfing.com/emp/v1/orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fleetId": "fleet-123",
"productId": "Nk375yz7Gw",
"address": {
"firstName": "Jane",
"lastName": "Doe",
"addressLine1": "Example Street 1",
"addressLine2": "Floor 2",
"postalCode": "00100",
"city": "Helsinki",
"country": "FI",
"companyName": "Example Ltd"
},
"printing": {
"driverName": "Jane Doe",
"licensePlate": "FI000AA"
}
}
'import requests
url = "https://{environment}.plugsurfing.com/emp/v1/orders"
payload = {
"fleetId": "fleet-123",
"productId": "Nk375yz7Gw",
"address": {
"firstName": "Jane",
"lastName": "Doe",
"addressLine1": "Example Street 1",
"addressLine2": "Floor 2",
"postalCode": "00100",
"city": "Helsinki",
"country": "FI",
"companyName": "Example Ltd"
},
"printing": {
"driverName": "Jane Doe",
"licensePlate": "FI000AA"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fleetId: 'fleet-123',
productId: 'Nk375yz7Gw',
address: {
firstName: 'Jane',
lastName: 'Doe',
addressLine1: 'Example Street 1',
addressLine2: 'Floor 2',
postalCode: '00100',
city: 'Helsinki',
country: 'FI',
companyName: 'Example Ltd'
},
printing: {driverName: 'Jane Doe', licensePlate: 'FI000AA'}
})
};
fetch('https://{environment}.plugsurfing.com/emp/v1/orders', 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/orders",
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([
'fleetId' => 'fleet-123',
'productId' => 'Nk375yz7Gw',
'address' => [
'firstName' => 'Jane',
'lastName' => 'Doe',
'addressLine1' => 'Example Street 1',
'addressLine2' => 'Floor 2',
'postalCode' => '00100',
'city' => 'Helsinki',
'country' => 'FI',
'companyName' => 'Example Ltd'
],
'printing' => [
'driverName' => 'Jane Doe',
'licensePlate' => 'FI000AA'
]
]),
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/orders"
payload := strings.NewReader("{\n \"fleetId\": \"fleet-123\",\n \"productId\": \"Nk375yz7Gw\",\n \"address\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"addressLine1\": \"Example Street 1\",\n \"addressLine2\": \"Floor 2\",\n \"postalCode\": \"00100\",\n \"city\": \"Helsinki\",\n \"country\": \"FI\",\n \"companyName\": \"Example Ltd\"\n },\n \"printing\": {\n \"driverName\": \"Jane Doe\",\n \"licensePlate\": \"FI000AA\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://{environment}.plugsurfing.com/emp/v1/orders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fleetId\": \"fleet-123\",\n \"productId\": \"Nk375yz7Gw\",\n \"address\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"addressLine1\": \"Example Street 1\",\n \"addressLine2\": \"Floor 2\",\n \"postalCode\": \"00100\",\n \"city\": \"Helsinki\",\n \"country\": \"FI\",\n \"companyName\": \"Example Ltd\"\n },\n \"printing\": {\n \"driverName\": \"Jane Doe\",\n \"licensePlate\": \"FI000AA\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/emp/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fleetId\": \"fleet-123\",\n \"productId\": \"Nk375yz7Gw\",\n \"address\": {\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"addressLine1\": \"Example Street 1\",\n \"addressLine2\": \"Floor 2\",\n \"postalCode\": \"00100\",\n \"city\": \"Helsinki\",\n \"country\": \"FI\",\n \"companyName\": \"Example Ltd\"\n },\n \"printing\": {\n \"driverName\": \"Jane Doe\",\n \"licensePlate\": \"FI000AA\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "aYnky297eG",
"address": {
"country": "FI",
"firstName": "Jane",
"lastName": "Doe",
"city": "Helsinki",
"postalCode": "00100",
"companyName": "Example Ltd",
"addressLine1": "Example Street 1",
"addressLine2": "Floor 2"
},
"quantity": 1,
"language": "en",
"product": {
"id": "Nk375yz7Gw"
},
"created": "2024-01-15T10:00:00Z",
"organizationId": "JoEl1xoP7r",
"status": "ORDER_PAID",
"updated": "2024-01-15T10:00:00Z",
"printing": {
"variables": {
"driverName": "Jane Doe",
"licensePlate": "FI000AA"
}
}
}{
"message": "Missing required field: productId"
}{
"message": "Resource not found"
}{
"message": "An unexpected error occurred."
}Body
application/json
Request body for creating a fleet charging key order.
Optional language of the information letter that accompanies the order. ISO 639-1 two-letter language code, for example en, de, sv or fi. Case-insensitive. Regional variants such as en-GB are rejected. When omitted, the product default language is used.
Pattern:
^[a-zA-Z]{2}$Example:
"de"
Optional printing payload. Requirements are product-specific — use the printing.schema from product discovery to build and validate this object before submitting. Drive API forwards this payload unchanged to the fulfilment system.
Example:
{
"driverName": "Jane Doe",
"licensePlate": "FI000AA"
}
Response
OK
EMP charging key order product details.
Current processing status of the order product.
Available options:
WAITING_FOR_ORDER, ORDER_PLACED, ORDER_PROCESSING, ORDER_ASSIGNED, ORDER_PAID, ORDER_CANCELLED, ORDER_CANCELLING, ORDER_PAYMENT_FAILED, ORDER_REFUND_FAILED, ORDER_WAITING_REFUND, ORDER_REFUNDED, PAYMENT_ONGOING, ORDER_FILLED, ORDER_PAYED, PREPARE_RECEIPT, ORDER_PAYED_WITHOUT_RECEIPT Example:
"ORDER_PAID"