Commands (eMSP)

Send remote charging commands via ChargeIndia Hub.

Hub role: RECEIVER

Supported commands

CommandDescription
START_SESSIONRemotely start a charging session
STOP_SESSIONRemotely stop an active session
RESERVE_NOWReserve a connector
CANCEL_RESERVATIONCancel a reservation
UNLOCK_CONNECTORUnlock a connector (requires location_id, evse_uid, connector_id)

Endpoints

MethodPathAuthDescription
POST/ocpi/2.2.1/commands/{command}YesSend command to CPO

START_SESSION example

POST /ocpi/2.2.1/commands/START_SESSION
Authorization: Token {emsp-token}
Content-Type: application/json
OCPI-from-country-code: IN
OCPI-from-party-id: EMS
OCPI-to-country-code: IN
OCPI-to-party-id: CPO

{
  "response_url": "https://emsp.example.com/ocpi/callbacks/commands",
  "token": {
    "uid": "TOKEN001",
    "type": "RFID",
    "contract_id": "CONTRACT001"
  },
  "location_id": "LOC001",
  "evse_uid": "EVSE001",
  "connector_id": "1"
}

Open Routing

OCPI-from-* / OCPI-to-* are optional. If OCPI-to-* is omitted, Hub resolves the CPO from location_id (or session_id for stop). If OCPI-to-* is present, it must match that resolved CPO. See Message routing headers.

STOP_SESSION example

Include session_id in the body:

{
  "response_url": "https://emsp.example.com/ocpi/callbacks/commands",
  "session_id": "SESSION001"
}

UNLOCK_CONNECTOR example

{
  "response_url": "https://emsp.example.com/ocpi/callbacks/commands",
  "location_id": "LOC001",
  "evse_uid": "EVSE001",
  "connector_id": "1"
}

Immediate response

{
  "status_code": 1000,
  "data": {
    "result": "ACCEPTED",
    "timeout": 30
  }
}

Failure paths

  • CPO timeout / unavailable: HTTP 502 with messages such as "CPO command forward timed out" or "CPO command forward unavailable". Hub does not retry or keep the command pending. You may re-issue after checking Connection Health.
  • Accepted but no session: Honor data.timeout. Hub does not invent an async failure if the CPO never callbacks and never pushes a session. See Failure scenarios.

Async callback flow

  1. Hub forwards command to CPO (Hub→CPO HTTP timeout 20s)
  2. CPO responds immediately (ACCEPTED / REJECTED)
  3. CPO sends async result to Hub: POST /commands/callback/{command_id} with CPO auth
  4. Hub forwards result to your response_url using your Hub credentials

Rate limit

50 requests/minute per party.

OCPI spec

See OCPI 2.2.1 Commands module for full command and result objects.