Lessons / Practice an OCPI situation / Complete EV charging session
Complete EV charging session Start here · 8 min
OCPI 2.1.1, 2.2.1 and 2.3.0
Showing OCPI 2.2.1. Physical and billing-system events are authored examples.
Part of the lesson OCPI charging session lifecycle
Follow an authored charging session from the driver arriving at the charger through energy delivery and billing between participating roaming platforms.
The scenario, step by step The driver arrives at the charging station and taps their RFID card on the charger to identify themselves.
The charger doesn't recognize the token locally. It forwards the authorization request to the CPO's backend system to check if this driver can charge.
The token belongs to a driver of the eMSP. Its whitelist value, ALLOWED_OFFLINE, means real-time authorization is used while the eMSP can be reached, so the CPO asks the eMSP to authorize the token through the Tokens module.
Authorization succeeded. The CPO tells the charger to unlock the connector. The driver plugs in the cable and charging begins.
The charger begins delivering energy. The CPO creates a session record and pushes it to the eMSP so the driver can see charging progress in their app.
The charger reports new meter readings. The CPO updates the session with current energy delivered and sends the update to the eMSP.
The driver returns to their car and unplugs the cable. The charger detects the disconnection and reports the final meter reading to the CPO.
The CPO marks the session as COMPLETED with the total energy delivered and final cost, then pushes the update to the eMSP.
The CPO creates the billing-relevant CDR after the charge and sends it to the eMSP. The excerpt shows cost and charging-period information.
The eMSP accepts the CDR, completes the billing cycle, and charges the driver. The driver receives a receipt in their app showing the session summary and total cost.
Lab activities The OCPI charging lab follows one authored Session. Inspect messages between the CPO and eMSP, then configure a separate simulated network.
The OCPI simulator models CPO, eMSP and charger actors. Configure a network in Free exploration; the guided charge keeps its authored actors.
An OCPI charging flow connects authorization, Session updates and the CDR. Follow the guided example or inspect your simulated network.
An OCPI message has a sender, a receiver and an endpoint. Inspect the request and read the HTTP status separately from the response body.
The OCPI charging lab connects a Session to its authorization, updates and CDR. Revisit a message or try a field puzzle before another scenario.
All scenarios Start: Driver taps an RFID card on the charger Test this flowTest this flow runs against an eMSP endpoint you have registered. The endpoint test grades your endpoint's answer to each Session push. It does not read the stored Session back.