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

CPO pushes the Session to the home eMSP

Technical
5 min
OCPI 2.1.1, 2.2.1 and 2.3.0
CPO pushes the Session to the home eMSP

Power starts flowing. The Dutch CPO opens Session session-9920 under its own country and party, NL and FPN, and pushes it to the German eMSP. The Session's token names the eMSP that owns it, DE and BMW.

Sandbox run · OCPI 2.2.1

Run this exchange in the sandbox

CPO
EMSP
"When the CPO creates a Session object they push it to the corresponding eMSP by calling PUT on the eMSP's Sessions endpoint with the newly created Session object. 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. Sessions cannot be deleted, final status of a session is: `COMPLETED`. When the CPO is not sure about the state or existence of a Session object in the eMSP's system, the CPO can call GET on the eMSP's Sessions endpoint to validate the Session object in the eMSP's system."OCPI 2.2.1 Sessions module · #mod_sessions_push_model"|country_code |CiString(2) |1 |ISO-3166 alpha-2 country code of the CPO that 'owns' this Session. |party_id |CiString(3) |1 |ID of the CPO that 'owns' this Session (following the ISO-15118 standard). |id |CiString(36) |1 |The unique id that identifies the charging session in the CPO platform. |start_date_time |DateTime |1 |The timestamp when the session became ACTIVE in the Charge Point. + When the session is still PENDING, this field SHALL be set to the time the Session was created at the Charge Point. When a Session goes from PENDING to ACTIVE, this field SHALL be updated to the moment the Session went to ACTIVE in the Charge Point. |end_date_time |DateTime |? |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. |kwh |number |1 |How many kWh were charged. |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. This might change during a session, 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`. |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. |location_id |CiString(36) |1 |Location.id of the Location object of this CPO, on which the charging session is/was happening. |evse_uid |CiString(36) |1 |EVSE.uid of the EVSE of this Location on which the charging session is/was happening. Allowed to be set to: `#NA` when this session is created for a reservation, but no EVSE yet assigned to the driver. |connector_id |CiString(36) |1 |Connector.id of the Connector of this Location where the charging session is/was happening. Allowed to be set to: `#NA` when this session is created for a reservation, but no connector yet assigned to the driver. |meter_id |string(255) |? |Optional identification of the kWh meter. |currency |string(3) |1 |ISO 4217 code of the currency used for this session. |charging_periods |ChargingPeriod |* |An optional list of Charging Periods that can be used to calculate and verify the total cost. |total_cost |Price |? |The total cost of the session in the specified currency. This is the price that the eMSP will have to pay to the CPO. A total_cost of 0.00 means free of charge. When omitted, i.e. no price information is given in the Session object, it does not imply the session is/was free of charge. |status |SessionStatus |1 |The status of the session. |last_updated |DateTime |1 |Timestamp when this Session was last updated (or created)."OCPI 2.2.1 Sessions module · #mod_sessions_session_object"|country_code |CiString(2) |1 |ISO-3166 alpha-2 country code of the MSP that 'owns' this Token. |party_id |CiString(3) |1 |ID of the eMSP that 'owns' this Token (following the ISO-15118 standard). |uid |CiString(36) |1 |Unique ID by which this Token can be identified. + This is the field used by the CPO's system (RFID reader on the Charge Point) to identify this token. + Currently, in most cases: `type=RFID`, this is the RFID hidden ID as read by the RFID reader, but that is not a requirement. + If this is a `type=APP_USER` Token, it will be a unique, by the eMSP, generated ID. |type |TokenType |1 |Type of the token |contract_id |CiString(36) |1 |Uniquely identifies the EV driver contract token within the eMSP's platform (and suboperator platforms). Recommended to follow the specification for eMA ID from "eMI3 standard version V1.0" (https://web.archive.org/web/20230603153631/https://emi3group.com/documents-links/[https://web.archive.org/web/20230603153631/https://emi3group.com/documents-links/]) "Part 2: business objects.""OCPI 2.2.1 CDRs module · #mod_cdrs_cdr_token_object
Explore the sessions module →
Message Flow⚡UUserCChargerCCPOsendereeMSPreceiverStep 3 of 4