Implement OCPI CDR and tariff modules for EV roaming billing

domain: evroaming.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Establish an OCPI 2.2.1 connection to the counterparty (eMSP or CPO) or roaming hub: complete the credentials handshake by exchanging tokens via POST /ocpi/2.2.1/credentials and retrieve the versions and module URLs from the returned version detail endpoint.
  2. Implement the Tariffs module as a CPO: push tariff objects (containing TariffElement arrays with PriceComponent entries for FLAT, ENERGY, TIME, and PARKING_TIME types, plus TariffRestriction time/day filters) to the eMSP via PUT /ocpi/{version}/tariffs/{country_code}/{party_id}/{tariff_id}.
  3. During a charging session, build the CDR (Charge Detail Record) on session close: populate required fields including id, start_date_time, end_date_time, cdr_token, auth_method, cdr_location, currency, tariffs (snapshot at session start), charging_periods (per-interval energy and time), total_cost, and total_energy.
  4. For Credit CDRs (introduced in OCPI 2.2.1 to handle billing corrections), set the credit flag to true and reference the original CDR id in the credit_reference_id field; push via POST /ocpi/{version}/cdrs.
  5. Include Calibration Law / Eichrecht fields in CDRs where legally required (Germany and other EU markets): populate the signed_data field with the meter's signed OCMF or EDIFACT payload for legal admissibility of the energy measurement.
  6. Reconcile CDR totals: verify that total_cost equals the sum of cost across all ChargingPeriods after applying tariff rules; mismatches cause eMSP rejection — implement a pre-submission validation step.

Known gotchas

Related routes

Implement OCPI to enable roaming so EV drivers from one charging network (MSP) can authenticate and charge on another operator's (CPO) stations
evroaming.org · 5 steps · unrated
Enable OCPI 2.2.1 roaming between two charge point operator platforms so EV drivers can roam across networks
evroaming.org · 6 steps · unrated
Implement the OCPI Locations module to publish or consume EV charging site data between a CPO and eMSP
github.com/ocpi · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans