Tokens

OCPI 2.1.1

By Abhishek Uniyal · Updated

Tokens in OCPI 2.1.1

A Token represents the identification used to authorize charging. Append the token UID and /authorize to the advertised Tokens endpoint. LocationReferences is optional. A request without it can succeed when the eMSP has enough information; the insufficient-information condition is not every missing request body. In 2.1.1 that condition is a SHOULD, and AuthorizationInfo has no complete Token field.

Sources (5)
uid · string(36) · cardinality 1: Identification used by CPO system to identify this token. Currently, in most cases, this is the RFID hidden ID as read by the RFID reader. type · TokenType · cardinality 1: Type of the token auth_id · string(36) · cardinality 1: Uniquely identifies the EV Driver contract token within the eMSP's platform (and suboperator platforms). Recommended to follow the specification for eMA ID from "eMI3 standard version V1.0" (http://emi3group.com/documents-links/) "Part 2: business objects." visual_number · string(64) · cardinality ?: Visual readable number/identification as printed on the Token (RFID card), might be equal to the auth_id. issuer · string(64) · cardinality 1: Issuing company, most of the times the name of the company printed on the token (RFID card), not necessarily the eMSP. valid · boolean · cardinality 1: Is this Token valid whitelist · WhitelistType · cardinality 1: Indicates what type of white-listing is allowed. language · string(2) · cardinality ?: Language Code ISO 639-1. This optional field indicates the Token owner's preferred interface language. If the language is not provided or not supported then the CPO is free to choose its own language. last_updated · DateTime · cardinality 1: Timestamp when this Token was last updated (or created).OCPI 2.1.1 Tokens module · #32-token-objectallowed · Allowed · cardinality 1: Status of the Token, and whether charging is allowed at the optionally given location. location · LocationReferences · cardinality ?: Optional reference to the location if it was included in the request, and if the EV driver is allowed to charge at that location. Only the EVSEs/Connectors the EV driver is allowed to charge at are returned. info · DisplayText · cardinality ?: Optional display text, additional information to the EV driver.OCPI 2.1.1 Tokens module · #31-authorizationinfo-object"`/ocpi/emsp/2.0/tokens/{token_uid}/authorize?{type=token_type}`"OCPI 2.1.1 Tokens module · #222-post-method"When the eMSP receives a 'real-time' authorization request from a CPO that contains too little information (no LocationReferences provided) to determine if the Token might be used, the eMSP SHOULD respond with the OCPI status: 2002"OCPI 2.1.1 Tokens module · #222-post-method"In the body an optional LocationReferences object can be given. The eMSP SHALL then validate if the Token is allowed to be used at this Location, and if applicable: which of the Locations EVSEs/Connectors."OCPI 2.1.1 Tokens module · #222-post-method

Example payload · bodiless-known-token-authorization

{
  "allowed": "ALLOWED"
}

Example payload · insufficient-location-envelope

{
  "status_code": 2002,
  "timestamp": "2026-01-01T00:00:00Z"
}
Read token authorization in the charging lesson

Which endpoints does this module define?

These paths illustrate the requests. Use the URLs advertised by your partner, replace the placeholders and choose the matching interface. A listed method does not establish that this site's simulator implements it.

CPO

  • Retrieve a Token as it is stored in the CPO system.

    GET
    /ocpi/2.1.1/tokens/{country_code}/{party_id}/{token_uid}
  • Push new/updated Token object to the CPO.

    PUT
    /ocpi/2.1.1/tokens/{country_code}/{party_id}/{token_uid}
  • Notify the CPO of partial updates to a Token.

    PATCH
    /ocpi/2.1.1/tokens/{country_code}/{party_id}/{token_uid}
Source
Method: Description ------------------------------: -------------------------------------------------------------- GET: Retrieve a Token as it is stored in the CPO system. POST: n/a PUT: Push new/updated Token object to the CPO. PATCH: Notify the CPO of partial updates to a Token. DELETE: n/a, (Use PUT, Tokens cannot be removed).OCPI 2.1.1 Tokens module · #21-cpo-interface

eMSP

  • Get the list of known Tokens, last updated between the {date_from} and {date_to} (paginated)

    GET
    /ocpi/2.1.1/tokens/
  • Real-time authorization request

    POST
    /ocpi/2.1.1/tokens/{token_uid}/authorize
Source
Method: Description --------------------------: ------------------------------------------------------------------------- GET: Get the list of known Tokens, last updated between the {date_from} and {date_to} (paginated) POST: Real-time authorization request PUT: n/a PATCH: n/a DELETE: n/aOCPI 2.1.1 Tokens module · #22-emsp-interface

Try an endpoint

Send a request to this site's OCPI endpoints and read the answer. It never reaches your own system.