ocpp.message
Theocpp.message event is triggered whenever an OCPP message is sent to or received from a charging station. This provides real-time visibility into all communication between the Nayax Energy Core platform and your charging infrastructure.
OCPP RPC Framework
OCPP (Open Charge Point Protocol) uses a JSON-RPC-like framework for communication between the central system (Nayax Energy Core) and charging stations. Understanding the message types is essential for processing these webhooks correctly.Message Types
Message Correlation
Every OCPP message includes amessageId field. This ID is used to correlate requests with their responses:
- A
CALLmessage is sent with a uniquemessageId - The recipient responds with either a
CALL_RESULTorCALL_ERRORusing the samemessageId
Supported Protocols
Theprotocol field indicates which OCPP version the station is using:
ocpp1.6- OCPP 1.6 (JSON)ocpp2.0.1- OCPP 2.0.1
Payload Structure
Thedata object in an ocpp.message webhook contains:
Examples
CALL - BootNotification (Station to Nayax Energy Core)
When a charging station connects to the network, it sends aBootNotification to register itself:
CALL_RESULT - BootNotification Response (Nayax Energy Core to Station)
The response to a successfulBootNotification:
CALL - Heartbeat (Station to Nayax Energy Core)
Stations send periodicHeartbeat messages to indicate they are still connected. The interval is determined by the interval field in the BootNotification response (e.g., every 300 seconds):
CALL_RESULT - Heartbeat Response (Nayax Energy Core to Station)
The response contains the current server time, which stations use to synchronize their clocks:CALL - StartTransaction (Station to Nayax Energy Core)
When a charging session begins:CALL - MeterValues (Station to Nayax Energy Core)
Periodic energy consumption updates during charging:CALL - StatusNotification (Station to Nayax Energy Core)
Stations sendStatusNotification messages whenever a connector’s status changes. The payload contains a status field indicating the connector state and an errorCode field for fault detection.
Connector Statuses (OCPP 1.6):
Detecting Faults:
To detect faults, check both the
status and errorCode fields in the payload:
- If
statusisFaulted, the connector has an active fault - The
errorCodefield provides details about the fault type (e.g.,GroundFailure,OverCurrentFailure,PowerMeterFailure) - When
errorCodeisNoError, the connector is operating normally
CALL - RemoteStartTransaction (Nayax Energy Core to Station)
When you initiate a charging session remotely via the API:CALL_RESULT - RemoteStartTransaction Response
CALL_ERROR - Request Rejected
When a station cannot process a request:Common Error Codes
When processingCALL_ERROR messages, you may encounter these error codes:
asset.connectivity
Theasset.connectivity event is triggered when a charging station’s connection status changes. This allows you to monitor the online/offline status of your charging infrastructure in real-time.
Connectivity Statuses
TheconnectivityStatus field indicates what happened:
Connection Lifecycle
Payload Structure
Thedata object in an asset.connectivity webhook contains:
Examples
Station Connected
When a station first establishes a connection:Station Disconnected
When a station loses connection:Use Cases
Common use cases forasset.connectivity events:
- Monitoring dashboards - Display real-time station status
- Alerting - Notify operators when stations go offline
- Analytics - Track station uptime and reliability metrics
- Automated diagnostics - Trigger health checks when stations reconnect