OCPI sample messages

OCPI (Open Charge Point Interface) is how two backends roam. A CPO publishes locations and sessions. An eMSP publishes tokens and can send START_SESSION. Traffic is HTTPS + JSON, not a WebSocket to a charger.

The EVRoaming Foundation maintains it. Current official release is OCPI 2.2.1-d2. 2.3.0 shipped 21 February 2025 (AFIR NAP fields, US tax levels, direct payment). All official downloads. OpenAPI: 2.2.1.

Chargeflux does not speak OCPI yet. After an eMSP sends START_SESSION, the CPO's CSMS still has to talk OCPP to the hardware — that hop you can run in the simulator. Differences: OCPI vs OCPP.

When each module is used

ModuleTypical directionTrigger
Versions / CredentialsBothFirst handshake: which version, exchange tokens
LocationsCPO → eMSPA site, EVSE, or connector is added or changes
TokenseMSP → CPOA driver card or app token should be accepted
CommandseMSP → CPOSTART_SESSION, STOP_SESSION, RESERVE_NOW, UNLOCK_CONNECTOR
SessionsCPO → eMSPA charge is live; PATCH as energy updates
CDRsCPO → eMSPSession ended; billable record

Credentials (handshake)

After GET /ocpi/versions, each side POSTs credentials so later calls can use the token. Trigger: you are pairing two platforms for the first time.

POST /ocpi/2.2.1/credentials
JSON{
  "token": "CPO-token-for-emsp",
  "url": "https://cpo.example.com/ocpi/versions",
  "roles": [
    {
      "role": "CPO",
      "party_id": "CFL",
      "country_code": "NL",
      "business_details": {
        "name": "Chargeflux Demo CPO"
      }
    }
  ]
}

Locations

Trigger: a new site, or an EVSE goes inoperative. The CPO PUTs (or PATCHes) the object to the eMSP.

PUT /ocpi/2.2.1/locations/NL/CFL/LOC1
JSON{
  "country_code": "NL",
  "party_id": "CFL",
  "id": "LOC1",
  "publish": true,
  "name": "Demo depot",
  "address": "1 Harbour Way",
  "city": "Rotterdam",
  "postal_code": "3011AA",
  "country": "NLD",
  "coordinates": {
    "latitude": "51.9225",
    "longitude": "4.47917"
  },
  "evses": [
    {
      "uid": "NL-CFL-E1",
      "evse_id": "NL*CFL*E1",
      "status": "AVAILABLE",
      "connectors": [
        {
          "id": "1",
          "standard": "IEC_62196_T2",
          "format": "SOCKET",
          "power_type": "AC_3_PHASE",
          "max_voltage": 400,
          "max_amperage": 32
        }
      ]
    }
  ],
  "last_updated": "2026-08-14T10:00:00Z"
}

Sessions and CDRs

Sessions update while energy flows. A CDR is posted when the session is finished. Both are CPO → eMSP. The kwh here should match what OCPP MeterValues / StopTransaction (or TransactionEvent) already told the CPO.

PUT /ocpi/2.2.1/sessions/NL/CFL/SES-1001
JSON{
  "country_code": "NL",
  "party_id": "CFL",
  "id": "SES-1001",
  "start_date_time": "2026-08-14T10:16:01Z",
  "kwh": 1.85,
  "cdr_token": {
    "uid": "TAG-1001",
    "type": "RFID",
    "contract_id": "NL-EMS-C0001"
  },
  "auth_method": "WHITELIST",
  "location_id": "LOC1",
  "evse_uid": "NL-CFL-E1",
  "connector_id": "1",
  "currency": "EUR",
  "status": "ACTIVE",
  "last_updated": "2026-08-14T10:17:01Z"
}

Commands

START_SESSION is the roaming equivalent of an app start. The CPO then sends RemoteStartTransaction (1.6) or RequestStartTransaction (2.0.1) to the charger. Samples: OCPI commands.

More

FAQ

What is OCPI?

Open Charge Point Interface. REST/JSON between a CPO (the network that owns chargers) and an eMSP (the network the driver belongs to). It is not the charger protocol — that is OCPP.

Where is the official OCPI specification?

The EVRoaming Foundation publishes it. The current official release is 2.2.1-d2. 2.3.0 is also available. Download both from evroaming.org.

Does Chargeflux simulate OCPI?

Not yet. OCPI is on the public roadmap as exploring. The OCPP simulator covers the charger-to-CSMS hop that usually follows an OCPI START_SESSION.

Last reviewed August 2026 · Chargeflux.io