Skip to main content
POST
/
costs
/
instant
Instantly calculate energy cost
curl --request POST \
  --url https://api.flatpeak.com/costs/instant \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "location_id": "loc_641b90b758fb8e6293716e40",
  "device_id": "dev_65e6d8334c8d715963d99db3",
  "session_reference_id": "SESSION1234567890",
  "record_reference_id": "MET1234567890",
  "direction": "IMPORT",
  "tariff_rate": "IMPORT",
  "measurand": "TRANSFERRED",
  "units": "W",
  "confidence": 1,
  "value": 20567,
  "start_time": "2022-02-01T10:30:00Z",
  "end_time": "2022-02-01T11:00:00Z"
}'
{
  "id": "mre_65e641b570b2901d3a40199d",
  "object": "meter_record",
  "live_mode": true,
  "direction": "IMPORT",
  "tariff_rate": "IMPORT",
  "currency_code": "GBP",
  "energy_units": "WH",
  "carbon_units": "gCO2eq",
  "request": {
    "location_id": "loc_641b90b758fb8e6293716e40",
    "device_id": "dev_65e6d8334c8d715963d99db3",
    "session_reference_id": "SESSION1234567890",
    "record_reference_id": "MET1234567890",
    "direction": "IMPORT",
    "tariff_rate": "IMPORT",
    "measurand": "TRANSFERRED",
    "units": "W",
    "confidence": 1,
    "value": 20567,
    "start_time": "2022-02-01T10:30:00Z",
    "end_time": "2022-02-01T11:00:00Z",
    "non_persistent": false
  },
  "data": {
    "start_time": "2022-02-01T10:30:00Z",
    "end_time": "2022-02-01T11:00:00Z",
    "session_reference_id": "SESSION1234567890",
    "record_reference_id": "MET1234567890",
    "energy": {
      "value": 10284
    },
    "tariff": {
      "value": 928.372,
      "confidence": 1
    },
    "carbon": {
      "value": 35.24,
      "confidence": 0.8
    }
  },
  "time_created": "2022-02-01T10:33:00Z",
  "account_id": "acc_661677911f2197045e6cf1b1"
}

Authorizations

Authorization
string
header
required

Query Parameters

include_tariff
boolean
include_carbon
boolean
non_persistent
boolean

Body

application/json
location_id
string
required
Example:
units
string
required
Example:
value
number
required
Example:
start_time
string
required
Example:
end_time
string
required
Example:
device_id
string
Example:
session_reference_id
string
Example:
record_reference_id
string
Example:
direction
string
Example:
tariff_rate
string
Example:
measurand
string
Example:
confidence
number
Example:

Response

id
string
required
Example:
object
string
required
Example:
live_mode
boolean
required
direction
string
required
Example:
tariff_rate
string
required
Example:
currency_code
string
required
Example:
energy_units
string
required
Example:
carbon_units
string
required
Example:
request
object
required
data
object
required
time_created
string
required
Example:
account_id
string
Example: