Learning Hub/Scenarios
Explanations use OCPI 2.2.1. Physical and billing-system events are authored examples.

Home eMSP bills the CDR from abroad

Technical
5 min
OCPI 2.1.1, 2.2.1 and 2.3.0
Home eMSP bills the CDR from abroad

The driver unplugs and drives on. The CPO completes the Session and sends a CDR, again under NL and FPN, to the German eMSP, which bills the driver on the home contract.

Sandbox run · OCPI 2.2.1

Run this exchange in the sandbox

CPO
EMSP
"A *Charge Detail Record* is the description of a concluded charging session. The CDR is the only billing-relevant object. CDRs are sent from the CPO to the eMSP after the charging session has ended. Although there is no requirement to send CDRs in (semi-) realtime, it is seen as good practice to send them as soon as possible. But if there is an agreement between parties to send them, for example, once a month, that is also allowed by OCPI."OCPI 2.2.1 CDRs module · #mod_cdrs_cdrs_module"CDRs are created by the CPO. They most likely will be sent only to the eMSP that needs to pay the bill of the underlying charging session. Because a CDR is for billing purposes, it cannot be changed or replaced once sent to the eMSP. Changes are simply not allowed. Instead, a Credit CDR can be sent. CDRs may be sent for charging locations that have not been published via the Location module. This is typically for home chargers."OCPI 2.2.1 CDRs module · #mod_cdrs_flow_and_lifecycle"|country_code |CiString(2) |1 |ISO-3166 alpha-2 country code of the CPO that 'owns' this CDR. |party_id |CiString(3) |1 |ID of the CPO that 'owns' this CDR (following the ISO-15118 standard). |id |CiString(39) |1 |Uniquely identifies the CDR, the ID SHALL be unique per `country_code`/`party_id` combination. This field is longer than the usual 36 characters to allow for credit CDRs to have something appended to the original ID. Normal (non-credit) CDRs SHALL only have an ID with a maximum length of 36. |start_date_time |DateTime |1 |Start timestamp of the charging session, or in-case of a reservation (before the start of a session) the start of the reservation. |end_date_time |DateTime |1 |The timestamp when the session was completed/finished, charging might have finished before the session ends, for example: EV is full, but parking cost also has to be paid. |session_id |CiString(36) |? |Unique ID of the Session for which this CDR is sent. Is only allowed to be omitted when the CPO has not implemented the Sessions module or this CDR is the result of a reservation that never became a charging session, thus no OCPI Session. |cdr_token |CdrToken |1 |Token used to start this charging session, including all the relevant information to identify the unique token. |auth_method |AuthMethod |1 |Method used for authentication. Multiple <mod_cdrs_authmethod_enum,AuthMethods>> are possible during a charging sessions, for example when the session was started with a reservation: ReserveNow: `COMMAND`. When the driver arrives and starts charging using a Token that is whitelisted: `WHITELIST`. The last method SHALL be used in the CDR. |authorization_reference |CiString(36) |? |Reference to the authorization given by the eMSP. When the eMSP provided an `authorization_reference` in either: real-time authorization, StartSession or ReserveNow, this field SHALL contain the same value. When different `authorization_reference` values have been given by the eMSP that are relevant to this Session, the last given value SHALL be used here. |cdr_location |CdrLocation |1 |Location where the charging session took place, including only the relevant EVSE and Connector. |meter_id |string(255) |? |Identification of the Meter inside the Charge Point. |currency |string(3) |1 |Currency of the CDR in ISO 4217 Code. |tariffs |Tariff |* |List of relevant Tariffs, see: Tariff. When relevant, a _Free of Charge_ tariff should also be in this list, and point to a defined _Free of Charge_ Tariff. |charging_periods |ChargingPeriod |+ |List of Charging Periods that make up this charging session. |signed_data |SignedData |? |Signed data that belongs to this charging Session. |total_cost |Price |1 |Total sum of all the costs of this transaction in the specified currency. |total_fixed_cost |Price |? |Total sum of all the fixed costs in the specified currency, except fixed price components of parking and reservation. The cost not depending on amount of time/energy used etc. Can contain costs like a start tariff. |total_energy |number |1 |Total energy charged, in kWh. |total_energy_cost |Price |? |Total sum of all the cost of all the energy used, in the specified currency. |total_time |number |1 |Total duration of the charging session (including the duration of charging and not charging), in hours. |total_time_cost |Price |? |Total sum of all the cost related to duration of charging during this transaction, in the specified currency. |total_parking_time |number |? |Total duration of the charging session where the EV was not charging (no energy was transferred between EVSE and EV), in hours. |total_parking_cost |Price |? |Total sum of all the cost related to parking of this transaction, including fixed price components, in the specified currency. |total_reservation_cost |Price |? |Total sum of all the cost related to a reservation of a Charge Point, including fixed price components, in the specified currency. |remark |string(255) |? |Optional remark, can be used to provide additional human readable information to the CDR, for example: reason why a transaction was stopped. |invoice_reference_id |CiString(39) |? |This field can be used to reference an invoice, that will later be send for this CDR. Making it easier to link a CDR to a given invoice. Maybe even group CDRs that will be on the same invoice. |credit |boolean |? |When set to `true`, this is a Credit CDR, and the field `credit_reference_id` needs to be set as well. |credit_reference_id |CiString(39) |? |Is required to be set for a Credit CDR. This SHALL contain the `id` of the CDR for which this is a Credit CDR. |home_charging_compensation |boolean |? |When set to `true`, this CDR is for a charging session using the home charger of the EV Driver for which the energy cost needs to be financial compensated to the EV Driver. |last_updated |DateTime |1 |Timestamp when this CDR was last updated (or created)."OCPI 2.2.1 CDRs module · #mod_cdrs_cdr_object
Explore the cdrs module →
Previous
Message Flow⚡UUserCChargerCCPOsendereeMSPreceiverStep 4 of 4