{"id":30755097,"url":"https://github.com/extrawest/Extrawest-OCPI-2.2.1-CPO-Client","last_synced_at":"2025-09-04T10:04:08.992Z","repository":{"id":180717100,"uuid":"663034905","full_name":"extrawest/Extrawest-OCPI-2.2.1-CPO-Client","owner":"extrawest","description":"Client library for Open Charge-Point Protocol CPO Server from extrawest.com","archived":false,"fork":false,"pushed_at":"2023-11-23T11:33:33.000Z","size":283,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T04:41:37.010Z","etag":null,"topics":["cpo","ocpi"],"latest_commit_sha":null,"homepage":"http://www.extrawest.com/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/extrawest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-06T12:14:32.000Z","updated_at":"2025-03-24T06:58:54.000Z","dependencies_parsed_at":"2023-11-23T11:30:54.740Z","dependency_job_id":"7063f6cd-c532-4ec6-ad06-db05610c359c","html_url":"https://github.com/extrawest/Extrawest-OCPI-2.2.1-CPO-Client","commit_stats":null,"previous_names":["extrawest/extrawest-ocpi-2.2.1-cpo-client"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/extrawest/Extrawest-OCPI-2.2.1-CPO-Client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2FExtrawest-OCPI-2.2.1-CPO-Client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2FExtrawest-OCPI-2.2.1-CPO-Client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2FExtrawest-OCPI-2.2.1-CPO-Client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2FExtrawest-OCPI-2.2.1-CPO-Client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extrawest","download_url":"https://codeload.github.com/extrawest/Extrawest-OCPI-2.2.1-CPO-Client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrawest%2FExtrawest-OCPI-2.2.1-CPO-Client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273588912,"owners_count":25132857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpo","ocpi"],"created_at":"2025-09-04T10:01:28.480Z","updated_at":"2025-09-04T10:04:08.982Z","avatar_url":"https://github.com/extrawest.png","language":"Java","funding_links":[],"categories":["Tools and Resources"],"sub_categories":["OCPI"],"readme":"# Extrawest-OCPI-2.2.1-CPO-Client\n\n\n![build](https://img.shields.io/github/actions/workflow/status/extrawest/Extrawest-OCPI-2.2.1-CPO-Client/docker-image.yml?style=for-the-badge)\n![release](https://img.shields.io/github/v/release/extrawest/Extrawest-OCPI-2.2.1-CPO-Client?style=for-the-badge)\n[![Java CI with Maven](https://github.com/extrawest/Extrawest-OCPI-2.2.1-CPO-Client/actions/workflows/release-publish.yml/badge.svg)](https://github.com/extrawest/Extrawest-OCPI-2.2.1-CPO-Client/actions/workflows/snapshot-publish.yml)\n![contr](https://img.shields.io/github/contributors/extrawest/Extrawest-OCPI-2.2.1-CPO-Client?style=for-the-badge)\n![commits](https://img.shields.io/github/commit-activity/m/extrawest/Extrawest-OCPI-2.2.1-CPO-Client?style=for-the-badge)\n![lastcommit](https://img.shields.io/github/last-commit/extrawest/Extrawest-OCPI-2.2.1-CPO-Client?style=for-the-badge)\n![OCPI](https://img.shields.io/badge/OCPI-2.2.1-yellowgreen?style=for-the-badge)\n![JDK](https://img.shields.io/badge/JDK-17-yellow?style=for-the-badge)\n![social](https://img.shields.io/github/forks/extrawest/Extrawest-OCPI-2.2.1-CPO-Client?style=for-the-badge)\n\n## Table of Contents\n\n- [Field of use](#field-of-use)\n- [Description](#description)\n- [Maven](#maven)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Use in Spring Boot App](#using-extrawest-ocpi-221-cpo-client-in-spring-boot-application)\n- [API Endpoints](#api-endpoints)\n- [Models](#models)\n- [Authentication and Authorization](#authentication-and-authorization)\n- [Recommendation](#recommendation)\n- [License](#license)\n- [About Extrawest.com](#about-extrawestcom)\n\n## Field of use\nClient library for [OCPI CPO Server](https://github.com/extrawest/Extrawest-OCPI-2.2.1-CPO-Server). Library for OCPI eMSP can be found [here](https://github.com/extrawest/Extrawest-OCPI-2.2.1-EMSP-Client).\n\nThis API exposes endpoints to manage OCPI entities. Open Charge Point Interface (OCPI) is an open protocol used for connections between charging station operators and service providers. Simply put, this protocol facilitates automated roaming for EV drivers between different EV charging networks.\n\n*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* as a client library for [OCPI CPO Server Library](https://github.com/extrawest/Extrawest-OCPI-2.2.1-CPO-Server)\n\nDescription\n=============\n\nWith this library, you can easily get started with the Open Charge-Point Interface by making calls to OCPI CPO Server API. It is a client to OCPI CPO Server  [OCPI CPO Server Library](https://github.com/extrawest/Extrawest-OCPI-2.2.1-CPO-Server), generated by OpenAPI Generator\n\nPlease note, this is a library and not an application, so there is no main method.\n\nCurrently we support 2.2.1 OCPI version.\n\nMaven\n=====\n\nFind the maven repo here: https://mvnrepository.com/artifact/com.extrawest/Extrawest-OCPI-2.2.1-CPO-Client\n\n## Requirements\n\nBuilding the API client library requires:\n\n1. Java 1.8+\n2. Maven\n\n## Installation\n\nTo install the API client library to your local Maven repository, simply execute:\n\n```shell\nmvn clean install\n```\n\n### Maven users\n\nAdd this dependency to your project's POM:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.extrawest\u003c/groupId\u003e\n  \u003cartifactId\u003eExtrawest-OCPI-2.2.1-CPO-Client\u003c/artifactId\u003e\n  \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n### Others\n\nAt first generate the JAR by executing:\n\n```shell\nmvn clean package\n```\n\nThen manually install the following JARs:\n\n- `target/Extrawest-OCPI-2.2.1-CPO-Client-2023.8.18.jar`\n- `target/lib/*.jar`\n\n## Getting Started\n\nPlease follow the [installation](#installation) instruction and execute the following Java code:\n\n```java\n\nimport com.extrawest.ocpi.cpo.client.invoker.*;\nimport com.extrawest.ocpi.cpo.client.invoker.auth.*;\nimport com.extrawest.ocpi.cpo.client.model.*;\nimport com.extrawest.ocpi.cpo.client.api.ClientInfoControllerApi;\n\npublic class ClientInfoControllerApiExample {\n\n    public static void main(String[] args) {\n        ApiClient defaultClient = Configuration.getDefaultApiClient();\n        defaultClient.setBasePath(\"http://localhost:8080\");\n        \n        ClientInfoControllerApi apiInstance = new ClientInfoControllerApi(defaultClient);\n        String countryCode = \"countryCode_example\";\n        String partyId = \"partyId_example\";\n        try {\n            ClientInfoDTO result = apiInstance.getHubClientInfo(countryCode, partyId);\n            System.out.println(result);\n        } catch (ApiException e) {\n            System.err.println(\"Exception when calling ClientInfoControllerApi#getHubClientInfo\");\n            System.err.println(\"Status code: \" + e.getCode());\n            System.err.println(\"Reason: \" + e.getResponseBody());\n            System.err.println(\"Response headers: \" + e.getResponseHeaders());\n            e.printStackTrace();\n        }\n    }\n}\n\n```\n### Using Extrawest-OCPI-2.2.1-CPO-Client in Spring Boot Application\n\n1. To access the CPO API classes, we need to configure them as beans:\n```java\n@Configuration\npublic class CpoClientConfig {\n\n    @Bean\n    public CpoTariffControllerApi cpoTariffControllerApi() {\n        return new CpoTariffControllerApi(apiClient());\n    }\n\n    @Bean\n    public ApiClient apiClient() {\n        ApiClient apiClient = new ApiClient();\n        apiClient.setBasePath(\"http://ocpi-server-api-url/\");\n        return apiClient;\n    }\n}\n```\n\n2. Since we configured our API classes as beans, we can freely inject them in our Spring-managed classes:\n```java\n\n@Service\npublic class CpoTariffServiceImpl implements  CpoTariffService {\n    @Autowired\n    private CpoTariffControllerApi cpoTariffControllerApi;\n\n    @Override\n    public List\u003cTariffDto\u003e getTariffs() {\n        try {\n            return cpoTariffControllerApi.getTariffs(OffsetDateTime.now().minusDays(10), OffsetDateTime.now().minusDays(1), 1, 10);\n        } catch (RestClientException e) {\n            throw new RuntimeException();\n        }\n    }\n}\n\n```\n\nSpring Boot application, where we have tested Extrawest-OCPI-2.2.1-CPO-Client, has below Spring dependencies. In case of library and your project dependencies versions incompatibility, try to add next spring versions into you projects:\n```\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.springframework\u003c/groupId\u003e\n            \u003cartifactId\u003espring-web\u003c/artifactId\u003e\n            \u003cversion\u003e5.3.24\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.springframework\u003c/groupId\u003e\n            \u003cartifactId\u003espring-context\u003c/artifactId\u003e\n            \u003cversion\u003e5.3.24\u003c/version\u003e\n        \u003c/dependency\u003e\n\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.springframework\u003c/groupId\u003e\n            \u003cartifactId\u003espring-core\u003c/artifactId\u003e\n            \u003cversion\u003e5.3.24\u003c/version\u003e\n        \u003c/dependency\u003e\n```\n\n\n## API Endpoints\n\nAll URIs are relative to *http://localhost:8080*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n*ClientInfoApi* | [**getHubClientInfo**](docs/ClientInfoApi.md#getHubClientInfo) | **GET** /api/2.2.1/hubClientInfo/{country_code}/{party_id} |\n*ClientInfoApi* | [**putHubClientInfo**](docs/ClientInfoApi.md#putHubClientInfo) | **PUT** /api/2.2.1/hubClientInfo/{country_code}/{party_id} |\n*CpoCdrApi* | [**getCdr**](docs/CpoCdrApi.md#getCdr) | **GET** /cpo/api/2.2.1/cdr |\n*CpoChargingProfilesApi* | [**deleteChargingProfile**](docs/CpoChargingProfilesApi.md#deleteChargingProfile) | **DELETE** /cpo/api/2.2.1/chargingProfiles/{session_id}/{response_url} |\n*CpoChargingProfilesApi* | [**getChargingProfile**](docs/CpoChargingProfilesApi.md#getChargingProfile) | **GET** /cpo/api/2.2.1/chargingProfiles/{session_id}/{duration}/{response_url} |\n*CpoChargingProfilesApi* | [**putChargingProfile**](docs/CpoChargingProfilesApi.md#putChargingProfile) | **PUT** /cpo/api/2.2.1/chargingProfiles/{session_id} |\n*CpoCommandsApi* | [**postCommand**](docs/CpoCommandsApi.md#postCommand) | **POST** /cpo/api/2.2.1/commands/{command} |\n*CpoCredentialsApi* | [**deleteCredentials**](docs/CpoCredentialsApi.md#deleteCredentials) | **DELETE** /cpo/api/2.2.1/credentials |\n*CpoCredentialsApi* | [**getCredentials**](docs/CpoCredentialsApi.md#getCredentials) | **GET** /cpo/api/2.2.1/credentials |\n*CpoCredentialsApi* | [**postCredentials**](docs/CpoCredentialsApi.md#postCredentials) | **POST** /cpo/api/2.2.1/credentials |\n*CpoCredentialsApi* | [**putCredentials**](docs/CpoCredentialsApi.md#putCredentials) | **PUT** /cpo/api/2.2.1/credentials |\n*CpoLocationApi* | [**getConnector**](docs/CpoLocationApi.md#getConnector) | **GET** /cpo/api/2.2.1/locations/{location_id}/{evse_uid}/{connector_id} |\n*CpoLocationApi* | [**getEvse**](docs/CpoLocationApi.md#getEvse) | **GET** /cpo/api/2.2.1/locations/{location_id}/{evse_uid} |\n*CpoLocationApi* | [**getLocation**](docs/CpoLocationApi.md#getLocation) | **GET** /cpo/api/2.2.1/locations/{location_id} |\n*CpoLocationApi* | [**getLocations**](docs/CpoLocationApi.md#getLocations) | **GET** /cpo/api/2.2.1/locations |\n*CpoSessionsApi* | [**getSessions**](docs/CpoSessionsApi.md#getSessions) | **GET** /cpo/api/2.2.1/sessions |\n*CpoSessionsApi* | [**putChargingPreferences**](docs/CpoSessionsApi.md#putChargingPreferences) | **PUT** /cpo/api/2.2.1/sessions |\n*CpoTariffApi* | [**getTariffs**](docs/CpoTariffApi.md#getTariffs) | **GET** /cpo/api/2.2.1/tariffs |\n*CpoTokensApi* | [**getToken**](docs/CpoTokensApi.md#getToken) | **GET** /cpo/api/2.2.1/tokens/{country_code}/{party_id}/{token_uid}/{type} |\n*CpoTokensApi* | [**patchToken**](docs/CpoTokensApi.md#patchToken) | **PATCH** /cpo/api/2.2.1/tokens/{country_code}/{party_id}/{token_uid}/{type} |\n*CpoTokensApi* | [**putToken**](docs/CpoTokensApi.md#putToken) | **PUT** /cpo/api/2.2.1/tokens/{country_code}/{party_id}/{token_uid}/{type} |\n*CpoVersionApi* | [**getVersionDetails**](docs/CpoVersionApi.md#getVersionDetails) | **GET** /cpo/api/versions/details |\n*CpoVersionApi* | [**getVersions**](docs/CpoVersionApi.md#getVersions) | **GET** /cpo/api/versions |\n*HubClientInfoApi* | [**getClientInfoList**](docs/HubClientInfoApi.md#getClientInfoList) | **GET** /hub/api/2.2.1/hubClientInfo |\n\n\n## Documentation for Models\n\n- [AbstractCommand](docs/AbstractCommand.md)\n- [AdditionalGeoLocation](docs/AdditionalGeoLocation.md)\n- [BusinessDetails](docs/BusinessDetails.md)\n- [CDRDto](docs/CDRDto.md)\n- [CdrDimension](docs/CdrDimension.md)\n- [CdrLocation](docs/CdrLocation.md)\n- [CdrToken](docs/CdrToken.md)\n- [ChargingPeriod](docs/ChargingPeriod.md)\n- [ChargingPreferences](docs/ChargingPreferences.md)\n- [ChargingProfile](docs/ChargingProfile.md)\n- [ChargingProfilePeriod](docs/ChargingProfilePeriod.md)\n- [ChargingProfileResponse](docs/ChargingProfileResponse.md)\n- [ClientInfoDto](docs/ClientInfoDto.md)\n- [CommandResponse](docs/CommandResponse.md)\n- [Connector](docs/Connector.md)\n- [CredentialsDto](docs/CredentialsDto.md)\n- [CredentialsRole](docs/CredentialsRole.md)\n- [DisplayText](docs/DisplayText.md)\n- [EVSE](docs/EVSE.md)\n- [Endpoint](docs/Endpoint.md)\n- [EnergyContract](docs/EnergyContract.md)\n- [EnergyMix](docs/EnergyMix.md)\n- [EnergySource](docs/EnergySource.md)\n- [EnvironmentalImpact](docs/EnvironmentalImpact.md)\n- [ExceptionalPeriod](docs/ExceptionalPeriod.md)\n- [GeoLocation](docs/GeoLocation.md)\n- [Hours](docs/Hours.md)\n- [Image](docs/Image.md)\n- [Location](docs/Location.md)\n- [Price](docs/Price.md)\n- [PriceComponent](docs/PriceComponent.md)\n- [PublishTokenType](docs/PublishTokenType.md)\n- [RegularHours](docs/RegularHours.md)\n- [ResponseFormatChargingPreferences](docs/ResponseFormatChargingPreferences.md)\n- [ResponseFormatChargingProfileResponse](docs/ResponseFormatChargingProfileResponse.md)\n- [ResponseFormatCommandResponse](docs/ResponseFormatCommandResponse.md)\n- [ResponseFormatCredentialsDto](docs/ResponseFormatCredentialsDto.md)\n- [ResponseFormatListCDRDto](docs/ResponseFormatListCDRDto.md)\n- [ResponseFormatListClientInfoDto](docs/ResponseFormatListClientInfoDto.md)\n- [ResponseFormatListLocation](docs/ResponseFormatListLocation.md)\n- [ResponseFormatListSessionDto](docs/ResponseFormatListSessionDto.md)\n- [ResponseFormatListTariffDto](docs/ResponseFormatListTariffDto.md)\n- [ResponseFormatListVersionDto](docs/ResponseFormatListVersionDto.md)\n- [ResponseFormatLocationData](docs/ResponseFormatLocationData.md)\n- [ResponseFormatObject](docs/ResponseFormatObject.md)\n- [ResponseFormatTokenDto](docs/ResponseFormatTokenDto.md)\n- [ResponseFormatVersionDetailsDto](docs/ResponseFormatVersionDetailsDto.md)\n- [SessionDto](docs/SessionDto.md)\n- [SetChargingProfile](docs/SetChargingProfile.md)\n- [SignedData](docs/SignedData.md)\n- [SignedValue](docs/SignedValue.md)\n- [StatusSchedule](docs/StatusSchedule.md)\n- [TariffDto](docs/TariffDto.md)\n- [TariffElement](docs/TariffElement.md)\n- [TariffRestrictions](docs/TariffRestrictions.md)\n- [TokenDto](docs/TokenDto.md)\n- [VersionDetailsDto](docs/VersionDetailsDto.md)\n- [VersionDto](docs/VersionDto.md)\n\n\n## Authentication and Authorization\nAll endpoints do not require authorization or authentication.\n\n## Recommendation\n\nIt's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.\n\n## License\n\n\n[MIT License](LICENSE)\n\n## About Extrawest.com\n\n\nWe are devoted to push the marked for vehicles charging forward.\nThere are many standards out there, we intend to implement and share them. Any help is much appreciated!\n\nThe market is in its defining state, the practices and standards we come up with now, may very well stick around for decades to come.\n\nSee our vision at https://www.extrawest.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrawest%2FExtrawest-OCPI-2.2.1-CPO-Client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextrawest%2FExtrawest-OCPI-2.2.1-CPO-Client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrawest%2FExtrawest-OCPI-2.2.1-CPO-Client/lists"}