Send a Session update

OCPI 2.2.1 and 2.3.0

Read this step for OCPI 2.1.1

In OCPI 2.2.1 and 2.3.0 the CPO sends every change to a Session it already pushed by calling PATCH on the eMSP's Sessions endpoint. Only the fields that need to be updated have to be present, and any field it does not specify is considered unchanged. Every PATCH request SHALL contain last_updated.

"Any changes to a Session in the CPO system are sent to the eMSP system by calling PATCH on the eMSP's Sessions endpoint with the updated Session object."OCPI 2.2.1 and 2.3.0 Sessions module · #mod_sessions_push_model"Same as the PUT method, but only the fields/objects that need to be updated have to be present. Fields/objects which are not specified are considered unchanged."OCPI 2.2.1 and 2.3.0 Sessions module · #mod_sessions_patch_method"Any request to the PATCH method SHALL contain the `last_updated` field."OCPI 2.2.1 and 2.3.0 Sessions module · #mod_sessions_patch_method

Sandbox run · OCPI 2.2.1

Run this exchange in the sandbox

Sandbox fault · OCPI 2.2.1

See one rule fail in the sandbox

The eMSP returns a Session without its id

The sandbox eMSP can answer one Session GET with the id removed. The check sessions-get-002 sends that GET and reads the answer. Read the Session back as it is, then remove the id.

"|id |CiString(36) |1 |The unique id that identifies the charging session in the CPO platform."OCPI 2.2.1 Sessions module · #mod_sessions_session_object

The CPO sends a PATCH without last_updated

The run pushes a Session to the sandbox eMSP, then sends one PATCH that carries kwh and no last_updated. The rule binds the sender, so the finding is the sender's. How the eMSP answers is shown as an observation, not a verdict.

"Any request to the PATCH method SHALL contain the `last_updated` field."OCPI 2.2.1 Sessions module · #mod_sessions_patch_method

When a PATCH omits charging_periods or sends an empty list, the eMSP SHALL keep its existing charging periods.

"If the request `charging_periods` list is omitted (or contains an empty list), no changes SHALL be made to the existing list of `charging_periods`."OCPI 2.2.1 and 2.3.0 Sessions module · #mod_sessions_patch_method

Sessions cannot be deleted. The final status of a Session is COMPLETED.

"Sessions cannot be deleted, final status of a session is: `COMPLETED`."OCPI 2.2.1 and 2.3.0 Sessions module · #mod_sessions_push_model
What OCPI 2.2.1 defines for this lesson
Modules in this version
Locations
Sessions
CDRs
Tariffs
Tokens
Commands
Credentials
Hub Client Info
Charging Profiles
Payments
Bookings
Advertised sender and receiver interfaces

An endpoint declares how another platform can pull or push data. Credentials uses the same interface for both roles.

The header token is encoded

The request header carries an encoded token; the Credentials body still carries the raw token.

Billing records name the Token owner

A charge record names the country and company that own the driver's Token.