curl --request GET \
--url https://api.nomos.energy/subscriptions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nomos.energy/subscriptions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nomos.energy/subscriptions/{id}', 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/subscriptions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nomos.energy/subscriptions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.nomos.energy/subscriptions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nomos.energy/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "subscription",
"id": "sub_rocbrf1u5e48mm0reeqoag90",
"plan": "pln_ctj3tjzc7dywznuw1dy80lb3",
"customer": {
"object": "customer",
"id": "cus_mi4f0oda6x9m7gcsvjk0ole1",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"created_at": "2024-03-14T12:00:00Z",
"type": "person",
"vat_id": "DE123456789"
},
"address": {
"object": "address",
"id": "adr_mi4f0oda6x9m7gcsvjk0ole1",
"street": "Torstraße",
"house_number": "119",
"zip": "10115",
"city": "Berlin",
"created_at": "2024-03-14T12:00:00Z"
},
"meter": {
"object": "meter",
"id": "mtr_tihqsqnxx3xs1gonbnk0ccou",
"number": "1APA0195124010",
"type": "smart",
"created_at": "2024-03-14T12:00:00Z",
"melo": "DE0000001234567890",
"malo": "50491310272"
},
"payment_method": {
"object": "payment_method",
"id": "pm_adc9utqqpcp7tx054l7vg56s2",
"type": "sepa_debit",
"sepa_debit": {
"iban": "DE************6485",
"account_holder": "John Doe"
},
"created_at": "2024-03-14T12:00:00Z"
},
"status": "active",
"estimated_usage": 123,
"created_at": "2024-03-14T12:00:00Z",
"updated_at": "2024-03-14T12:00:00Z",
"supplier": {
"object": "supplier",
"id": "mp_a0x6jm5h92wde6s5dnuvha4c",
"name": "Sample Energy GmbH",
"country": "DE",
"created_at": "2024-03-14T12:00:00Z"
},
"number": "4X44EMKX",
"start_at": "2024-03-14T12:00:00Z",
"terminated_at": "2024-03-14T12:00:00Z",
"end_at": "2024-03-14T12:00:00Z",
"metadata": {
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
}{
"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"
}{
"code": "UNAUTHORIZED",
"message": "Invalid or malformed token",
"requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
"docs": "https://docs.nomos.energy/api-references/errors/UNAUTHORIZED"
}{
"code": "PAYMENT_REQUIRED",
"message": "Payment required",
"requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
"docs": "https://docs.nomos.energy/api-references/errors/PAYMENT_REQUIRED"
}{
"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"
}{
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
"docs": "https://docs.nomos.energy/api-references/errors/NOT_FOUND"
}{
"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"
}{
"code": "CONFLICT",
"message": "Resource already exists",
"requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
"docs": "https://docs.nomos.energy/api-references/errors/CONFLICT"
}{
"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"
}{
"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"
}{
"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"
}Retrieve a subscription
Retrieve a subscription details by its id
curl --request GET \
--url https://api.nomos.energy/subscriptions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nomos.energy/subscriptions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nomos.energy/subscriptions/{id}', 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/subscriptions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nomos.energy/subscriptions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.nomos.energy/subscriptions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nomos.energy/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "subscription",
"id": "sub_rocbrf1u5e48mm0reeqoag90",
"plan": "pln_ctj3tjzc7dywznuw1dy80lb3",
"customer": {
"object": "customer",
"id": "cus_mi4f0oda6x9m7gcsvjk0ole1",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"created_at": "2024-03-14T12:00:00Z",
"type": "person",
"vat_id": "DE123456789"
},
"address": {
"object": "address",
"id": "adr_mi4f0oda6x9m7gcsvjk0ole1",
"street": "Torstraße",
"house_number": "119",
"zip": "10115",
"city": "Berlin",
"created_at": "2024-03-14T12:00:00Z"
},
"meter": {
"object": "meter",
"id": "mtr_tihqsqnxx3xs1gonbnk0ccou",
"number": "1APA0195124010",
"type": "smart",
"created_at": "2024-03-14T12:00:00Z",
"melo": "DE0000001234567890",
"malo": "50491310272"
},
"payment_method": {
"object": "payment_method",
"id": "pm_adc9utqqpcp7tx054l7vg56s2",
"type": "sepa_debit",
"sepa_debit": {
"iban": "DE************6485",
"account_holder": "John Doe"
},
"created_at": "2024-03-14T12:00:00Z"
},
"status": "active",
"estimated_usage": 123,
"created_at": "2024-03-14T12:00:00Z",
"updated_at": "2024-03-14T12:00:00Z",
"supplier": {
"object": "supplier",
"id": "mp_a0x6jm5h92wde6s5dnuvha4c",
"name": "Sample Energy GmbH",
"country": "DE",
"created_at": "2024-03-14T12:00:00Z"
},
"number": "4X44EMKX",
"start_at": "2024-03-14T12:00:00Z",
"terminated_at": "2024-03-14T12:00:00Z",
"end_at": "2024-03-14T12:00:00Z",
"metadata": {
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
}{
"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"
}{
"code": "UNAUTHORIZED",
"message": "Invalid or malformed token",
"requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
"docs": "https://docs.nomos.energy/api-references/errors/UNAUTHORIZED"
}{
"code": "PAYMENT_REQUIRED",
"message": "Payment required",
"requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
"docs": "https://docs.nomos.energy/api-references/errors/PAYMENT_REQUIRED"
}{
"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"
}{
"code": "NOT_FOUND",
"message": "Resource not found",
"requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
"docs": "https://docs.nomos.energy/api-references/errors/NOT_FOUND"
}{
"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"
}{
"code": "CONFLICT",
"message": "Resource already exists",
"requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
"docs": "https://docs.nomos.energy/api-references/errors/CONFLICT"
}{
"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"
}{
"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"
}{
"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"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
"sub_mi4f0oda6x9m7gcsvjk0ole1"
Response
Retrieve the subscription details
Type of the object, always 'subscription'
subscription Unique identifier for the subscription
"sub_rocbrf1u5e48mm0reeqoag90"
ID of the plan
"pln_ctj3tjzc7dywznuw1dy80lb3"
- Person
- Company
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Status of the subscription
pending, active, ended "active"
Estimated yearly usage in kWh, provided by the customer in the checkout.
Timestamp when the subscription was created
"2024-03-14T12:00:00Z"
Timestamp when the subscription was updated
"2024-03-14T12:00:00Z"
Show child attributes
Show child attributes
Human-readable identifier for the subscription
"4X44EMKX"
Timestamp when delivery was started / will start
"2024-03-14T12:00:00Z"
Timestamp when delivery was terminated
"2024-03-14T12:00:00Z"
Timestamp when the subscription was ended / will end
"2024-03-14T12:00:00Z"
Metadata of the subscription. Store any type of information, custom to your needs. E.g. the user_id of your in-house user. Restricted to 10KB.
Show child attributes
Show child attributes
{
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
Was this page helpful?