REST APIs For EV Charging Applications

eDRV's easy-to-use, flexible and scalable backend APIs allow you to integrate advanced charging management functionality into your applications without getting into the hassle of implementing the Open Charging Point Protocol (OCPP)

Why Use Our APIs?

If you are considering an in-house OCPP implementation, consider these benefits of using eDRV APIs instead.

Built for Developers

Our well-documented APIs help you build EV charging applications easily. eDRV works with any unlocked, network capable EV charging station based on OCPP 1.6 or 2.0.1. If you are looking to launch an EV charging application, eDRV will save you months of time and money in development and compatibility testing time. 🚀

SAMPLE REQUEST

const eDRV = require('eDRV');
eDRV.auth('Access-Token');

//Get a specific connector
await eDRV.getConnector({id: '5f72f55431a6770a131db279'});

SAMPLE RESPONSE

{
    "ok": true,
    "result": {
      "active": true,
      "status": "Charging",
      "_id": "5f72f55431a6770a131db279",
      "type": "Type 2",
      "format": "Cable",
      "power_type": "AC Single Phase",
      "power": 11,
      "endpoint": "r9l5",
      "evse": "5f72f55431a6770a131db278",
      "ocppId": 1,
      "createdAt": "2020-09-29T08:50:28.558Z",
      "updatedAt": "2021-07-29T13:49:16.697Z",
      "rate": "60f8272848170a50c3a7e2a4",
      "owner": "603763d592204c0c840578c6"
    },
    "message": "Found"
}

Sample Request

const eDRV = require('eDRV');
eDRV.auth('Access-Token');

//Create a new User (Driver) identity
await eDRV.postUsers({
  active: true,
  source: 'auth0',
  address: {
    streetAndNumber: '1 Soul Avenue',
    city: 'Atlanta',
    postalCode: '30901',
    country: 'USA'
  },
  phone: {mobile: '(705)123-1212', 
          home: '(706)124-1212', 
          work: '(706)125-1212'},
  auth0_id: 'google-oauth2|112615396624755082000',
  firstname: 'James',
  lastname: 'Brown',
  email: 'godfather@soul.com'
});

Sample Response

{
  "ok": true,
  "message": "string",
  "result": {
    "active": true,
    "source": "auth0",
    "auth0_id": "google-oauth2|112615396624755082000",
    "stripe_id": "cus_J91iwKlaVVQN00",
    "firstname": "James",
    "lastname": "Brown",
    "email": "godfather@soul.com",
    "active_organization": "603763d692204c0c840578d2",
    "address": {
      "streetAndNumber": "1 Soul Avenue",
      "city": "Atlanta",
      "postalCode": "30901",
      "country": "USA"
    },
    "phone": {
      "mobile": "(705)123-1212",
      "home": "(706)124-1212",
      "work": "(706)125-1212"
    }
  }
}

Sample Request

const eDRV = require('eDRV');

eDRV.auth('Access-Token');
eDRV.postRates({
    party_id: 'EDRV',
    elements: [{price_components: [
            {
                type: 'ENERGY',
                price: 0.35,
                tax: 19,
                step_size: 1
            }]
    }],
    alt_text: [{
        language: 'EN',
        text: '$0.35 / kWh + Tax'
    }],
    country_code: 'US',
    alt_url: 'https://yoursite.com/rate-Id-X-details.html',
    active: true
})
.then(res => console.log(res))
.catch(err => console.error(err));

Sample Response

//Sample Response
{
  "ok": true,
  "message": "string",
  "result": {
    "country_code": "US",
    "party_id": "EDRV",
    "currency": "USD",
    "elements": [{
        "price_components": [
          {
            "type": "ENERGY",
            "price": 0.35,
            "tax": 19,
            "step_size": 1
          }]
      }],
    "alt_text": [
      {
        "language": "EN",
        "text": "$0.35 / kWh + Tax"
      }
    ],
    "alt_url": "https://yoursite.com/rate-Id-X-details.html",
    "active": true
  }
}

Sample Request

const eDRV = require('eDRV');
eDRV.auth('Access-Token');

//Start a new transaction
await eDRV.remotestart({
  chargestation: '5fca57b3fbfcc320b3b03f22',
  connector: '5fca57b3fbfcc320b3b03f23',
  user: '5fca57b3fbfcc320b3b03f24',
  token: '5fca57b3fbfcc320b3b03f25'
});

//Stop a charging transaction
await eDRV.remotestop({
  chargestation: '5fca57b3fbfcc320b3b03f22',
  user: '5fca57b3fbfcc320b3b03f24',
  transaction: '5fca57b3fbfcc320b3b03f27'
});

Sample Response

//Sample Response
{
  "ok": true,
  "message": "string",
  "result": {
    "chargestation": "5fca57b3fbfcc320b3b03f22",
    "connector": "5fca57b3fbfcc320b3b03f23",
    "user": "5fca57b3fbfcc320b3b03f24",
    "token": "5fca57b3fbfcc320b3b03f25",
    "type": "RemoteStart or RemoteStop",
    "status": "CSAccepted",
    "data": {
      "remoteStartId": 1627036902000
    }
  }
}

Sample Request

const eDRV = require('eDRV');
eDRV.auth('Access-Token');

//Reserve a connector for a user
await eDRV.reserve({
  chargestation: '5fca57b3fbfcc320b3b03f22',
  connector: '5fca57b3fbfcc320b3b03f23',
  token: '5fca57b3fbfcc320b3b03f25',
  user: '5fca57b3fbfcc320b3b03f24',
  endDate: '2021-07-13T16:19:50.340Z'
});

Sample Response

//Sample Response
{
  "ok": true,
  "message": "string",
  "result": {
  "chargestation": "5fca57b3fbfcc320b3b03f22",
  "connector": "5fca57b3fbfcc320b3b03f23",
  "token": "5fca57b3fbfcc320b3b03f25",
  "user": "5fca57b3fbfcc320b3b03f24",
  "endDate": "2021-07-13T16:19:50.340Z"
  }
}

Sample Request

const eDRV = require('eDRV');
eDRV.auth('Access-Token');

//Get a specific Transaction
await eDRV.getTransaction({id: '6102bf6480898d08d80e25ec'});

Sample Response

//Sample Response
{
  "ok": true,
  "message": "string",
  "result": {
      "_id": "6102bf6480898d08d80e25ec",
      "ocppId": "1625756014",
      "status": "Started",
      "evse": "5f72f55431a6770a131db278",
      "connector": "5f72f55431a6770a131db279",
      "token": "60e7116af7c0cc219aa71289",
      "user": "603763d392204c0c840578be",
      "chargestation": "5f72f55431a6770a131db277",
      "rate": "60c21597a2387d4a64952720",
      "stripe_customer": {
        "email": "user@email.com"
      },
      "cost": {
        "amount": 2.55,
        "currency": "usd"
      },
      "paidAt": "2021-07-08T14:56:47.528Z",
      "paid": true,
      "link_emailed": true,
      "metrics": {
        "chargingStart": "2021-07-08T14:56:47.528Z",
        "chargingStop": "2021-07-08T14:55:55.000Z",
        "timeSpentCharging": 2476,
        "wattHoursConsumed": 4406,
        "meterValue": {
          "timestamp": "2021-07-08T14:55:33Z",
          "Current.Import": {
            "value": "31.16",
            "unit": "A"
          },
          "Power.Active.Import": {
            "value": "7.018",
            "unit": "kW"
          },
          "Voltage": {
            "value": "226.60",
            "unit": "V"
          },
          "Energy.Active.Import.Register": {
            "value": "15.830",
            "unit": "kWh"
          }
        }
      }
    }
}

Sample Request

const eDRV = require('eDRV');
eDRV.auth('Access-Token');

//Set Power or Current limits on a Trasaction
await eDRV.setchargingprofile({
    transaction: '5fca57b3fbfcc320b3b03f22', 
    unit: 'A',
    limit: 12});

Sample Response

//Sample Response
{
  "ok": true,
  "message": "string",
  "result": {
    "profile": 1627038803,
  }
}

Integrations made easy

Use our off-the-shelf integrations to boost your network's functionality or use our publicly available APIs to build your own. eDRV provides you with the tools you need to make the most of EV charging. We are adding new integrations all the time, so please be sure to check again later

OCPP Connectivity via APIs

Choose Any OCPP Charging Station

With eDRV you can avoid implementing OCPP in house and connect with any charging station using our APIs. Check to see if your charging station has been added to our growing list of suppliers.

Talk to us

Request a no-obligation demo and get access to a trial account to find out how eDRV can help your business.
request a consultation

RECENT BLOG POSTS

Payment Links for EV Charging
Arjun Harindranath
April 3, 2023
New Face. Same Drive.
Rupul Safaya
December 19, 2022