API reference
Start charging
Starts a charging session on a charger at a site your team owns, or on a charger in a user’s own
Plugchoice account while your integration has a grant on it with charger:control. Without that scope
it’s 403 scope-missing.
202 means the charger took the command. The session itself shows in listTransactions once the car
charges; poll it to follow the session.
POST
/
chargers
/
{charger_id}
/
start
Start charging
curl --request POST \
--url https://api.plugchoice.com/sdk/v1/chargers/{charger_id}/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connector_id": 1
}
'import requests
url = "https://api.plugchoice.com/sdk/v1/chargers/{charger_id}/start"
payload = { "connector_id": 1 }
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({connector_id: 1})
};
fetch('https://api.plugchoice.com/sdk/v1/chargers/{charger_id}/start', 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.plugchoice.com/sdk/v1/chargers/{charger_id}/start",
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([
'connector_id' => 1
]),
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.plugchoice.com/sdk/v1/chargers/{charger_id}/start"
payload := strings.NewReader("{\n \"connector_id\": 1\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.plugchoice.com/sdk/v1/chargers/{charger_id}/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connector_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plugchoice.com/sdk/v1/chargers/{charger_id}/start")
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 \"connector_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"status": "accepted"
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}Authorizations
Headers
Body
application/json
⌘I
Start charging
curl --request POST \
--url https://api.plugchoice.com/sdk/v1/chargers/{charger_id}/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connector_id": 1
}
'import requests
url = "https://api.plugchoice.com/sdk/v1/chargers/{charger_id}/start"
payload = { "connector_id": 1 }
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({connector_id: 1})
};
fetch('https://api.plugchoice.com/sdk/v1/chargers/{charger_id}/start', 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.plugchoice.com/sdk/v1/chargers/{charger_id}/start",
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([
'connector_id' => 1
]),
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.plugchoice.com/sdk/v1/chargers/{charger_id}/start"
payload := strings.NewReader("{\n \"connector_id\": 1\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.plugchoice.com/sdk/v1/chargers/{charger_id}/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connector_id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.plugchoice.com/sdk/v1/chargers/{charger_id}/start")
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 \"connector_id\": 1\n}"
response = http.request(request)
puts response.read_body{
"status": "accepted"
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}{
"type": "https://developer.plugchoice.com/sdk/errors/identity-taken",
"title": "Identity already registered",
"status": 123,
"detail": "<string>",
"code": "unauthenticated",
"errors": {},
"site": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"claimable": true,
"sign_in_to_share": true,
"vendor_charger": {
"id": "<string>",
"serial": "<string>"
}
}