Guest organisation
OCPI
Learn reference
Guest organisation
OCPI
Learn reference

Authorize the driver

By Abhishek Uniyal · Updated

Step 7 of 11

OCPI 2.2.1

Compare versions

Token authorization asks whether a driver identification record may be used to charge. This local example uses a real-time request to the eMSP; no partner endpoint is connected.

What changes in OCPI 2.2.1
Modules in OCPI 2.2.1
Sessions
CDRs
Locations
Tariffs
Tokens
Commands
Credentials
Versions
Hub Client Info
Charging Profiles
Payments · extension
Advertised sender and receiver interfaces

An endpoint declares how another platform can pull or push data. Credentials uses the same interface for both roles.

The header token is encoded

The request header carries an encoded token; the Credentials body still carries the raw token.

Billing records name the Token owner

A charge record names the country and company that own the driver's Token.

Simulated copies · no peer is connected

CPO

No Session yet.

eMSP

No Session yet.

Which OCPI exchange does this action illustrate?

When the eMSP has its Tokens authorized in real time, the CPO asks the eMSP whether a Token may charge, optionally at a given Location. The eMSP answers with an AuthorizationInfo object, and ALLOWED means the Token may charge.

Teaching example · request path

POST /tokens/{token_uid}/authorize
Sources (6)
"An eMSP might want their Tokens to be authorized 'real-time', not white-listed. For this the eMSP has to implement the POST Authorize request and set the Token.whitelist field to `NEVER` for Tokens they want to have authorized 'real-time'."OCPI 2.2.1 Tokens module · #mod_tokens_real-time_authorization"Do a 'real-time' authorization request to the eMSP system, validating if a Token might be used (at the optionally given Location)."OCPI 2.2.1 Tokens module · #mod_tokens_post_method"When the token is known by the Sender, the response SHALL contain a AuthorizationInfo object. If the token is not known, the response SHALL contain the status code: `2004: Unknown Token`, and no `data` field."OCPI 2.2.1 Tokens module · #mod_tokens_post_response_dataALLOWED: This Token is allowed to charge (at this location).OCPI 2.2.1 Tokens module · #mod_tokens_allowed_enum"OCPI status code, as listed in Status Codes, indicates how the request was handled. To avoid confusion with HTTP codes, OCPI status codes consist of four digits."OCPI 2.2.1 Transport and format chapter · #transport_and_format_response_format1000: Generic success codeOCPI 2.2.1 Status codes chapter · #status_codes_1xxx_success

A Session records state, including ACTIVE before any energy has been transferred. The completed charge detail record supports billing; this example does not show a customer debit.

Sources (2)
ACTIVE: The session has been accepted and is active. All pre-conditions were met: Communication between EV and EVSE (for example: cable plugged in correctly), EV or driver is authorized. EV is being charged, or can be charged. Energy is, or is not, being transfered.OCPI 2.2.1 Sessions module · #mod_sessions_sessionstatus_enum"A *Charge Detail Record* is the description of a concluded charging session. The CDR is the only billing-relevant object."OCPI 2.2.1 CDRs module · #mod_cdrs_cdrs_module
Session definition · Read the Sessions reference