Pular para o conteúdo principal

OCPI

VoltBras connects to roaming platforms over OCPI 2.2.1, as a CPO. Each charge point operator on VoltBras is a separate OCPI party, and you see only the parties agreed with VoltBras.

ModuleVoltBras's roleInterface
VersionsCPOGET /versions, GET /2.2.1
CredentialsSenderGET, POST, PUT, DELETE
LocationsSenderGET, plus PUT to your Receiver
TariffsSenderGET, plus PUT and DELETE to your Receiver
CommandsReceiverPOST, with the result sent to your response_url
SessionsSenderGET, plus PUT to your Receiver
CDRsSenderGET, plus POST to your Receiver

GET /2.2.1 is always the list of what is available. VoltBras does not offer the Tokens, ChargingProfiles, or HubClientInfo modules.

Already connected to the current VoltBras OCPI service? See Migrating.

Get started​

  1. Agree with VoltBras which parties you will see.
  2. Receive VoltBras's versions URL and a registration token, sent out of band.
  3. Register with VoltBras.

VoltBras can also register with your platform instead: see Let VoltBras register with you.

Conventions​

  • Responses are OCPI envelopes: data, status_code, status_message on errors, and a UTC timestamp.
  • Request bodies are JSON, sent with Content-Type: application/json.
  • X-Request-ID and X-Correlation-ID are echoed back, or generated when missing.

A successful response and an error response look like this:

{
"data": [],
"status_code": 1000,
"timestamp": "2026-11-10T14:00:01.000Z"
}
{
"status_code": 2001,
"status_message": "Invalid or missing parameters: date_from",
"timestamp": "2026-11-10T14:00:01.000Z"
}

Errors use HTTP 200 with an OCPI status from 2000 to 3999, except:

HTTPWhen
401The token is missing or unknown, or it is the registration token on a module other than Versions and Credentials.
404The path or method does not exist, or the requested Location, EVSE, or connector does not exist.
405Your token cannot use this method.
400, 413, 415The body is not valid JSON, is over 1 MB, or uses an unsupported encoding.

Parties and routing headers​

On Locations, Tariffs, Commands, Sessions, and CDRs you can send OCPI-to-country-code and OCPI-to-party-id to address one VoltBras party. Without them, the request covers every party you can see. OCPI-from-country-code and OCPI-from-party-id are optional and must be one of your roles.

GET /2.2.1/locations HTTP/1.1
Authorization: Token NG1YM3VKMGI5R1o3a3EyWXRSOHZMMXNONnBXNWNBMGVIM2ZEOWlLMm9RNw==
OCPI-to-country-code: BR
OCPI-to-party-id: EXA
OCPI-from-country-code: NL
OCPI-from-party-id: EMS

An incomplete pair, a party you cannot see, or a role that is not yours gets status 2001. Values are compared without regard to case.

When VoltBras calls you, OCPI-from-* is the VoltBras party of the object. OCPI-to-* is the owner of the token on Sessions and CDRs, and on command results it is the OCPI-from-* of your command or, without it, the owner of the token. On Locations and Tariffs it is your eMSP role, when you have exactly one.

Pagination​

Lists accept offset and limit. The default limit is 100, and higher values than 1000 are reduced to 1000. The response has X-Total-Count, X-Limit, and, when there are more objects, a Link header with rel="next".

GET /2.2.1/locations?date_from=2026-11-10T12:00:00.000Z&limit=100 HTTP/1.1
HTTP/1.1 200 OK
X-Total-Count: 250
X-Limit: 100
Link: <https://ocpi.example.com/2.2.1/locations?offset=100&limit=100&date_from=2026-11-10T12%3A00%3A00.000Z>; rel="next"

Pulling changes​

List endpoints take date_from (inclusive) and date_to (exclusive), as in OCPI. Sessions require date_from. VoltBras saves changes in batches, so an object becomes visible when its batch is saved, a moment after its last_updated. To pull every change, choose your next date_from in one of these ways:

  • Use the largest last_updated you received in the previous pull.
  • If you chain intervals, where each date_from is the previous date_to, set date_to at least 1 minute before the time of your request.

Because date_from is inclusive, you receive the last object again. Store objects by id, so a repeated one replaces itself.

If you use the time of your request as the next date_from, an object saved while you pulled can be missed until it changes again.