PUT
/
meters
/
cumulative
/
epoch
curl --request PUT \
  --url https://api.flatpeak.com/meters/cumulative/epoch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "location_id": "loc_641b90b758fb8e6293716e40",
  "device_id": "dev_65e6d8334c8d715963d99db3",
  "session_reference_id": "SESSION1234567890",
  "direction": "IMPORT",
  "tariff_rate": "IMPORT",
  "units": "WH",
  "data": [
    {
      "time": 1721991392,
      "value": 1553,
      "record_reference_id": "MET1234567890"
    }
  ]
}'
{
  "id": "bat_65e42b7827c0526548432b9f",
  "object": "meter_batch",
  "records_submitted": 18379,
  "records_accepted": 18378,
  "records_processed": 32,
  "failed_records": [
    {
      "record_num": 1,
      "record_reference_id": "MET1234567890",
      "error": "end_time must not be before start_time"
    }
  ],
  "time_created": "2023-11-07T05:31:56Z",
  "account_id": "acc_661677911f2197045e6cf1b1"
}

Authorizations

Authorization
string
header
required

Authenticate with bearer_token you obtained from /login endpoint.

Body

application/json
location_id
string
required

FlatPeak location_id that you are submitting metering records for.

Example:

"loc_641b90b758fb8e6293716e40"

units
string
required

Units of measure, supported values are WH, KWH.

Example:

"WH"

data
object[]
required

Metering data array

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 attributed to device_id.

Example:

"dev_65e6d8334c8d715963d99db3"

session_reference_id
string

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

Example:

"SESSION1234567890"

direction
string

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

Example:

"IMPORT"

tariff_rate
string

Indicates tariff direction. Set to IMPORT, EXPORT or LOCAL. Defaults to match the direction parameter.

Example:

"IMPORT"

Response

200
application/json
id
string

FlatPeak ID for this submission.

Example:

"bat_65e42b7827c0526548432b9f"

object
string

Object name, i.e. meter_batch.

Example:

"meter_batch"

records_submitted
integer

Number of received metering records.

Example:

18379

records_accepted
integer

Number of accepted metering records.

Example:

18378

records_processed
integer

Number of processed metering records.

Example:

32

failed_records
object[]

Returns details of any meter records that failed processing

time_created
string

Time when this object was created. In UTC.

Example:

"2023-11-07T05:31:56Z"

account_id
string

FlatPeak account ID.

Example:

"acc_661677911f2197045e6cf1b1"