Skip to content

OCPI 2.1.1 API Reference

Complete API reference for OCPI 2.1.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 versions
  • GET /ocpi/2.1.1/details - Get details for OCPI version 2.1.1

CPO Role Endpoints

Credentials Module

  • POST /ocpi/cpo/2.1.1/credentials - Create or update credentials
  • GET /ocpi/cpo/2.1.1/credentials - Get credentials

Locations Module

  • GET /ocpi/cpo/2.1.1/locations - Get list of locations
  • GET /ocpi/cpo/2.1.1/locations/{country_code}/{party_id}/{location_id} - Get location by ID
  • PUT /ocpi/cpo/2.1.1/locations/{country_code}/{party_id}/{location_id} - Create or update location
  • PATCH /ocpi/cpo/2.1.1/locations/{country_code}/{party_id}/{location_id} - Partially update location

Sessions Module

  • GET /ocpi/cpo/2.1.1/sessions - Get list of sessions
  • GET /ocpi/cpo/2.1.1/sessions/{country_code}/{party_id}/{session_id} - Get session by ID
  • PUT /ocpi/cpo/2.1.1/sessions/{country_code}/{party_id}/{session_id} - Create or update session
  • PATCH /ocpi/cpo/2.1.1/sessions/{country_code}/{party_id}/{session_id} - Partially update session

CDRs Module

  • GET /ocpi/cpo/2.1.1/cdrs - Get list of CDRs
  • GET /ocpi/cpo/2.1.1/cdrs/{country_code}/{party_id}/{cdr_id} - Get CDR by ID
  • POST /ocpi/cpo/2.1.1/cdrs - Create new CDR

Tokens Module

  • GET /ocpi/cpo/2.1.1/tokens/{country_code}/{party_id}/{token_uid} - Get token by UID
  • PUT /ocpi/cpo/2.1.1/tokens/{country_code}/{party_id}/{token_uid} - Create or update token
  • PATCH /ocpi/cpo/2.1.1/tokens/{country_code}/{party_id}/{token_uid} - Partially update token

Tariffs Module

  • GET /ocpi/cpo/2.1.1/tariffs - Get list of tariffs

Commands Module

  • POST /ocpi/cpo/2.1.1/commands/{command} - Send command (START_SESSION, STOP_SESSION, RESERVE_NOW, UNLOCK_CONNECTOR)

EMSP Role Endpoints

Credentials Module

  • GET /ocpi/emsp/2.1.1/credentials - Get credentials
  • POST /ocpi/emsp/2.1.1/credentials - Create or update credentials

Locations Module

  • GET /ocpi/emsp/2.1.1/locations - Get list of locations
  • GET /ocpi/emsp/2.1.1/locations/{country_code}/{party_id}/{location_id} - Get location by ID
  • PUT /ocpi/emsp/2.1.1/locations/{country_code}/{party_id}/{location_id} - Create or update location
  • PATCH /ocpi/emsp/2.1.1/locations/{country_code}/{party_id}/{location_id} - Partially update location

Sessions Module

  • GET /ocpi/emsp/2.1.1/sessions - Get list of sessions
  • GET /ocpi/emsp/2.1.1/sessions/{country_code}/{party_id}/{session_id} - Get session by ID
  • PUT /ocpi/emsp/2.1.1/sessions/{country_code}/{party_id}/{session_id} - Create or update session
  • PATCH /ocpi/emsp/2.1.1/sessions/{country_code}/{party_id}/{session_id} - Partially update session

CDRs Module

  • GET /ocpi/emsp/2.1.1/cdrs - Get list of CDRs
  • GET /ocpi/emsp/2.1.1/cdrs/{country_code}/{party_id}/{cdr_id} - Get CDR by ID

Tokens Module

  • GET /ocpi/emsp/2.1.1/tokens - Get list of tokens
  • POST /ocpi/emsp/2.1.1/tokens/{country_code}/{party_id}/{token_uid}/authorize - Authorize token

Tariffs Module

  • GET /ocpi/emsp/2.1.1/tariffs - Get list of tariffs
  • GET /ocpi/emsp/2.1.1/tariffs/{country_code}/{party_id}/{tariff_id} - Get tariff by ID
  • PUT /ocpi/emsp/2.1.1/tariffs/{country_code}/{party_id}/{tariff_id} - Create or update tariff
  • DELETE /ocpi/emsp/2.1.1/tariffs/{country_code}/{party_id}/{tariff_id} - Delete tariff

Commands Module

  • POST /ocpi/emsp/2.1.1/commands/{command}/{uid} - Send command result

Schemas

For detailed schema documentation, see the Quick Start Guide and check the FastAPI auto-generated documentation at /docs when running the application.