RequestStopTransaction
Sent by the CSMS to remotely stop an ongoing transaction. Replaces RemoteStopTransaction from OCPP 1.6J.
Quick Reference
Required Fields
transactionId string(36) ID of the transaction to stop
Example Payload
{
"transactionId": "txn-abc123"
} Example Full Frame
[
2,
"msg-001",
"RequestStopTransaction",
{
"transactionId": "txn-abc123"
}
]
Format: [MessageType, MessageId, Action, Payload]
Overview
RequestStopTransaction instructs the Charging Station to stop an active transaction. It replaces RemoteStopTransaction from OCPP 1.6J, with the key change that transactionId is now a string (not an integer).
When to Send
- When a user requests to stop charging via a mobile app
- When a backend billing system detects a limit has been reached
- For emergency stop scenarios
Expected Response
The Charging Station responds with:
status:AcceptedorRejected
After a successful response, a TransactionEvent with eventType: "Ended" and transactionInfo.stoppedReason: "Remote" will be sent.
Key Differences from OCPP 1.6J
| OCPP 1.6J | OCPP 2.0.1 |
|---|---|
RemoteStopTransaction | RequestStopTransaction |
transactionId: integer | transactionId: string (max 36) |
Usage Notes
- The Charging Station responds
Rejectedif no active transaction matches the giventransactionId - After
Accepted, wait for theTransactionEvent { eventType: "Ended" }to confirm the stop - The Charging Station will send a final meter value in the Ended TransactionEvent
Best Practices
- Match the transactionId from TransactionEvent — Use the ID the Charging Station assigned in its Started event
- Wait for the Ended event — Don’t consider the transaction closed until the Ended TransactionEvent arrives
- Handle Rejected gracefully — The transaction may have already ended naturally
Testing Tips
- Test stopping an active transaction and verifying the Ended TransactionEvent
- Test with an invalid transactionId to verify Rejected response
- Test the stoppedReason in the resulting TransactionEvent is
Remote
Common Errors
TypeConstraintViolation
Cause: transactionId is an integer instead of a string
Solution: In OCPP 2.0.1, transactionId is a string (max 36 chars), not an integer like in 1.6J
GenericError
Cause: transactionId does not match any active transaction
Solution: Charging Station should respond with status Rejected if the transactionId is unknown