OCPI 2.2.1 API Reference¶
Complete API reference for OCPI 2.2.1 implementation.
Version Endpoints¶
The version endpoints provide information about available OCPI versions and version-specific details.
GET /ocpi/versions- Get list of available OCPI versionsGET /ocpi/2.2.1/details- Get details for OCPI version 2.2.1
CPO Role Endpoints¶
Credentials Module¶
POST /ocpi/cpo/2.2.1/credentials- Create or update credentialsGET /ocpi/cpo/2.2.1/credentials- Get credentials
Locations Module¶
GET /ocpi/cpo/2.2.1/locations- Get list of locationsGET /ocpi/cpo/2.2.1/locations/{country_code}/{party_id}/{location_id}- Get location by IDPUT /ocpi/cpo/2.2.1/locations/{country_code}/{party_id}/{location_id}- Create or update locationPATCH /ocpi/cpo/2.2.1/locations/{country_code}/{party_id}/{location_id}- Partially update location
Sessions Module¶
GET /ocpi/cpo/2.2.1/sessions- Get list of sessionsGET /ocpi/cpo/2.2.1/sessions/{country_code}/{party_id}/{session_id}- Get session by IDPUT /ocpi/cpo/2.2.1/sessions/{country_code}/{party_id}/{session_id}- Create or update sessionPATCH /ocpi/cpo/2.2.1/sessions/{country_code}/{party_id}/{session_id}- Partially update session
CDRs Module¶
GET /ocpi/cpo/2.2.1/cdrs- Get list of CDRsGET /ocpi/cpo/2.2.1/cdrs/{country_code}/{party_id}/{cdr_id}- Get CDR by IDPOST /ocpi/cpo/2.2.1/cdrs- Create new CDR
Tokens Module¶
GET /ocpi/cpo/2.2.1/tokens/{country_code}/{party_id}/{token_uid}- Get token by UIDPUT /ocpi/cpo/2.2.1/tokens/{country_code}/{party_id}/{token_uid}- Create or update tokenPATCH /ocpi/cpo/2.2.1/tokens/{country_code}/{party_id}/{token_uid}- Partially update token
Tariffs Module¶
GET /ocpi/cpo/2.2.1/tariffs- Get list of tariffs
Commands Module¶
POST /ocpi/cpo/2.2.1/commands/{command}- Send command (START_SESSION, STOP_SESSION, RESERVE_NOW, UNLOCK_CONNECTOR)
Charging Profiles Module¶
GET /ocpi/cpo/2.2.1/chargingprofiles/{session_id}- Get active charging profilePUT /ocpi/cpo/2.2.1/chargingprofiles/{session_id}- Set charging profileDELETE /ocpi/cpo/2.2.1/chargingprofiles/{session_id}- Clear charging profile
Hub Client Info Module¶
GET /ocpi/cpo/2.2.1/hubclientinfo- Get hub client infoPUT /ocpi/cpo/2.2.1/hubclientinfo- Create or update hub client info
EMSP Role Endpoints¶
Credentials Module¶
GET /ocpi/emsp/2.2.1/credentials- Get credentialsPOST /ocpi/emsp/2.2.1/credentials- Create or update credentials
Locations Module¶
GET /ocpi/emsp/2.2.1/locations- Get list of locationsGET /ocpi/emsp/2.2.1/locations/{country_code}/{party_id}/{location_id}- Get location by IDPUT /ocpi/emsp/2.2.1/locations/{country_code}/{party_id}/{location_id}- Create or update locationPATCH /ocpi/emsp/2.2.1/locations/{country_code}/{party_id}/{location_id}- Partially update location
Sessions Module¶
GET /ocpi/emsp/2.2.1/sessions- Get list of sessionsGET /ocpi/emsp/2.2.1/sessions/{country_code}/{party_id}/{session_id}- Get session by IDPUT /ocpi/emsp/2.2.1/sessions/{country_code}/{party_id}/{session_id}- Create or update sessionPATCH /ocpi/emsp/2.2.1/sessions/{country_code}/{party_id}/{session_id}- Partially update session
CDRs Module¶
GET /ocpi/emsp/2.2.1/cdrs- Get list of CDRsGET /ocpi/emsp/2.2.1/cdrs/{country_code}/{party_id}/{cdr_id}- Get CDR by ID
Tokens Module¶
GET /ocpi/emsp/2.2.1/tokens- Get list of tokensPOST /ocpi/emsp/2.2.1/tokens/{country_code}/{party_id}/{token_uid}/authorize- Authorize token
Tariffs Module¶
GET /ocpi/emsp/2.2.1/tariffs- Get list of tariffsGET /ocpi/emsp/2.2.1/tariffs/{country_code}/{party_id}/{tariff_id}- Get tariff by IDPUT /ocpi/emsp/2.2.1/tariffs/{country_code}/{party_id}/{tariff_id}- Create or update tariffDELETE /ocpi/emsp/2.2.1/tariffs/{country_code}/{party_id}/{tariff_id}- Delete tariff
Commands Module¶
POST /ocpi/emsp/2.2.1/commands/{command}/{uid}- Send command result
Charging Profiles Module¶
GET /ocpi/emsp/2.2.1/chargingprofiles/{session_id}- Get active charging profile
Hub Client Info Module¶
GET /ocpi/emsp/2.2.1/hubclientinfo- Get hub client infoPUT /ocpi/emsp/2.2.1/hubclientinfo- Create or update hub client info
Schemas¶
For detailed schema documentation, see the Quick Start Guide and check the FastAPI auto-generated documentation at /docs when running the application.