Vehicles

Vehicles represent electric vehicles in the system. Each vehicle can have one or more access IDs (OCPP ID tags) associated with it, which can be used to represent cases where:

  1. A vehicle has multiple charging ports with different MAC IDs

  2. A vehicle MAC ID has changed over time, and you wish to maintain the connection to old charging sessions

Attaching an access ID to a vehicle can also be a way to associate an RFID card with the vehicle.

GET /api/vehicles

Retrieve a list of all electric vehicles.

Response

The JSON response will contain a data field with a list of vehicles, and a pagination field containing pagination details.

{
  data: {
    id: number;
    name: string | null;
    make: string | null;
    model: string | null;
    vin: string | null;
    licensePlate: string | null;
    hasTelematics: boolean;
    customer: {
      name: string;
    } | null;
    accessIds: {
      id: number;
      ocppIdTag: string;
      authorizationStatus: string; // Authorized | Revoked
    }[];
  }[];
  pagination: {
    hasNextPage: boolean;
    nextPageCursor: string | null;
  };
};

Example request and response

Request:

Response:

GET /api/vehicles/{id}

Retrieve the details for a specific vehicle.

Response

Example request and response

Request:

Response:

POST /api/vehicles

Create a new vehicle. When creating a vehicle, you can optionally associate one or more access IDs (OCPP ID tags) with it.

Request Body

Response

Example request and response

Request:

Response:

Example request with minimal fields

Request:

Response:

PATCH /api/vehicles/{id}

Update a vehicle.

Request Body

For optional fields, explicitly providing null will delete the value. Omitting a field will leave it unchanged.

Response

Example request and response

Request:

Response:

Example request to remove fields

Request:

Response:

Last updated