Credentials

Mutual credentials exchange with ChargeIndia Hub.

Endpoints

MethodPathDescription
GET/ocpi/2.2.1/credentialsRetrieve current credentials
POST/ocpi/2.2.1/credentialsInitial credentials exchange
PUT/ocpi/2.2.1/credentialsUpdate or confirm credentials
DELETE/ocpi/2.2.1/credentialsUnregister (invalidate tokens; party becomes SUSPENDED)

Hub role: RECEIVER (partners call Hub)

POST - initial exchange

Used during onboarding to exchange tokens and URLs.

POST /ocpi/2.2.1/credentials
Authorization: Token {hub-issued-initial-token}
Content-Type: application/json

{
  "token": "partner-token",
  "url": "https://partner.example.com/ocpi/versions",
  "roles": [
    {
      "role": "CPO",
      "party_id": "ABC",
      "country_code": "IN",
      "business_details": { "name": "Example CPO" }
    }
  ]
}

Response

{
  "status_code": 1000,
  "data": {
    "token": "hub-token-for-partner",
    "url": "https://hub.chargeindia.com/ocpi/versions",
    "roles": [
      {
        "role": "HUB",
        "party_id": "CIH",
        "country_code": "IN",
        "business_details": { "name": "ChargeIndia Hub" }
      }
    ]
  }
}

PUT - update or rotate

Used to confirm exchange or rotate tokens.

The Hub fetches your versions/endpoints using the token and url in the body (OCPI 2.2.1). On success it issues a new Hub credentials token. Store data.token and use it for all later Hub calls. data.url is the Hub versions endpoint.

HTTP 405 (Not registered) if credentials exchange has not completed or the party is already unregistered.

If the Hub cannot reach your versions API, the response uses OCPI status_code 3001. If your version details omit a credentials module, 3003.

DELETE - unregister

Informs the Hub that your credentials are no longer valid. The Hub invalidates your Hub-issued tokens and sets your party to SUSPENDED. Automated communication stops. Calling DELETE again when already unregistered returns HTTP 405.

Re-onboarding requires a new Token A from Hub admin and a fresh POST credentials exchange.

GET - retrieve

Returns current credentials for the authenticated party.