OCPI 2.2.1 arrived two years after OCPI 2.2, and the specification now marks 2.2 as deprecated with a blunt instruction: “do not use, use 2.2.1 instead”. The difference between OCPI 2.2 and 2.2.1 is short, but it is not the typo-fix release it is often described as. 2.2.1 made two CdrToken fields mandatory, changed the type of the signed meter data fields, and added 16 enum values (connector types, power types and an EVSE capability) that a strict validator will reject. Below is the complete list from the official changelog, the reason given for each change, and what to do about it on a 2.2 codebase.
For where both versions sit among the others, see the OCPI version history. This page covers only the step from 2.2 to 2.2.1. If you are building 2.2.1 from nothing rather than upgrading, the OCPI 2.2.1 implementation guide (coming soon) is the better starting point.
OCPI 2.2 vs 2.2.1: the complete change list
The changelog in the 2.2.1 specification rates every message-level change by expected impact and expected effort, separately for the eMSP and the CPO. The EVRoaming Foundation’s companion document, OCPI v2.2.1 changes with reason, adds why each one was made. Here are both in one table.
| Object | Change in 2.2.1 | Reason given | Impact eMSP / CPO | Effort eMSP / CPO |
|---|---|---|---|---|
| CdrToken (CDRs and Sessions) | country_code and party_id added, mandatory | With activation through remote commands, a token ID was no longer guaranteed unique | Minor / Minor | Minor / Major |
| SignedData | public_key changed from CiString to string | Base64 is case-sensitive; CiString is not | Major / Major | Minimal / Minimal |
| SignedValue | signed_data length 512 to 5000; plain_data, signed_data and url changed from CiString to string | Room to forward OCPP signed meter data for Eichrecht; base64 again | Major / Major | Minimal / Minimal |
| CdrLocation | postal_code made optional, state added | Not every address has a postal code or a state; matches Location | Minor / Minor | Minimal / Minimal |
| CDR | Optional home_charging_compensation flag | Marks energy cost to be reimbursed to an employee charging at home | Minor / Minor | Minimal / Minimal |
| StartSession | Optional connector_id | Lets a remote start name the connector | Minor / Minor | Medium / Minimal |
| EVSE Capability | START_SESSION_CONNECTOR_REQUIRED | Tells the eMSP that a remote start must name the connector | Minor / Minor | Medium / Minimal |
| ConnectorType | 13 values: NEMA, GB/T, ChaoJi, Domestic M, N and O | Better support for the American, Canadian and Asian markets | Minor / Minor | Minimal / Minimal |
| PowerType | AC_2_PHASE, AC_2_PHASE_SPLIT | Two-phase charge points | Minor / Minor | Minimal / Minimal |
| Status codes | 4000 generic hub error | There was no code for a generic hub error | Minor / Minor | Minimal / Minimal |
Beyond the table, the changelog lists “lots of typos fixed and textual improvements”, a datatype fix for the SignedData URL, and better descriptions and examples for the tariff step_size. That is the whole release: no new modules, no new roles, no change to authentication, endpoint URLs or transport.
The two changes that break a 2.2 implementation
Most of the list is additive. Two items are not, and the changelog’s own ratings point straight at them.
CdrToken now has to name the token’s owner
In 2.2, CdrToken carried uid, type and contract_id. 2.2.1 adds country_code (CiString(2)) and party_id (CiString(3)), both with cardinality 1, identifying the eMSP that owns the token. The Foundation’s reason: activation via remote commands “created a situation where it is possible that ID from a token was not unique anymore. Crucial change as more and more apps are used for charge activation.”
The CPO effort is rated Major because the data has to exist before the CDR is written. A Session object also carries a cdr_token, so the owner must be known from the moment a session starts, not reconstructed at billing time. The CPO usually has it: the Token object from the Tokens module carries country_code and party_id, and a StartSession command includes the full Token. The work is in the paths that only kept the uid, such as an authorization cache or a CSMS that stores the RFID number and nothing else. Every one of them has to carry the owner through to the Session and the CDR.
The 2021 PDF’s own examples lagged here. Adding country_code and party_id to the CdrToken examples is one of the fixes listed for the 2.2.1-d2 documentation revision, so test fixtures copied from the original 2.2.1 text are missing the fields that text made mandatory.
Signed meter data became case-sensitive
OCPI defines CiString as a “Case Insensitive String” of printable ASCII. In 2.2, the signed meter data fields public_key, plain_data, signed_data and url were all CiString. Base64 uses upper and lower case as different values, so a receiver that normalised case, compared case-insensitively or stored the value in a case-insensitive column could break a signature without throwing an error. 2.2.1 changes all four to string, which is case-sensitive.
It also raises signed_data from 512 to 5,000 characters, so a CDR can forward the signed meter data a charge point produces for Eichrecht. plain_data stayed at 512 in 2.2.1 and was only lengthened to 5,000 in OCPI 2.3.0 edition 2. Both sides are rated Major impact because a signed reading that no longer verifies is worthless as calibration-law evidence, even though the code change is small. Check the column type and length in your database, not only your JSON schema.
The additive changes, and the one that still bites
- CdrLocation addresses. OCPI 2.2 already gave Location a
statefield and an optionalpostal_code, but CdrLocation lagged behind. 2.2.1 aligns them, so a US or Canadian address can travel through a CDR without being stuffed into the city line. - Home charging compensation. When
home_charging_compensationistrue, the CDR is for a session on the driver’s home charger whose energy cost is paid back to the driver. For an eMSP that is an expense flow rather than an invoice line. - Choosing a connector on remote start. In OCPI, an EVSE can have several connectors, only one usable at a time. The spec explains the gap directly: charge points “that do not yet support OCPP 2.x” and have multiple connectors per EVSE leave the CPO unable to tell which connector to start. Such EVSEs carry
START_SESSION_CONNECTOR_REQUIRED, and the eMSP must then sendevse_uidandconnector_id. The eMSP effort is Medium because the driver’s app now has to offer a connector choice. The rest of the Commands module is unchanged. - The 4000 hub error. 2.2 had hub codes 4001 to 4003 (unknown receiver, timeout, connection problem) but no generic one. OCPI error responses covers how to handle the range.
The new enum values are the item that bites in production. These are the 2.2.1 additions:
ConnectorType: NEMA_5_20, NEMA_6_30, NEMA_6_50, NEMA_10_30, NEMA_10_50,
NEMA_14_30, NEMA_14_50, GBT_AC, GBT_DC, CHAOJI,
DOMESTIC_M, DOMESTIC_N, DOMESTIC_O
PowerType: AC_2_PHASE, AC_2_PHASE_SPLIT
Capability: START_SESSION_CONNECTOR_REQUIRED
2.2.1 enums are closed (open enums only arrive in 2.3.0), so on a 2.2.1 link you must accept every one of these. On a 2.2 link the reverse applies: a CPO serving both versions must not leak NEMA_14_50 or AC_2_PHASE_SPLIT to a partner whose 2.2 parser has never seen them. Map the value or leave the connector out of that feed, and log what you dropped. A validator that rejects unknown values outright is one of the classic OCPI integration pitfalls.
Documentation revisions: 2.2-d2 and 2.2.1-d2
A documentation revision (“d2”) is the same protocol version with better text. The spec is strict about it: a revision “can never change the content of the messages: no new fields or renaming of fields.”
- 2.2-d2 (12 June 2020) improved the text and examples, mostly in the Tariffs module, where
step_sizein particular “is better explained”. - 2.2.1-d2 (7 September 2023) did a lot of editing and rewriting of Tariffs and
step_size, clarified the Base64 encoding of the token in the Authorization header, allowed an eMSP to replace CPO-issued session IDs when exchanging charging profiles with an SCSP, removed a CDR rule that contradicted the rest of the module, and advised CPOs not to use physical hardware IDs asEVSE.uid.
step_size deserves its own note. It was reworked in 2.2, explained again in 2.2-d2, given new descriptions and examples in 2.2.1, rewritten in 2.2.1-d2, and had a broken example fixed in 2.3.0 edition 2. Five documents for one field tells you where partners disagree. If your tariff tests predate 2023, rerun them against the d2 text, and see how step_size interacts with each tariff dimension.
The practical upshot: read the 2.2.1-d2 PDF, not the 2021 one. The OCPI version history links both.
What 2.2.1 did not add
2.2.1 replaced 2.2 so quickly that it often gets credit for 2.2’s work. All of the following arrived in OCPI 2.2 (September 2019), and none changed in 2.2.1:
- Hub support, the
OCPI-to-andOCPI-from-routing headers and the HubClientInfo module - The roles list in Credentials and the NAP, NSP and SCSP roles
- The ChargingProfiles module and charging preferences
signed_dataon CDRs, credit CDRs and the per-dimension cost totals- The
publishflag on Location
If a summary credits 2.2.1 with hubs or smart charging, it is describing 2.2. The 2.1.1 to 2.2 migration guide covers those changes.
Can a 2.2 partner and a 2.2.1 partner talk to each other?
Only through a version both sides list. The VersionNumber list has separate entries for “2.2” and “2.2.1”, and two parties connect on a version that appears on both of their Versions endpoints. A platform that serves only 2.2.1 has nothing in common with a partner that serves only 2.2.
So the upgrade is additive at the endpoint level. Add /2.2.1/ next to /2.2/, keep sending 2.2-shaped messages on the old path, and move each connection when its partner is ready. Moving an existing connection is a PUT to the partner’s credentials endpoint for the new version, after which the partner fetches your 2.2.1 endpoints. Read a partner’s Versions endpoint before assuming what they speak. It takes two minutes and beats any assumption.
OCPI 2.2.1 implementation checklist for a 2.2 codebase
- Carry the token owner end to end. Store
country_codeandparty_idwith every authorization, and populate them on CdrToken in both Sessions and CDRs. - Fix signed data storage. Case-sensitive columns,
signed_dataup to 5,000 characters,public_key,plain_dataandurlas plain strings, and no trimming or case normalisation anywhere in the path. - Update CdrLocation. Add
stateand allow a missingpostal_code. - Widen enum handling. Accept the 13 ConnectorType values, the 2 PowerType values and the new Capability on 2.2.1 links; map or omit them on 2.2 links.
- Support connector selection. CPO: set
START_SESSION_CONNECTOR_REQUIREDon EVSEs backed by multi-connector OCPP 1.x charge points, and routeconnector_idto the right connector. eMSP: when the capability is present, sendevse_uidandconnector_id. - Route home charging CDRs. eMSP: decide what happens to a CDR flagged
home_charging_compensation. - Handle
4000from hubs alongside 4001 to 4003. - Rerun tariff tests against the 2.2.1-d2
step_sizetext. - Advertise 2.2.1 next to 2.2, prove it with one partner, switch connections one at a time, and retire 2.2 when the last partner has moved.
The tests that matter: a CDR round trip with the CdrToken owner fields populated, a signed value with mixed-case base64 that comes back byte for byte, a StartSession carrying connector_id, and a Location containing NEMA_14_50 and AC_2_PHASE_SPLIT that your 2.2.1 receiver accepts. OCPI testing tools lists what you can test against. This checklist covers only the delta from 2.2; for a full build, see the OCPI 2.2.1 implementation guide (coming soon).
Starting a 2.2.1 implementation from scratch
The checklist above assumes a working 2.2 codebase. If you are building OCPI 2.2.1 from nothing, start with the credentials and versions handshake: no other module can be called until the two parties have registered with each other. After that, the modules you build depend on your role.
- As a CPO you publish Locations, Tariffs, Sessions and CDRs, and you receive Tokens and Commands from the eMSP.
- As an eMSP you publish Tokens and send Commands, and you receive the CPO’s Locations, Tariffs, Sessions and CDRs.
Build CDRs to the 2.2.1 rules from the first day, including the CdrToken owner fields described above, so there is nothing to migrate later. Testing an OCPI connection covers how to prove each module before a partner goes live, and the common integration pitfalls are worth reading before you connect the first one.
Should you upgrade from 2.2 to 2.2.1?
Yes, and treat it as a scheduled release rather than an optional one. The specification marks 2.2 as deprecated, and the Foundation states that “v2.2 will not be supported anymore”. The cost is bounded: by the changelog’s own ratings, only the CdrToken change is Major effort, and only for the CPO. Everything else is Minimal or Medium.
If you are starting fresh, there is no case for 2.2 at all. Build 2.2.1, then look at what OCPI 2.3.0 adds. That step is bigger: it reshapes the Price object for multi-level taxes and changes how hubs identify themselves.
The honest summary
The third digit made 2.2.1 sound safe, and the changelog says otherwise. It is the only place the spec rates its own changes, and in 2.2.1 it flags signed data as Major impact for both parties and the CdrToken owner fields as Major effort for the CPO. Neither shows up if you skim a “what’s new” list.
There are two lessons for every later OCPI release. On the receive path, be tolerant: log unknown enum values instead of rejecting the message. On the send path, never assume a point release only adds optional fields. Read the changelog’s impact columns before the version number, because that is where the spec tells you what it expects you to rebuild.