Guest organisation
OCPI
Learn reference
Guest organisation
OCPI
Learn reference

Stop the Session

By Abhishek Uniyal · Updated

Step 10 of 11

OCPI 2.2.1

Compare versions

The final OCPI Session update records completion of the charging session. In this local example the driver stops and the CPO updates the shared record.

What changes in OCPI 2.2.1
Modules in OCPI 2.2.1
Sessions
CDRs
Locations
Tariffs
Tokens
Commands
Credentials
Versions
Hub Client Info
Charging Profiles
Payments · extension
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.

Simulated copies · no peer is connected

CPO

Session COMPLETED.

eMSP

Session COMPLETED.

Which OCPI exchange does this action illustrate?

When the Session has finished, the CPO sends the change with PATCH and sets its status to COMPLETED, the final status of a Session. Sessions cannot be deleted.

Teaching example · request path

PATCH /sessions/{country_code}/{party_id}/{session_id}
Sources (4)
"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 Sessions module · #mod_sessions_push_model"Sessions cannot be deleted, final status of a session is: `COMPLETED`."OCPI 2.2.1 Sessions module · #mod_sessions_push_model"OCPI status code, as listed in Status Codes, indicates how the request was handled. To avoid confusion with HTTP codes, OCPI status codes consist of four digits."OCPI 2.2.1 Transport and format chapter · #transport_and_format_response_format1000: Generic success codeOCPI 2.2.1 Status codes chapter · #status_codes_1xxx_success

A Session records state, including ACTIVE before any energy has been transferred. The completed charge detail record supports billing; this example does not show a customer debit.

Sources (2)
ACTIVE: The session has been accepted and is active. All pre-conditions were met: Communication between EV and EVSE (for example: cable plugged in correctly), EV or driver is authorized. EV is being charged, or can be charged. Energy is, or is not, being transfered.OCPI 2.2.1 Sessions module · #mod_sessions_sessionstatus_enum"A *Charge Detail Record* is the description of a concluded charging session. The CDR is the only billing-relevant object."OCPI 2.2.1 CDRs module · #mod_cdrs_cdrs_module
Session definition · Read the Sessions reference