Pular para o conteúdo principal

Connecting

Two platforms connect with a Credentials exchange: each one gives the other its versions URL and a token to call it with. Either platform can start the exchange.

Register with VoltBras​

  1. Call VoltBras's versions URL with the registration token, then GET /2.2.1, to find the credentials endpoint.
  2. Send POST /2.2.1/credentials with the registration token. In the body, token is the token VoltBras will use to call you, url is your versions URL, and roles are your roles.
  3. VoltBras reads your versions and your 2.2.1 endpoints with that token, then answers 201 with its Credentials.
  4. Use the token from the answer for every request from now on. The registration token stops working.

The request and the answer:

{
"token": "partner-token-b",
"url": "https://emsp.example.com/ocpi/versions",
"roles": [
{
"role": "EMSP",
"business_details": { "name": "Example eMSP" },
"party_id": "EMS",
"country_code": "NL"
}
]
}
{
"data": {
"token": "4mX3uJ0b9GZ7kq2YtR8vL1sN6pW5cA0eH3fD9iK2oQ7",
"url": "https://ocpi.example.com/versions",
"roles": [
{
"role": "CPO",
"business_details": { "name": "Example CPO" },
"party_id": "EXA",
"country_code": "BR"
}
]
},
"status_code": 1000,
"timestamp": "2026-11-10T12:00:00.000Z"
}

If the registration fails, VoltBras answers HTTP 200 with an error status and stores nothing. Fix the problem and try again with the same registration token.

StatusCause
2001The body is invalid, or one of your roles uses the identity of a VoltBras party.
3001VoltBras could not read your versions or 2.2.1 details, or the details are not for 2.2.1.
3002Your versions do not include 2.2.1.
3003Your 2.2.1 details have no credentials endpoint.
3000You cannot see any VoltBras party yet, or VoltBras had an unexpected error.

Let VoltBras register with you​

  1. Send VoltBras, out of band, your versions URL and a registration token for your platform (up to 64 characters).
  2. VoltBras reads your versions and endpoints, then sends a POST with its Credentials to your credentials endpoint. The token in it already works, so you can call VoltBras with it before you answer.
  3. Answer within 30 seconds with your Credentials.

If your answer fails or arrives late, VoltBras stores nothing, but the token it sent keeps working: you can finish the registration with a PUT that uses it.

Update the tokens​

An update replaces both tokens: one platform sends a PUT with new Credentials, and the answer carries the other platform's new token.

  • You: send PUT /2.2.1/credentials with your current token. VoltBras checks it as it checks a registration, and your previous token stops working.
  • VoltBras: sends you a PUT once your last completed exchange is more than 30 days old, and may send one at other times.

If VoltBras does not get your answer to its PUT, nothing changes on its side: it keeps calling you with your previous token, so keep that token valid until VoltBras uses the new one. Your previous token and the one in VoltBras's PUT both keep working until an update completes.

GET /2.2.1/credentials always returns your current roles: the VoltBras parties you can see.

Disconnect​

  • You: send DELETE /2.2.1/credentials with your token and no body. VoltBras removes your registration and all your tokens.
  • VoltBras: removes your registration first, then sends you one DELETE.

To connect again, register with a new registration token from VoltBras, or let VoltBras register with you.

Requirements for your platform​

  • https URLs, without redirects, and a versions URL of up to 255 characters.
  • OCPI responses with HTTP 2xx, and a status from 1000 to 1999 on success.
  • Answers of at most 1 MiB, within the limits below.
  • Roles that do not use the identity of a VoltBras party. Roles from other OCPI versions are ignored.
  • Only the credentials endpoint is required. Declare locations, tariffs, sessions, or cdrs with the role RECEIVER to receive updates; without them, you pull.

Time limits​

Call from VoltBrasLimit
Credentials POST and PUT30 seconds
Locations PUT, Sessions PUT, CDRs POST3 seconds
Tariffs PUT and DELETE, command results, other calls10 seconds

A Locations PUT for a change other than a status can take up to 10 seconds, but status changes use the same request and allow 3, so plan for 3.

If a call times out or the network fails during a round of updates, VoltBras skips your remaining updates in that round. Updates are not repeated, so pull to recover them.