Sending commands
Ask a charger to start, stop, restart or release a cable with one call that queues while it is offline, retries safely and reports the outcome.
On this page
Everything you ask a charger to do goes through one endpoint: POST /v1/charging-stations/{chargingStationId}/commands. It works the same for every charger and every command type, even when the charger is offline. This page covers what all commands share; the guides cover what each one is for.
Send a command
200Response
The call answers 201 at once with a command, recorded before the charger has said anything. status is sent if the charger was online and got it straight away, or queued if it is waiting for the charger to connect.
Follow it to the answer
Or skip polling: live updates send a commandStatusChanged event with the command's id on every change.
status | Meaning |
|---|---|
queued | Waiting for the charger to connect |
sent | Delivered, waiting for the answer |
accepted | The charger said yes. Its answer is in result |
rejected | The charger said no. Its answer is in result |
failed | No usable answer. failureReason says why: timed_out means the charger did not answer in time |
expired | The charger did not connect before expiresAt, so it was never sent |
superseded | A newer command of the same type for the same outlet replaced it. supersededBy names the newer one |
A timed_out command may still have happened: a charger can act and lose the connection before it answers. Check for the effect before you send it again.
Send to a charger that is offline
A charger does not need to be connected when you send. The command waits as queued and goes out the moment the charger reconnects. If it does not reconnect in time, the command expires instead of arriving long after it stopped making sense:
| Command | Waits for |
|---|---|
reset, unlockConnector, changeAvailability | 5 minutes |
remoteStartTransaction, remoteStopTransaction, updateFirmware, triggerMessage | 15 minutes |
reserveNow, cancelReservation | 30 minutes |
expiresAt on the command always gives the exact time.
Retry safely
Idempotency-Key is required on this endpoint, and is what makes a retry safe:
Same key, same body: you get the original command back with
200, and nothing new is sent.Same key, different body:
409 idempotencyKeyConflict.No key:
400 missingIdempotencyKey.
Use a fresh key for each new command and reuse it for every retry of that command. A start retried after a network timeout then never becomes two sessions.
Know what a charger supports
Chargers differ in what they can do. Ask before you build a button:
200Response
Each command type answers one of three things:
| Answer | Meaning |
|---|---|
supported | The charger can do it |
notSupported | It cannot. Sending it anyway is refused with 422 |
notYetKnown | The charger has not been connected long enough to tell |
This answers from what the charger has already reported, so it works while the charger is offline. Add ?evseId=2 when support could differ between outlets. notYetKnown is never a guess: it turns into one of the other two once the charger has connected and reported what it has.
Command types
type picks the command. Each type has its own fields:
type | What it does | Guide |
|---|---|---|
remoteStartTransaction | Start a session | Start and stop sessions remotely |
remoteStopTransaction | Stop a session | Start and stop sessions remotely |
unlockConnector | Release a stuck cable | Release a stuck cable |
changeAvailability | Take a charger or outlet in or out of service | Take a charger in and out of service |
reset | Restart a charger | Restart a charger |
reserveNow | Hold an outlet for one person until a time you choose | Create command |
cancelReservation | Cancel a reservation | Create command |
updateFirmware | Install the newest firmware Flowion has for the charger's make and model | Create command |
triggerMessage | Ask the charger to send a status, meter reading or other report now | Create command |
A few things are worth knowing before you send:
remoteStartTransactionandremoteStopTransactionare refused with422 chargingStationNotAccepteduntil the charger has finished registering with Flowion. The other types are not.updateFirmwareis not supported on every charger. See which. A charger connected through its maker's cloud gets its firmware from the maker, and the command answers422 vendorManagedFirmware.For
triggerMessage,acceptedmeans the charger will send the report. The report itself arrives like any other update from the charger.To fetch a charger's diagnostic log, use Diagnostics instead.
Calls that wait for the charger
Reading and writing a charger's own settings, and manufacturer-specific messages, use their own endpoints under .../commands/. Those wait for the charger's answer, up to about 35 seconds, so the charger has to be online:
| Code | Meaning |
|---|---|
200 | The charger answered, including when it said no |
409 | The charger is not connected |
422 | The request cannot be sent to this charger, or was refused before sending |
502 | The charger disconnected mid-call or sent an answer Flowion could not read |
503 | The command could not be sent |
504 | The charger did not answer in time |
They are recorded in the same history as every other command.
Review a charger's history
Every command ever sent to the charger, newest first, whoever sent it. issuedBy says whether a person, an API key or Flowion itself asked. Filter by status or evseId, and page with cursor and limit.
Next: Rate limits.