OCPI Roaming
OCPI (Open Charge Point Interface) is the REST API that lets CPOs and eMSPs exchange locations, sessions, CDRs, tariffs, and tokens for roaming. The emulator can play either side so you can validate interoperability without a live roaming partner.
Roles
- CPO (Charge Point Operator) — exposes
locations, pushessessionsandCDRs, and authorizestokens. - eMSP (e-Mobility Service Provider) — consumes locations, issues tokens, and receives session and CDR updates.
The credentials handshake
Roaming starts with a credentials exchange. Each party registers its versions
endpoint and swaps tokens:
- Partner A sends its token and
versionsURL to Partner B'scredentials. - Partner B fetches versions, picks one, and replies with its own credentials.
- Both sides now hold the tokens needed to call each other's modules.
Core modules
| Module | Direction | Purpose |
|---|---|---|
| Locations | CPO → eMSP | Where chargers are and their status |
| Sessions | CPO → eMSP | Live charging session updates |
| CDRs | CPO → eMSP | Final billing records |
| Tariffs | CPO → eMSP | Pricing |
| Tokens | eMSP → CPO | Authorization identifiers |
| Commands | eMSP → CPO | Remote start/stop, reserve |
Versions
The emulator supports both OCPI 2.1.1 (alpha-3 country codes, no hub) and 2.2.1 (alpha-2 + party_id, hub, charging profiles), so you can test against whichever your partner runs.
Go deeper
- OCPI 2.1.1 Modules — the full 2.1.1 specification, one page per module (Locations, Sessions, CDRs, Tariffs, Tokens, Commands, Credentials, and more).
- OCPI 2.2.1 Examples — real example payloads by object type (Locations, Sessions, CDRs, Tariffs, Tokens, Credentials, Versions).