Submit device meter records
curl --request POST \
--url https://energy-api.flatpeak.com/devices/{device_id}/meter-records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"basis": "INTERVAL",
"data": [
{
"source": "PV",
"destination": "BATTERY",
"start_time": "2026-02-01T10:30:00Z",
"end_time": "2026-02-01T11:00:00Z",
"energy_kwh": 1.23456
}
],
"session_reference_id": "SESSION1234567890"
}
'import requests
url = "https://energy-api.flatpeak.com/devices/{device_id}/meter-records"
payload = {
"basis": "INTERVAL",
"data": [
{
"source": "PV",
"destination": "BATTERY",
"start_time": "2026-02-01T10:30:00Z",
"end_time": "2026-02-01T11:00:00Z",
"energy_kwh": 1.23456
}
],
"session_reference_id": "SESSION1234567890"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
basis: 'INTERVAL',
data: [
{
source: 'PV',
destination: 'BATTERY',
start_time: '2026-02-01T10:30:00Z',
end_time: '2026-02-01T11:00:00Z',
energy_kwh: 1.23456
}
],
session_reference_id: 'SESSION1234567890'
})
};
fetch('https://energy-api.flatpeak.com/devices/{device_id}/meter-records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://energy-api.flatpeak.com/devices/{device_id}/meter-records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'basis' => 'INTERVAL',
'data' => [
[
'source' => 'PV',
'destination' => 'BATTERY',
'start_time' => '2026-02-01T10:30:00Z',
'end_time' => '2026-02-01T11:00:00Z',
'energy_kwh' => 1.23456
]
],
'session_reference_id' => 'SESSION1234567890'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://energy-api.flatpeak.com/devices/{device_id}/meter-records"
payload := strings.NewReader("{\n \"basis\": \"INTERVAL\",\n \"data\": [\n {\n \"source\": \"PV\",\n \"destination\": \"BATTERY\",\n \"start_time\": \"2026-02-01T10:30:00Z\",\n \"end_time\": \"2026-02-01T11:00:00Z\",\n \"energy_kwh\": 1.23456\n }\n ],\n \"session_reference_id\": \"SESSION1234567890\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://energy-api.flatpeak.com/devices/{device_id}/meter-records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"basis\": \"INTERVAL\",\n \"data\": [\n {\n \"source\": \"PV\",\n \"destination\": \"BATTERY\",\n \"start_time\": \"2026-02-01T10:30:00Z\",\n \"end_time\": \"2026-02-01T11:00:00Z\",\n \"energy_kwh\": 1.23456\n }\n ],\n \"session_reference_id\": \"SESSION1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://energy-api.flatpeak.com/devices/{device_id}/meter-records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"basis\": \"INTERVAL\",\n \"data\": [\n {\n \"source\": \"PV\",\n \"destination\": \"BATTERY\",\n \"start_time\": \"2026-02-01T10:30:00Z\",\n \"end_time\": \"2026-02-01T11:00:00Z\",\n \"energy_kwh\": 1.23456\n }\n ],\n \"session_reference_id\": \"SESSION1234567890\"\n}"
response = http.request(request)
puts response.read_body{
"id": "mbr_65e42b7827c0526548432b9f",
"object": "meter_batch",
"records_submitted": 18379,
"records_accepted": 18378,
"records_processed": 32,
"account_id": "acc_661677911f2197045e6cf1b1",
"time_created": "2026-11-07T05:31:56Z",
"failed_records": [
{
"record_num": 1,
"error": "end_time must not be before start_time"
}
]
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}Meter records
Submit device meter records
Submits meter records for a meter on the device. Set basis to INTERVAL for energy per period or CUMULATIVE for register readings.
POST
/
devices
/
{device_id}
/
meter-records
Submit device meter records
curl --request POST \
--url https://energy-api.flatpeak.com/devices/{device_id}/meter-records \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"basis": "INTERVAL",
"data": [
{
"source": "PV",
"destination": "BATTERY",
"start_time": "2026-02-01T10:30:00Z",
"end_time": "2026-02-01T11:00:00Z",
"energy_kwh": 1.23456
}
],
"session_reference_id": "SESSION1234567890"
}
'import requests
url = "https://energy-api.flatpeak.com/devices/{device_id}/meter-records"
payload = {
"basis": "INTERVAL",
"data": [
{
"source": "PV",
"destination": "BATTERY",
"start_time": "2026-02-01T10:30:00Z",
"end_time": "2026-02-01T11:00:00Z",
"energy_kwh": 1.23456
}
],
"session_reference_id": "SESSION1234567890"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
basis: 'INTERVAL',
data: [
{
source: 'PV',
destination: 'BATTERY',
start_time: '2026-02-01T10:30:00Z',
end_time: '2026-02-01T11:00:00Z',
energy_kwh: 1.23456
}
],
session_reference_id: 'SESSION1234567890'
})
};
fetch('https://energy-api.flatpeak.com/devices/{device_id}/meter-records', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://energy-api.flatpeak.com/devices/{device_id}/meter-records",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'basis' => 'INTERVAL',
'data' => [
[
'source' => 'PV',
'destination' => 'BATTERY',
'start_time' => '2026-02-01T10:30:00Z',
'end_time' => '2026-02-01T11:00:00Z',
'energy_kwh' => 1.23456
]
],
'session_reference_id' => 'SESSION1234567890'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://energy-api.flatpeak.com/devices/{device_id}/meter-records"
payload := strings.NewReader("{\n \"basis\": \"INTERVAL\",\n \"data\": [\n {\n \"source\": \"PV\",\n \"destination\": \"BATTERY\",\n \"start_time\": \"2026-02-01T10:30:00Z\",\n \"end_time\": \"2026-02-01T11:00:00Z\",\n \"energy_kwh\": 1.23456\n }\n ],\n \"session_reference_id\": \"SESSION1234567890\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://energy-api.flatpeak.com/devices/{device_id}/meter-records")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"basis\": \"INTERVAL\",\n \"data\": [\n {\n \"source\": \"PV\",\n \"destination\": \"BATTERY\",\n \"start_time\": \"2026-02-01T10:30:00Z\",\n \"end_time\": \"2026-02-01T11:00:00Z\",\n \"energy_kwh\": 1.23456\n }\n ],\n \"session_reference_id\": \"SESSION1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://energy-api.flatpeak.com/devices/{device_id}/meter-records")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"basis\": \"INTERVAL\",\n \"data\": [\n {\n \"source\": \"PV\",\n \"destination\": \"BATTERY\",\n \"start_time\": \"2026-02-01T10:30:00Z\",\n \"end_time\": \"2026-02-01T11:00:00Z\",\n \"energy_kwh\": 1.23456\n }\n ],\n \"session_reference_id\": \"SESSION1234567890\"\n}"
response = http.request(request)
puts response.read_body{
"id": "mbr_65e42b7827c0526548432b9f",
"object": "meter_batch",
"records_submitted": 18379,
"records_accepted": 18378,
"records_processed": 32,
"account_id": "acc_661677911f2197045e6cf1b1",
"time_created": "2026-11-07T05:31:56Z",
"failed_records": [
{
"record_num": 1,
"error": "end_time must not be before start_time"
}
]
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}{
"object": "error",
"type": "invalid_request",
"code": "not_found",
"message": "The requested resource could not be found.",
"context": "api.price_get",
"live_mode": true,
"time_created": "2026-01-01T00:00:00Z"
}Body
application/json
Response
200 OK: the status of a submitted meter record batch.
Was this page helpful?

