Finishing the charging session

Intermediate

OCPI 2.1.1

Compare this step across versions

Stopping the charge, completing the Session and sending the charge detail record the eMSP bills from.

What happens when you're done charging?

What You'll Learn:
  • How the CPO marks the Session COMPLETED
  • How the CPO sends the charge detail record (CDR)
  • What the eMSP answers
The Players in This Lesson:
CPO
CPO
eMSP
EMSP
Message Flow:
Step 0 of 2
CPO

PATCH /sessions/{country_code}/{party_id}/{session_id}

eMSP

Message: Session update: status COMPLETED

Details: 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.

"Any changes to a Session in the CPO system are sent to the eMSP system by calling PATCH on the eMSPs Sessions endpoint with the updated Session object."OCPI 2.1.1 Sessions module · #11-push-model"Sessions cannot be deleted, final status of a session is: `COMPLETED`."OCPI 2.1.1 Sessions module · #11-push-model"Response code, as listed in Status Codes, indicates how the request was handled. To avoid confusion with HTTP codes, at least four digits are used."OCPI 2.1.1 Transport and format chapter · #response-format"|1000 |Generic success code"OCPI 2.1.1 Status codes chapter · #1xxx-success
What OCPI 2.1.1 defines for this lesson
Modules in this version
Locations
Sessions
CDRs
Tariffs
Tokens
Commands
Credentials
Hub Client Info
Charging Profiles
Payments
Bookings
No advertised interface-role field

Endpoint descriptions name the module and URL without an interface-role field.

The header carries the token value

The request header carries the shared credentials token value.

Session ID uses case-sensitive text

The Session ID uses text whose letter case matters.