Guest organisation
OCPI
Learn reference
Guest organisation
OCPI
Learn reference

Send the CDR

By Abhishek Uniyal · Updated

Step 11 of 11

OCPI 2.2.1

Compare versions

An OCPI charge detail record, or CDR, describes a charge for billing. This local example shows the CPO sending it to the eMSP after the Session completes.

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. CDR sent.

eMSP

CDR received for billing.

Which OCPI exchange does this action illustrate?

The CPO pushes the new CDR to the eMSP's CDRs endpoint with POST. The eMSP answers with a Location header holding the URL of the new CDR. A CDR cannot be changed once it is sent.

Teaching example · request path

POST /cdrs
Sources (3)
"When the CPO creates CDR(s) they push them to the relevant eMSP by calling POST on the eMSPs CDRs endpoint with the newly created CDR(s)."OCPI 2.2.1 CDRs module · #mod_cdrs_push_model"The response should contain the URL to the just created CDR object in the eMSP's system."OCPI 2.2.1 CDRs module · #mod_cdrs_response_headers"Because a CDR is for billing purposes, it cannot be changed or replaced once sent to the eMSP. Changes are simply not allowed."OCPI 2.2.1 CDRs module · #mod_cdrs_flow_and_lifecycle

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
Test this flow

Test this flow runs against an eMSP endpoint you have registered. The endpoint test grades your endpoint's answer to each Session push. It does not read the stored Session back.