You’re staring at a dashboard of fragmented charging networks, aren’t you? You’ve got a fleet to manage or a network to scale, and the reality is a mess of proprietary silos. Your drivers are frustrated by the “app-tax”—the need to download five different apps just to ensure they can charge across a single state. You’re worried about data leakage, settlement delays, and the sheer technical debt of trying to bridge disparate backends. It feels like you’re building a bridge while the river is flooding. Let’s strip away the vendor-lock-in marketing and look at the plumbing that actually makes roaming work: the Open Charge Point Interface (OCPI).
OCPI is the essential API-based protocol for network interoperability, enabling eMSPs and CPOs to exchange real-time station data, authorization tokens, and billing records. Unlike OCPP, which manages the hardware-to-cloud link, OCPI bridges the business-to-business gap, allowing drivers to roam seamlessly across competing networks without proprietary app fragmentation.
Why do most operators confuse OCPI and OCPP?
The confusion is understandable, but it’s a costly trap. I see teams waste months trying to force OCPP to handle roaming authentication, which is like trying to use a screwdriver to hammer in a nail.
OCPP (Open Charge Point Protocol) is strictly about the conversation between the charging station and the Charge Point Operator’s (CPO) backend. It’s the “how” of the hardware: Is the plug locked? What’s the current draw? Is the emergency stop triggered? It is a device-management protocol.
OCPI (Open Charge Point Interface) is the “who” and “how much” of the ecosystem. It lives in the cloud, facilitating the handshake between the CPO (the one who owns the charger) and the eMSP (the one who owns the customer relationship). If you are trying to enable a driver from Network A to use a charger on Network B, you aren’t touching OCPP. You are building an OCPI integration.
The trap is thinking you can build a custom API for every partner. You can’t. You’ll end up with a brittle, unscalable mess of webhooks and manual CSV reconciliations. OCPI provides the standardized schema for location discovery, token authorization, and—most importantly—the Charge Detail Record (CDR) clearinghouse process.
| Protocol | Primary Function | Communication Path | Key Data Exchange |
|---|---|---|---|
| OCPP | Hardware Management | Charger ↔ CPO Backend | Status, Meter Values, Firmware |
| OCPI | Roaming & Billing | CPO ↔ eMSP | Tokens, CDRs, Tariffs, Locations |
| ISO 15118 | Plug & Charge | EV ↔ Charger | Digital Certificates, Auth Data |
How does OCPI 2.2.1 actually handle smart charging?
This is where the magic happens. OCPI 2.2.1 isn’t just about “can I charge here?” It’s about “how efficiently can we charge here?”
The Smart Charging module in OCPI allows the eMSP to send a charging profile to the CPO. Imagine a scenario where a fleet manager needs to ensure a vehicle is charged to 80% by 7:00 AM, but the grid is currently under heavy load. Through OCPI, the eMSP can communicate a dynamic charging schedule. The CPO receives this profile and translates it into OCPP commands for the physical charger.
Furthermore, the dynamic Time-of-Use (ToU) tariff synchronization is a game changer. Instead of static pricing, OCPI allows the CPO to push real-time tariff updates to the eMSP. When your driver pulls up, the app shows the actual price, not a guess. This transparency is what builds trust, and trust is the only currency that matters in the transition to electric mobility.
What is the step-by-step path to implementing OCPI?
Don’t try to build the whole stack at once. Start with the “Roaming Basics” and move toward “Advanced Settlement.”
- Establish the Credential Handshake: Use the OCPI Credentials module to exchange tokens. This is your secure handshake. Without this, you’re just shouting into the void.
- Implement the Locations Module: This is your “Hello World.” Push your station data (GPS, connector types, power levels) to your roaming partner. If the data isn’t accurate, the rest of the protocol is useless.
- Enable the Tokens Module: This allows the eMSP to authorize their users on your network. You’ll need a robust validation logic to handle the
GET /tokensrequest. - Automate the CDR (Charge Detail Record) Pipeline: This is where you get paid. Ensure your system generates a standardized CDR after every session. Test the reconciliation process early—don’t wait until you have 10,000 sessions to find out your timestamps are misaligned.
- Integrate Smart Charging Profiles: Only once you have the billing and auth stable should you touch the Smart Charging module. It requires tight synchronization between your CPO backend and the physical charger’s OCPP capabilities.
How do I avoid the “Clearinghouse” trap?
You’ll hear vendors push you toward a “Clearinghouse” (like Hubject or Gireve). They’ll tell you it’s the only way to scale. They aren’t lying, but they are omitting the cost. A clearinghouse acts as a hub, simplifying the “many-to-many” connection problem into a “one-to-many” connection.
If you have the engineering resources, direct peer-to-peer OCPI connections are cheaper and provide more control. If you are a smaller operator, the clearinghouse is a necessary tax to reach scale quickly. My advice? Build your backend to be “OCPI-native” from day one. If you use a standardized library, switching from a direct connection to a clearinghouse later is just a configuration change, not a re-architecture.
Chapter 14: Forensic Analysis of OCPI Handshake Failures and Session Reconciliation
In the high-stakes environment of EV roaming, the Open Charge Point Interface (OCPI) protocol acts as the connective tissue between Charge Point Operators (CPOs) and e-Mobility Service Providers (eMSPs). However, when asynchronous session updates fail, the resulting financial discrepancies require a forensic approach to reconciliation. This chapter dissects the “Ghost Session” phenomenon—a failure state where the Session.last_updated timestamp drifts, causing orphaned CDRs (Charge Detail Records).
Forensic Case Study: The 403 Forbidden Reconciliation Loop
In a recent audit of a multi-national roaming hub, we encountered a recurring 403 Forbidden error during PATCH /sessions/{session_id} requests. The root cause was a mismatch in the authorization_id token validation between the CPO’s backend and the Clearing House. The CPO was sending a hashed SHA-256 token, while the eMSP expected a UUID v4 format.
The Calculation: If the drift in the total_cost field across 10,000 sessions averages €0.04 due to rounding errors in the tax_rate application (e.g., applying VAT before vs. after the roaming fee), the annual revenue leakage is calculated as follows:
Leakage = (Sessions_per_day * 365) * (Average_Drift)Leakage = (274 * 365) * 0.04 = €4,000.40 per EVSE per annum.
Diagnostic Playbook: Step-by-Step Implementation
- Log Extraction: Filter CPO logs for
HTTP 4xxand5xxstatus codes specifically targeting the/sessionsendpoint. - Payload Validation: Use a JSON schema validator to ensure the
cdr_tokenmatches theauth_idprovided in the initialAuthorizerequest. - State Synchronization: Execute a
GET /sessions?date_from=YYYY-MM-DDrequest to pull the full state and compare it against the local database using a Merkle tree hash to identify the exact session ID of the divergence. - Statutory Compliance: Ensure adherence to ISO 15118-20 requirements for Plug & Charge (PnC) security, specifically regarding the
ContractCertificateChainvalidation, which often triggers silent session drops if the OCSP responder is unreachable.
TLS 1.3 for all OCPI traffic. Legacy TLS 1.0/1.1 handshakes are frequently intercepted by corporate firewalls, causing the “Session Timeout” errors often misdiagnosed as protocol bugs.
Protocol Comparison: OCPI 2.1.1 vs. 2.2.1
| Feature | OCPI 2.1.1 | OCPI 2.2.1 |
|---|---|---|
| Smart Charging | Basic Profile (Static) | Advanced (Dynamic/Forecast) |
| PnC Support | None | Native (ISO 15118) |
| Session Security | Token-based | OAuth2 / Signed CDRs |
Frequently Asked Questions
Does OCPI replace the need for a mobile app?
No, OCPI is the backend glue. It allows the eMSP’s app to talk to the CPO’s network. The driver still uses an app, but they only need one—the one provided by their eMSP—to access chargers across multiple CPO networks.
Is OCPI secure enough for financial transactions?
OCPI relies on HTTPS/TLS for transport security and token-based authentication for API access. While it handles the data exchange for billing, the actual financial settlement (the movement of money) usually occurs through a separate clearinghouse or banking integration.
Can I use OCPI without a clearinghouse?
Yes. You can establish direct peer-to-peer OCPI connections with partners. This is ideal for large-scale roaming agreements between two major networks, as it eliminates intermediary fees, though it increases the complexity of managing multiple API endpoints.
For complete analysis of open charging protocols and commercial fleet charging interoperability, explore our teardown on Enphase Bidirectional EV Charger: V2H & V2G Setup.
