POST
/
costs
/
instant
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",
  "measurand": "TRANSFERRED",
  "units": "W",
  "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",
  "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",
    "measurand": "TRANSFERRED",
    "units": "W",
    "value": 20567,
    "start_time": "2022-02-01T10:30:00Z",
    "end_time": "2022-02-01T11:00:00Z"
  },
  "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"
}

Authorizations

Authorization
string
headerrequired

Authenticate with bearer_token you obtained from /login endpoint.

Query Parameters

direction
string
default: IMPORT

Indicates direction you want to work with. Set to IMPORT or EXPORT.

include_tariff
boolean

Set to true if you want to include tariff data.

include_carbon
boolean

Set to true if you want to include carbon intensity data.

Body

application/json
location_id
string
required

FlatPeak location_id that you are submitting metering records for.

device_id
string

FlatPeak device_id you are submitting metering records for. If you provided both location_id and device_id your records will be attribited to device_id.

session_reference_id
string

A reference for a group of metering records, for example, a charging session ID.

record_reference_id
string

A reference for this metering record, for example, meter log ID.

direction
string

Indicates metering direction. Set to IMPORT or EXPORT. Defaults to IMPORT.

measurand
string

Possible options are OFFERED or TRANSFERRED. Currently only TRANSFERRED is supported.

units
string
required

Units of measure, supported values are W, KW, WH, KWH.

value
number
required

Amount of energy measured.

start_time
string
required

Metering record start time.

end_time
string
required

Metering record end time.

Response

200 - application/json
id
string
required

FlatPeak meter record id.

object
string
required

FlatPeak object type, i.e. meter_record.

live_mode
boolean
required

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

direction
string
required

Indicates energy direction. Supported values are IMPORT and EXPORT.

currency_code
string
required

Currency code for cost of energy measure. Always returned in large currency units.

energy_units
string
required

Units of energy measure.

carbon_units
string
required

Units of carbon emissions measure.

request
object
required
data
object
required

Value of energy object

time_created
string
required

Time when this object was created.