Skip to main content
POST
/
meter-readings
Create a meter reading
curl --request POST \
  --url https://api.nomos.energy/meter-readings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "value": 150,
  "timestamp": "2024-03-14T12:00:00Z",
  "subscription": "sub_rocbrf1u5e48mm0reeqoag90",
  "message": "Reading to start the subscription"
}
'
import requests

url = "https://api.nomos.energy/meter-readings"

payload = {
    "value": 150,
    "timestamp": "2024-03-14T12:00:00Z",
    "subscription": "sub_rocbrf1u5e48mm0reeqoag90",
    "message": "Reading to start the subscription"
}
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({
    value: 150,
    timestamp: '2024-03-14T12:00:00Z',
    subscription: 'sub_rocbrf1u5e48mm0reeqoag90',
    message: 'Reading to start the subscription'
  })
};

fetch('https://api.nomos.energy/meter-readings', 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://api.nomos.energy/meter-readings",
  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([
    'value' => 150,
    'timestamp' => '2024-03-14T12:00:00Z',
    'subscription' => 'sub_rocbrf1u5e48mm0reeqoag90',
    'message' => 'Reading to start the subscription'
  ]),
  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://api.nomos.energy/meter-readings"

	payload := strings.NewReader("{\n  \"value\": 150,\n  \"timestamp\": \"2024-03-14T12:00:00Z\",\n  \"subscription\": \"sub_rocbrf1u5e48mm0reeqoag90\",\n  \"message\": \"Reading to start the subscription\"\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://api.nomos.energy/meter-readings")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"value\": 150,\n  \"timestamp\": \"2024-03-14T12:00:00Z\",\n  \"subscription\": \"sub_rocbrf1u5e48mm0reeqoag90\",\n  \"message\": \"Reading to start the subscription\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.nomos.energy/meter-readings")

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  \"value\": 150,\n  \"timestamp\": \"2024-03-14T12:00:00Z\",\n  \"subscription\": \"sub_rocbrf1u5e48mm0reeqoag90\",\n  \"message\": \"Reading to start the subscription\"\n}"

response = http.request(request)
puts response.read_body
{
  "object": "meter_reading",
  "id": "mr_rocbrf1u5e48mm0reeqoag90",
  "customer": "cus_a8n8ol7yd4h0wohx824f0bui",
  "subscription": "sub_rocbrf1u5e48mm0reeqoag90",
  "meter": "mtr_azk4zue2ijx4ff1dbjt14m5h",
  "value": 150,
  "timestamp": "2023-11-07T05:31:56Z",
  "type": "customer_report",
  "created_at": "2023-11-07T05:31:56Z"
}
{
  "code": "BAD_REQUEST",
  "message": "invalid_type in 'end': Required",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/BAD_REQUEST",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "UNAUTHORIZED",
  "message": "Invalid or malformed token",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/UNAUTHORIZED",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "PAYMENT_REQUIRED",
  "message": "Payment required",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/PAYMENT_REQUIRED",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "FORBIDDEN",
  "message": "You are not allowed to access this resource",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/FORBIDDEN",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "NOT_FOUND",
  "message": "Resource not found",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/NOT_FOUND",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "METHOD_NOT_ALLOWED",
  "message": "Method not allowed",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/METHOD_NOT_ALLOWED",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "CONFLICT",
  "message": "Resource already exists",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/CONFLICT",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "UNPROCESSABLE_ENTITY",
  "message": "invalid_enum_value in 'status': Invalid enum value. Expected 'pending' | 'active' | 'ended'",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/UNPROCESSABLE_ENTITY",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "TOO_MANY_REQUESTS",
  "message": "Wait 30 seconds before retrying.",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/TOO_MANY_REQUESTS",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal Server Error",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/INTERNAL_SERVER_ERROR",
  "errors": [
    {
      "code": "invalid_type",
      "field": "favoriteNumbers.1",
      "message": "Invalid input: expected string, received number"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Meter reading input

value
number
required

Cumulative meter value in kWh

Required range: x > 0
Example:

150

timestamp
string<date-time>
required

Timestamp of the reading in UTC

Example:

"2024-03-14T12:00:00Z"

subscription
string
required

The subscription the meter reading belongs to

Example:

"sub_rocbrf1u5e48mm0reeqoag90"

message
string

Optional message from the submitter

Maximum string length: 500
Example:

"Reading to start the subscription"

Response

Meter reading accepted

object
enum<string>
required
Available options:
meter_reading
id
string
required

The unique identifier for the meter reading

Example:

"mr_rocbrf1u5e48mm0reeqoag90"

customer
string
required

The unique identifier for the customer

Example:

"cus_a8n8ol7yd4h0wohx824f0bui"

subscription
string
required

The unique identifier for the subscription

Example:

"sub_rocbrf1u5e48mm0reeqoag90"

meter
string
required

The unique identifier for the meter

Example:

"mtr_azk4zue2ijx4ff1dbjt14m5h"

value
number
required

The value of the meter reading

Example:

150

timestamp
string<date-time>
required

Timestamp get's always adjusted to the start of the day in Europe/Berlin

type
enum<string>
required

The type of the meter reading

Available options:
customer_report,
grid_reading,
grid_estimation
Example:

"customer_report"

created_at
string<date-time>
required