What earns money on a charging network is not energy itself but correctly recorded charging sessions. In OCPP 1.6J, when a session started, who started it, how much energy was transferred and why it ended are recorded with two core messages: StartTransaction and StopTransaction. Misreading a single field in these messages can lead to serious differences on an invoice.
StartTransaction: the start of the session
After the user is authorised and the cable is plugged in, the charger sends StartTransaction just before it starts delivering energy. The message contains:
- connectorId: The connector on which the session started.
- idTag: The card or ID that started the session.
- meterStart: The meter reading at the start (Wh).
- timestamp: The start time.
- reservationId: The reservation ID, if any.
The CSMS replies with two things: the status of the ID (idTagInfo) and a transactionId. This ID is used in every MeterValues message sent during the session and in StopTransaction.
Example:
[2, "4001", "StartTransaction", {"connectorId": 1, "idTag": "04A2B3C4", "meterStart": 125430, "timestamp": "2026-10-02T08:10:00Z"}] [3, "4001", {"transactionId": 58211, "idTagInfo": {"status": "Accepted"}}]
StopTransaction: the end of the session
When the session ends, the charger sends StopTransaction:
- transactionId: The ID received at the start.
- meterStop: The meter reading at the end (Wh).
- timestamp: The end time.
- idTag: The ID that stopped the session (optional).
- reason: The stop reason.
- transactionData: Meter values collected during the session (optional).
The energy transferred is simply meterStop - meterStart. In the example above, if meterStop is 147930, the session transferred 22,500 Wh, or 22.5 kWh.
Stop reasons
The standard reasons in OCPP 1.6J are:
- Local: The user stopped it at the charger (card tap, button).
- Remote: The CSMS sent a remote stop command.
- EVDisconnected: The cable was unplugged on the vehicle side.
- EmergencyStop: The emergency stop button was pressed.
- HardReset / SoftReset: The charger was restarted.
- PowerLoss: Power was cut.
- DeAuthorized: The ID became invalid during the session.
- UnlockCommand: A remote unlock command ended the session.
- Reboot, Other: Other cases.
If no reason is given, "Local" is assumed. Reporting stop reasons is very valuable for seeing why users end sessions early or how often chargers restart.
Common mistakes
Reading the meter as if it started from zero
meterStart is not a per-session counter but the charger's cumulative energy register. Always calculate consumption as a difference.
Confusing watt-hours with kilowatt-hours
In OCPP 1.6J, meterStart and meterStop are in Wh. Using them as kWh without dividing by 1,000 inflates the invoice a thousandfold.
Losing offline sessions
If the charger started a session while the internet was down, it sends StartTransaction when the connection returns. The CSMS must process these delayed messages with the correct timestamps. See our article on offline transactions for details.
Sessions that never close
If StopTransaction never arrives, the session stays open in the dashboard. A charger usually sends the missing StopTransaction when it restarts; if it does not, the session must be closed in a controlled way.
What changed in OCPP 2.0.1 and 2.1?
In the newer versions these two messages are replaced by TransactionEvent. The start, interim updates and end are reported with the same message type (Started, Updated, Ended), and the transaction ID is generated by the charger. See our article on OCPP 2.0.1 TransactionEvent for details.
Billing and reporting
A correctly recorded session is the single source of truth for who used how much energy, where and when. Üreticy's OCPP software stores every session with driver, vehicle, station and date; it lets you export energy reports to Excel and PDF and control consumption with kWh limits.
Reading an example session
Suppose the logs show: StartTransaction arrived at 08:10 with meterStart 125430 Wh, and StopTransaction arrived at 09:05 with meterStop 147930 Wh and reason "EVDisconnected". This session lasted 55 minutes, transferred 22.5 kWh, and the driver ended it by unplugging the cable from the vehicle. The average power was about 24.5 kW. This simple calculation ensures that the summary sent to the driver, the invoice and the location report all come from the same source.
Conclusion
StartTransaction opens the session and provides the transactionId; StopTransaction records the total energy and the stop reason. Remembering that meter values are in Wh, that consumption is calculated as a difference and that offline sessions may arrive late prevents most billing errors.
