Events
Description
Plugsurfing can notify you when a session event for any of your users happens, for example "charging session started" or "charging session stopped". These events are sent to you using webhooks.
Each event will be pushed once without retries. The listener's response is not taken into account.
Events are distributed in the same way for both remote and local (RFID) sessions.
Event type should be checked before processing. New event types can appear without previous notice.
We do not guarantee the delivery of events. Some Charge Point Operators (CPOs) may fail to send events, and events may be received in an unexpected order.
For instance, aSESSION_FAILED
event might be followed by aSESSION_STARTED
event (e.g. if the CPO had connection issues with the charger).
Session events are intended to enhance the user experience, but your system should be designed to function independently of them.
For more information, see Remote session.
Configuration
Events can be configured on stage environment directly from the Control Panel.
For production setup you need to contact your account manager.
Data needed for configuration:
- Url that will receive all events
- Authorization headers that will be passed in the request to the mentioned url.
Request
Method: POST
Body fields:
event
(string) - possible event names listed below
(remember to gracefully handle other events, that might be added in the future)payload
(object) - defined for each event
Example:
{
"event": "SESSION_STARTED",
"payload": {
"userId": "user1",
"sessionId": "L60XMxWy0oP",
"timestamp": "2022-04-01T15:37:13.913499Z"
}
}
Event types
Session started
This event is provided for most remote sessions and for many local (rfid) sessions.
To get more details like session start date, you can use the session-by-id endpoint.
event name: SESSION_STARTED
payload:
userId
(string)sessionId
(string)timestamp
(string, datetime)
Session failed
If a session fails to start properly, this event is sent and the session goes to FAILED status.
event name: SESSION_FAILED
payload:
userId
(string)sessionId
(string)timestamp
(string, datetime)
Session stopped
This event is sent right after a remote session stops successfully.
event name: SESSION_STOPPED
payload:
userId
(string)sessionId
(string)timestamp
(string, datetime)
Session stop failed
This event is sent when there is an issue with stopping a session. The session goes into STOP_FAILED
status.
The user should be able to request a stop once again.
event name: SESSION_STOP_FAILED
payload:
userId
(string)sessionId
(string)timestamp
(string, datetime)
Session finished
This event will be sent for every session a user makes.
It is generated when Plugsurfing receives the session's CDR.
In some rare cases where we receive the CDR late, this event can arrive hours or even days after the session has actually finished.
To get more details about the session, use the session-by-id endpoint.
event name: SESSION_COMPLETE
payload:
userId
(string)sessionId
(string)timestamp
(string, datetime)
Updated 3 months ago