Tokens (CPO)

Realtime authorize for RFID/Autocharge, receive token whitelist push, and pull tokens via ChargeIndia Hub.

Hub roles: Tokens SENDER (CPO calls Hub authorize; Hub forwards to eMSP) and RECEIVER (Hub pushes whitelist Tokens to CPO). For charger-initiated RFID/Autocharge, call Hub authorize as CPO.

Guide: RFID & Autocharge.

Endpoints

MethodPathDescription
POST/ocpi/2.2.1/tokens/{token_uid}/authorize?type={type}Authorize with eMSP (OCPI-To required = token-owning eMSP)
(receive)Hub → CPO PUT/PATCH .../tokens/{emsp_cc}/{emsp_pid}/{uid}Receive whitelist Token push
GET/ocpi/2.2.1/tokensPull Tokens for routed eMSPs
GET/ocpi/2.2.1/tokens/{emsp_cc}/{emsp_pid}/{token_uid}Get one Token

Charger-initiated RFID / Autocharge

Map OCPP idTag (or Autocharge MAC/EVCCID) to OCPI token.uid, then:

CPO → Hub: POST /ocpi/2.2.1/tokens/{uid}/authorize?type=RFID
           Headers: OCPI-to-country-code / OCPI-to-party-id = eMSP
           Body: optional LocationReferences
Hub → eMSP: POST {tokens_sender_url}/{uid}/authorize?type=RFID

type defaults to RFID when omitted. Hub returns full AuthorizationInfo. On session/CDR push use:

  • auth_method: AUTH_REQUEST after realtime authorize
  • auth_method: WHITELIST after local whitelist auth
  • Prefer real eMSP identity on cdr_token (not Hub CIH)

Conventions

Modetoken.type / query typeuid
RFIDRFIDCard UID
AutochargeOTHERNormalized MAC / EVCCID

Whitelist receive / pull

eMSP pushes Tokens through Hub; Hub forwards PUT/PATCH to your Tokens RECEIVER. You may also GET Tokens from Hub (filtered by routing).

Set whitelist: ALWAYS or ALLOWED_OFFLINE for offline Autocharge.

Rate limit

100 requests/minute per party (shared Hub limit on the authorization path).

OCPI spec

See OCPI 2.2.1 Tokens module (Sender interface POST …/authorize) for full authorization request/response objects.