Roaming & OCPI

OCPI Testing Before Go-Live: How a CPO and an eMSP Prove a Roaming Connection Works

By YoHub12 min read

OCPI testing between CPO and eMSP networks before roaming go-live

💡 OCPI Testing: Key Highlights

  • OCPI testing validates every module in the roaming chain: Credentials, Locations, Tariffs, Tokens, Commands, Sessions and CDRs, each with its own pass criteria.
  • Live test sessions on real chargers must cover edge cases: app-initiated and charger-side stops, offline EVSEs, sessions crossing midnight, and zero-energy sessions.
  • CDR and invoice dry-runs confirm that totals match the published tariff before any driver uses the connection.
  • Hub-based testing reduces effort: test once against the hub, then run per-partner smoke tests instead of full bilateral test cycles.
  • The EVRoaming Foundation offers a cloud-based test tool supporting both OCPI 2.2.1 and 2.3.0 conformance testing.

OCPI testing is the process that proves a roaming connection actually works before a single driver depends on it. When a charge point operator (CPO) and an e-mobility service provider (eMSP) connect over OCPI 2.2.1, they exchange station data, authorise tokens, start and stop sessions remotely, and settle through charge detail records (CDRs). Each of those steps involves a distinct OCPI module, and each module can fail independently. A credentials handshake that succeeds does not mean Locations will sync correctly; a Locations sync that works does not guarantee that a remote start command will reach the charger within its timeout.

This post is a practical test plan. It walks through the stages an integration team runs to sign off a roaming connection: the credentials handshake, module-by-module verification, live charging sessions with deliberate edge cases, a CDR and invoice dry-run, and the monitoring checks that continue after go-live. It also explains how the testing workflow differs when both parties connect through a roaming hub rather than directly.

Stage 1: Credentials and Version Handshake

Every OCPI connection begins with the Credentials module. Before any operational data flows, the two parties (or a party and a hub) must agree on which OCPI version they will use, exchange endpoint URLs, and trade authentication tokens. This is the registration sequence defined in the OCPI 2.2.1 specification, and it is the first thing to test.

What to verify

  • Version negotiation: Both sides expose a Versions endpoint listing every OCPI version they support. The initiating party picks the highest mutually supported version. Confirm the response lists the correct version (2.2.1) and that endpoint URLs resolve.
  • Credentials exchange (POST/PUT): The initiating party sends its credentials object (token, URL, roles, party_id, country_code). The receiving party responds with its own credentials. Verify that both sides store the returned token and use it in every subsequent request’s Authorization header.
  • Role declaration: Each party’s CredentialsRole lists its country_code, party_id, and role (CPO, EMSP, HUB, NSP). Confirm the roles match the agreed business relationship.
  • Error cases: Send a request with an expired or invalid token and confirm the response is HTTP 401. Send a credentials POST to a party that is already registered and confirm the expected error.

Pass criteria: both parties hold valid, mutually authenticated tokens, agree on OCPI 2.2.1, and can reach each other’s module endpoints. If the handshake fails, nothing downstream is testable.

Stage 2: Module-by-Module OCPI Test Cases

With credentials in place, test each module the connection will use in production. Not every connection uses every module, but a full roaming link typically needs Locations, Tariffs, Tokens, Commands, Sessions and CDRs. Test them in this dependency order: a Commands test requires Tokens to be working; a Sessions test requires a successful Command; a CDR test requires a completed Session.

Locations

The CPO publishes its charging locations (Location, EVSE, Connector objects). The eMSP (or hub) pulls or receives push updates. Verify that static data (address, coordinates, operator name, connector types and power) arrives correctly and that dynamic EVSE status updates (Available, Charging, OutOfOrder) propagate within the agreed interval. Check that an EVSE set to OutOfOrder on the CPO side reflects on the eMSP side, and that returning it to Available also propagates.

Tariffs

The CPO publishes tariff objects with price components (ENERGY, TIME, PARKING_TIME, FLAT), step sizes and any restrictions (time-of-day, power range). The eMSP pulls these and displays them to the driver. Verify that the eMSP’s displayed price matches the CPO’s published tariff for a given connector, and that a mid-test tariff update propagates correctly. For a deeper treatment of tariff modelling, see our post on OCPI tariffs.

Tokens

The eMSP provides token objects (RFID UIDs, app-user tokens) to the CPO, either by push or pull. The CPO uses these to authorise charging sessions. Test both whitelist authorisation (the CPO has the token cached locally, whitelist_type ALWAYS or ALLOWED) and real-time authorisation (the CPO sends a POST to the eMSP’s authorize endpoint and waits for a response). Confirm that a revoked or blocked token is correctly rejected. For the full token lifecycle, see our post on OCPI tokens in practice.

Commands

The eMSP sends START_SESSION and STOP_SESSION commands to the CPO via the Commands module. Test that a START_SESSION command with a valid token and Location/EVSE reference reaches the charger and begins a session. Test STOP_SESSION and confirm the session ends. Also test the timeout: the OCPI 2.2.1 specification defines that the receiving party must respond to a command within a set time; if it does not, the sender treats it as failed. Force a timeout by targeting a charger that is offline and verify the eMSP handles the failure correctly.

Sessions

While a charging session is active, the CPO pushes Session objects to the eMSP with running totals (kWh delivered, cost so far, session status). Verify that the eMSP receives these updates, that the kWh and cost increment correctly, and that the session status transitions through ACTIVE to COMPLETED match the charger’s actual state.

CDRs

After a session completes, the CPO generates a CDR. This is the billing record. Verify that the CDR’s total energy matches the charger’s meter reading, that the total cost matches the published tariff applied to that energy and time, and that the party IDs (CPO, eMSP), token reference and location reference are all correct. A CDR where the total does not match the tariff calculation is a reconciliation problem waiting to happen. For the full taxonomy of CDR mismatches, see our post on CDR reconciliation.

Stage 3: Live Test Sessions on Real Chargers

Module-level tests confirm the APIs work. Live test sessions confirm the full chain works end to end, including the physical charger, the CPO’s backend, the OCPI link, and the eMSP’s app. Run these on real hardware, not just in a sandbox, because charger firmware behaviour, network latency and timeout handling are only visible on live equipment.

Standard test session

Start a session from the eMSP app (remote start via Commands), charge for a known duration, stop from the app (remote stop). Confirm: session started within the expected time, kWh and cost updated in real time via the Sessions module, session stopped cleanly, CDR generated with correct totals, and the eMSP’s transaction record matches the CDR.

Edge cases to cover

  • Stop from the charger (not the app): The driver unplugs or presses stop at the EVSE. Confirm the CPO’s backend detects the stop, generates a CDR, and pushes it to the eMSP even though the stop did not originate from a STOP_SESSION command.
  • Offline charger: Attempt a remote start on a charger that is unreachable. Confirm the command times out, the eMSP receives a failure response, and no phantom session is created.
  • Session across midnight: Start a session before 00:00 and end it after. Confirm the CDR’s start and end timestamps, duration and energy are correct across the day boundary, and that any time-of-day tariff restrictions apply correctly to the split periods.
  • Zero-energy session: Start a session and stop it immediately (or the charger fails to deliver energy). Confirm a CDR is generated with zero kWh and an appropriate total (some tariffs include a flat fee; others produce a zero-cost CDR). Both sides must handle this gracefully rather than dropping the record.

Each edge case tests a specific failure mode that, if unhandled, produces a reconciliation dispute in production. It is cheaper to find them in a test session than in a month-end invoice.

Stage 4: CDR and Invoice Dry-Run

After the live test sessions, both sides have a small set of CDRs. Use them as the basis for an invoice dry-run: the CPO (or the hub, in a hub-settlement model) generates a draft invoice from the test CDRs, and the eMSP reconciles it against its own records.

What to check

  • Every test session has a corresponding CDR on both sides (no missing records).
  • The CDR totals (energy, cost) match between the CPO’s records and the eMSP’s records.
  • The invoice total equals the sum of CDR costs, with the correct tax treatment (e.g. GST-inclusive or exclusive in India, VAT in the UAE).
  • Party IDs on the CDRs correctly attribute each session to the right operator and service provider.
  • The zero-energy and midnight-crossing CDRs from Stage 3 are included and handled correctly in the invoice.

This dry-run catches the structural reconciliation problems (unit mismatches, missing records, tariff version drift) that would otherwise surface on the first real invoice. For a detailed breakdown of why CDRs disagree and how to fix them, see our post on CDR reconciliation.

Stage 5: Post-Go-Live Monitoring

Passing the test plan means the connection is ready for drivers. But OCPI testing does not end at go-live. The first weeks of production traffic will expose problems that controlled test sessions cannot: stale EVSE status, authorisation failures under load, and CDR delivery latency at scale.

Metrics to monitor

  • EVSE status accuracy: Compare the status shown to the eMSP’s driver with the charger’s actual state. A charger that shows Available but is physically occupied (or vice versa) erodes driver trust quickly.
  • Authorisation success rate: Track the percentage of real-time authorisation requests that return ALLOWED versus REJECTED or timed out. A sudden drop signals a token sync issue or a backend change.
  • CDR delivery latency: Measure the time between session end and CDR receipt on the eMSP side. A growing delay means the CPO’s CDR pipeline is backing up, which delays invoicing.
  • Reconciliation gap: At the end of each day or week, count sessions that have no matching CDR. Even a small gap rate compounds over time.

Define thresholds for each metric before go-live, and agree on an escalation path when a threshold is breached. The test plan is the connection’s quality gate; post-go-live monitoring is its quality floor.

How OCPI Testing Differs Through a Hub

In a bilateral connection, the CPO and eMSP test directly with each other. Every new partner means a full test cycle. In a hub-based connection, the testing model changes.

When a party connects to a roaming hub, it runs the full OCPI testing cycle once against the hub: credentials, all modules, live sessions, CDR dry-run. The hub has already tested the same cycle with the partners on the other side. So when the eMSP goes live, it reaches every CPO on the hub without repeating the full cycle per CPO.

That said, per-partner smoke tests are still necessary. A short check per new partner (a few live test sessions, CDR comparison, Locations check) confirms that the specific partner’s data is correct: their Locations are populated, their tariffs are published, and a session on their charger produces a matching CDR. This is a fraction of the work of a full bilateral test cycle, but it is not zero. For more on the hub versus bilateral trade-off, see our post on OCPI bilateral connections.

YoHub, as an OCPI 2.2.1 roaming platform, provides a test environment where CPOs and eMSPs can run this cycle before going live on the production hub. The CPO and eMSP integration guides on the platform cover the specifics.

Formal OCPI Conformance Testing

Beyond the go-live test plan between specific partners, the EVRoaming Foundation (the organisation that maintains the OCPI specification) publishes a cloud-based tool, the EVRoaming Test Tool (EVRTT), designed to check the compliance of an OCPI implementation. As of November 2026, the EVRTT supports both OCPI 2.2.1 and OCPI 2.3.0 conformance testing, with separate test-case suites for the NAP (National Access Point) extension and tariff simplification.

The Foundation offers a conformance approval process: a test run plus a conformance proof report, priced per role and per test profile. This is distinct from the partner-to-partner go-live testing described above. The EVRTT validates that your implementation conforms to the specification itself, while go-live testing validates that the two specific implementations work together in practice. Both are valuable; neither replaces the other.

Note: OCPI conformance testing and certification is an evolving area. The EVRoaming Foundation has described OCPI 2.3.0 conformance tests and certification processes as available, while OCPI 3.0 is still in development. Check the Foundation’s downloads page for the latest status.

Frequently Asked Questions

OCPI testing is the process of verifying that an OCPI roaming connection between a CPO and an eMSP works correctly across every module: Credentials, Locations, Tariffs, Tokens, Commands, Sessions and CDRs. It matters because a connection that passes the credentials handshake may still fail on token authorisation, remote commands or CDR totals. Without testing, the first failures appear when real drivers try to charge, which damages trust and creates billing disputes.

There is no fixed number prescribed by the OCPI specification. At minimum, run enough sessions to cover the standard flow (remote start, charge, remote stop) plus the key edge cases: charger-side stop, offline charger, midnight-crossing session and zero-energy session. For a bilateral connection, this typically means five to ten sessions across different charger types and locations. Through a hub, the initial full test is similar, with shorter per-partner smoke tests afterward.

No. A hub reduces the effort: you run the full OCPI test cycle once against the hub instead of once per partner. But per-partner smoke tests (a few live sessions, CDR comparison, Locations check) are still necessary to confirm that each specific partner’s data, tariffs and charger behaviour are correct. The hub validates protocol compliance; the smoke test validates the partner’s operational data.

OCPI conformance testing, as offered by the EVRoaming Foundation through its EVRoaming Test Tool, validates that your OCPI implementation conforms to the specification. Go-live testing validates that two specific implementations (yours and your partner’s, or yours and the hub’s) work together in practice, including live charger behaviour, real token authorisation, and correct CDR generation. Conformance testing is about the protocol; go-live testing is about the operational connection.

No. OCPP (Open Charge Point Protocol) governs the connection between a charger and its charging management system (CMS). OCPI governs the connection between a CPO’s backend and an eMSP’s backend for roaming. OCPP testing verifies that a charger communicates correctly with its CMS; OCPI testing verifies that two roaming backends exchange data, authorisations, sessions and billing records correctly. They are different layers of the charging stack.

Sources: OCPI 2.2.1-d2 Specification — EVRoaming Foundation | EVRoaming Test Tool — EVRoaming Foundation | OCPI Background — EVRoaming Foundation

Researched and drafted with AI assistance; facts checked against the sources linked above and reviewed by the YoHub team.

Ready to Test Your Roaming Connection?

YoHub provides a test environment for CPOs and eMSPs to validate their OCPI integration before going live.

Explore the Developer Docs

Keep reading

More from the YoHub blog

Connect once. Reach every network.

Book a 45-minute call with the team that runs the platform. We'll map your integration and show you the network live.

Scroll to Top