Create a lead
curl --request POST \
--url https://api.nomos.energy/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"plan": "pln_mi4f0oda6x9m7gcsvjk0ole1",
"address": {
"zip": "10115",
"street": "Torstraße",
"city": "Berlin",
"house_number": "119"
},
"meter": {
"estimated_usage": 2500,
"type": "smart",
"number": "1APA0195124010"
},
"customer": {
"type": "person",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
},
"payment_method": {
"type": "sepa_debit",
"sepa_debit": {
"iban": "DE68500105178297336485",
"account_holder": "John Doe"
}
},
"previous_supplier": "mp_mi4f0oda6x9m7gcsvjk0ole1",
"next_possible_start": true,
"intended_start_date": "2024-01-01",
"change_reason": "supplier_change",
"created_by": "john.doe@example.com",
"metadata": {
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
}
'import requests
url = "https://api.nomos.energy/leads"
payload = {
"plan": "pln_mi4f0oda6x9m7gcsvjk0ole1",
"address": {
"zip": "10115",
"street": "Torstraße",
"city": "Berlin",
"house_number": "119"
},
"meter": {
"estimated_usage": 2500,
"type": "smart",
"number": "1APA0195124010"
},
"customer": {
"type": "person",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
},
"payment_method": {
"type": "sepa_debit",
"sepa_debit": {
"iban": "DE68500105178297336485",
"account_holder": "John Doe"
}
},
"previous_supplier": "mp_mi4f0oda6x9m7gcsvjk0ole1",
"next_possible_start": True,
"intended_start_date": "2024-01-01",
"change_reason": "supplier_change",
"created_by": "john.doe@example.com",
"metadata": {
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
}
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({
plan: 'pln_mi4f0oda6x9m7gcsvjk0ole1',
address: {zip: '10115', street: 'Torstraße', city: 'Berlin', house_number: '119'},
meter: {estimated_usage: 2500, type: 'smart', number: '1APA0195124010'},
customer: {
type: 'person',
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com'
},
payment_method: {
type: 'sepa_debit',
sepa_debit: {iban: 'DE68500105178297336485', account_holder: 'John Doe'}
},
previous_supplier: 'mp_mi4f0oda6x9m7gcsvjk0ole1',
next_possible_start: true,
intended_start_date: '2024-01-01',
change_reason: 'supplier_change',
created_by: 'john.doe@example.com',
metadata: {utm_source: 'google', utm_campaign: 'campaign_name', user_id: '1234567890'}
})
};
fetch('https://api.nomos.energy/leads', 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/leads",
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([
'plan' => 'pln_mi4f0oda6x9m7gcsvjk0ole1',
'address' => [
'zip' => '10115',
'street' => 'Torstraße',
'city' => 'Berlin',
'house_number' => '119'
],
'meter' => [
'estimated_usage' => 2500,
'type' => 'smart',
'number' => '1APA0195124010'
],
'customer' => [
'type' => 'person',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com'
],
'payment_method' => [
'type' => 'sepa_debit',
'sepa_debit' => [
'iban' => 'DE68500105178297336485',
'account_holder' => 'John Doe'
]
],
'previous_supplier' => 'mp_mi4f0oda6x9m7gcsvjk0ole1',
'next_possible_start' => true,
'intended_start_date' => '2024-01-01',
'change_reason' => 'supplier_change',
'created_by' => 'john.doe@example.com',
'metadata' => [
'utm_source' => 'google',
'utm_campaign' => 'campaign_name',
'user_id' => '1234567890'
]
]),
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/leads"
payload := strings.NewReader("{\n \"plan\": \"pln_mi4f0oda6x9m7gcsvjk0ole1\",\n \"address\": {\n \"zip\": \"10115\",\n \"street\": \"Torstraße\",\n \"city\": \"Berlin\",\n \"house_number\": \"119\"\n },\n \"meter\": {\n \"estimated_usage\": 2500,\n \"type\": \"smart\",\n \"number\": \"1APA0195124010\"\n },\n \"customer\": {\n \"type\": \"person\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\"\n },\n \"payment_method\": {\n \"type\": \"sepa_debit\",\n \"sepa_debit\": {\n \"iban\": \"DE68500105178297336485\",\n \"account_holder\": \"John Doe\"\n }\n },\n \"previous_supplier\": \"mp_mi4f0oda6x9m7gcsvjk0ole1\",\n \"next_possible_start\": true,\n \"intended_start_date\": \"2024-01-01\",\n \"change_reason\": \"supplier_change\",\n \"created_by\": \"john.doe@example.com\",\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"campaign_name\",\n \"user_id\": \"1234567890\"\n }\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/leads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": \"pln_mi4f0oda6x9m7gcsvjk0ole1\",\n \"address\": {\n \"zip\": \"10115\",\n \"street\": \"Torstraße\",\n \"city\": \"Berlin\",\n \"house_number\": \"119\"\n },\n \"meter\": {\n \"estimated_usage\": 2500,\n \"type\": \"smart\",\n \"number\": \"1APA0195124010\"\n },\n \"customer\": {\n \"type\": \"person\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\"\n },\n \"payment_method\": {\n \"type\": \"sepa_debit\",\n \"sepa_debit\": {\n \"iban\": \"DE68500105178297336485\",\n \"account_holder\": \"John Doe\"\n }\n },\n \"previous_supplier\": \"mp_mi4f0oda6x9m7gcsvjk0ole1\",\n \"next_possible_start\": true,\n \"intended_start_date\": \"2024-01-01\",\n \"change_reason\": \"supplier_change\",\n \"created_by\": \"john.doe@example.com\",\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"campaign_name\",\n \"user_id\": \"1234567890\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nomos.energy/leads")
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 \"plan\": \"pln_mi4f0oda6x9m7gcsvjk0ole1\",\n \"address\": {\n \"zip\": \"10115\",\n \"street\": \"Torstraße\",\n \"city\": \"Berlin\",\n \"house_number\": \"119\"\n },\n \"meter\": {\n \"estimated_usage\": 2500,\n \"type\": \"smart\",\n \"number\": \"1APA0195124010\"\n },\n \"customer\": {\n \"type\": \"person\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\"\n },\n \"payment_method\": {\n \"type\": \"sepa_debit\",\n \"sepa_debit\": {\n \"iban\": \"DE68500105178297336485\",\n \"account_holder\": \"John Doe\"\n }\n },\n \"previous_supplier\": \"mp_mi4f0oda6x9m7gcsvjk0ole1\",\n \"next_possible_start\": true,\n \"intended_start_date\": \"2024-01-01\",\n \"change_reason\": \"supplier_change\",\n \"created_by\": \"john.doe@example.com\",\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"campaign_name\",\n \"user_id\": \"1234567890\"\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "lead",
"id": "lead_a8n8ol7yd4h0wohx824f0bui",
"link": "https://nomos.checkout.energy?id=lead_a8n8ol7yd4h0wohx824f0bui",
"created_at": "2024-03-14T12:00:00Z",
"subscription": "sub_a8n8ol7yd4h0wohx824f0bui",
"subscribed_at": "2024-03-14T12:00:00Z",
"created_by": "john.doe@example.com",
"last_visited_at": "2024-03-14T12:00:00Z",
"metadata": {
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
}Leads
Create a lead
This endpoint can be used to create a secure, pre-filled checkout link. The link (returned in the “link” property) contains all provided customer, address and meter data, allowing the prospect to finalize their signup with only providing the missing payment information, essentially enabling a 2-click checkout experience. Leads are tracked in the Nomos Dashboard for detailed conversion analytics. Leads can be created for both consumption and feed-in plans.
POST
/
leads
Create a lead
curl --request POST \
--url https://api.nomos.energy/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"plan": "pln_mi4f0oda6x9m7gcsvjk0ole1",
"address": {
"zip": "10115",
"street": "Torstraße",
"city": "Berlin",
"house_number": "119"
},
"meter": {
"estimated_usage": 2500,
"type": "smart",
"number": "1APA0195124010"
},
"customer": {
"type": "person",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
},
"payment_method": {
"type": "sepa_debit",
"sepa_debit": {
"iban": "DE68500105178297336485",
"account_holder": "John Doe"
}
},
"previous_supplier": "mp_mi4f0oda6x9m7gcsvjk0ole1",
"next_possible_start": true,
"intended_start_date": "2024-01-01",
"change_reason": "supplier_change",
"created_by": "john.doe@example.com",
"metadata": {
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
}
'import requests
url = "https://api.nomos.energy/leads"
payload = {
"plan": "pln_mi4f0oda6x9m7gcsvjk0ole1",
"address": {
"zip": "10115",
"street": "Torstraße",
"city": "Berlin",
"house_number": "119"
},
"meter": {
"estimated_usage": 2500,
"type": "smart",
"number": "1APA0195124010"
},
"customer": {
"type": "person",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com"
},
"payment_method": {
"type": "sepa_debit",
"sepa_debit": {
"iban": "DE68500105178297336485",
"account_holder": "John Doe"
}
},
"previous_supplier": "mp_mi4f0oda6x9m7gcsvjk0ole1",
"next_possible_start": True,
"intended_start_date": "2024-01-01",
"change_reason": "supplier_change",
"created_by": "john.doe@example.com",
"metadata": {
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
}
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({
plan: 'pln_mi4f0oda6x9m7gcsvjk0ole1',
address: {zip: '10115', street: 'Torstraße', city: 'Berlin', house_number: '119'},
meter: {estimated_usage: 2500, type: 'smart', number: '1APA0195124010'},
customer: {
type: 'person',
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com'
},
payment_method: {
type: 'sepa_debit',
sepa_debit: {iban: 'DE68500105178297336485', account_holder: 'John Doe'}
},
previous_supplier: 'mp_mi4f0oda6x9m7gcsvjk0ole1',
next_possible_start: true,
intended_start_date: '2024-01-01',
change_reason: 'supplier_change',
created_by: 'john.doe@example.com',
metadata: {utm_source: 'google', utm_campaign: 'campaign_name', user_id: '1234567890'}
})
};
fetch('https://api.nomos.energy/leads', 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/leads",
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([
'plan' => 'pln_mi4f0oda6x9m7gcsvjk0ole1',
'address' => [
'zip' => '10115',
'street' => 'Torstraße',
'city' => 'Berlin',
'house_number' => '119'
],
'meter' => [
'estimated_usage' => 2500,
'type' => 'smart',
'number' => '1APA0195124010'
],
'customer' => [
'type' => 'person',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com'
],
'payment_method' => [
'type' => 'sepa_debit',
'sepa_debit' => [
'iban' => 'DE68500105178297336485',
'account_holder' => 'John Doe'
]
],
'previous_supplier' => 'mp_mi4f0oda6x9m7gcsvjk0ole1',
'next_possible_start' => true,
'intended_start_date' => '2024-01-01',
'change_reason' => 'supplier_change',
'created_by' => 'john.doe@example.com',
'metadata' => [
'utm_source' => 'google',
'utm_campaign' => 'campaign_name',
'user_id' => '1234567890'
]
]),
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/leads"
payload := strings.NewReader("{\n \"plan\": \"pln_mi4f0oda6x9m7gcsvjk0ole1\",\n \"address\": {\n \"zip\": \"10115\",\n \"street\": \"Torstraße\",\n \"city\": \"Berlin\",\n \"house_number\": \"119\"\n },\n \"meter\": {\n \"estimated_usage\": 2500,\n \"type\": \"smart\",\n \"number\": \"1APA0195124010\"\n },\n \"customer\": {\n \"type\": \"person\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\"\n },\n \"payment_method\": {\n \"type\": \"sepa_debit\",\n \"sepa_debit\": {\n \"iban\": \"DE68500105178297336485\",\n \"account_holder\": \"John Doe\"\n }\n },\n \"previous_supplier\": \"mp_mi4f0oda6x9m7gcsvjk0ole1\",\n \"next_possible_start\": true,\n \"intended_start_date\": \"2024-01-01\",\n \"change_reason\": \"supplier_change\",\n \"created_by\": \"john.doe@example.com\",\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"campaign_name\",\n \"user_id\": \"1234567890\"\n }\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/leads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plan\": \"pln_mi4f0oda6x9m7gcsvjk0ole1\",\n \"address\": {\n \"zip\": \"10115\",\n \"street\": \"Torstraße\",\n \"city\": \"Berlin\",\n \"house_number\": \"119\"\n },\n \"meter\": {\n \"estimated_usage\": 2500,\n \"type\": \"smart\",\n \"number\": \"1APA0195124010\"\n },\n \"customer\": {\n \"type\": \"person\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\"\n },\n \"payment_method\": {\n \"type\": \"sepa_debit\",\n \"sepa_debit\": {\n \"iban\": \"DE68500105178297336485\",\n \"account_holder\": \"John Doe\"\n }\n },\n \"previous_supplier\": \"mp_mi4f0oda6x9m7gcsvjk0ole1\",\n \"next_possible_start\": true,\n \"intended_start_date\": \"2024-01-01\",\n \"change_reason\": \"supplier_change\",\n \"created_by\": \"john.doe@example.com\",\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"campaign_name\",\n \"user_id\": \"1234567890\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nomos.energy/leads")
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 \"plan\": \"pln_mi4f0oda6x9m7gcsvjk0ole1\",\n \"address\": {\n \"zip\": \"10115\",\n \"street\": \"Torstraße\",\n \"city\": \"Berlin\",\n \"house_number\": \"119\"\n },\n \"meter\": {\n \"estimated_usage\": 2500,\n \"type\": \"smart\",\n \"number\": \"1APA0195124010\"\n },\n \"customer\": {\n \"type\": \"person\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"email\": \"john.doe@example.com\"\n },\n \"payment_method\": {\n \"type\": \"sepa_debit\",\n \"sepa_debit\": {\n \"iban\": \"DE68500105178297336485\",\n \"account_holder\": \"John Doe\"\n }\n },\n \"previous_supplier\": \"mp_mi4f0oda6x9m7gcsvjk0ole1\",\n \"next_possible_start\": true,\n \"intended_start_date\": \"2024-01-01\",\n \"change_reason\": \"supplier_change\",\n \"created_by\": \"john.doe@example.com\",\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"campaign_name\",\n \"user_id\": \"1234567890\"\n }\n}"
response = http.request(request)
puts response.read_body{
"object": "lead",
"id": "lead_a8n8ol7yd4h0wohx824f0bui",
"link": "https://nomos.checkout.energy?id=lead_a8n8ol7yd4h0wohx824f0bui",
"created_at": "2024-03-14T12:00:00Z",
"subscription": "sub_a8n8ol7yd4h0wohx824f0bui",
"subscribed_at": "2024-03-14T12:00:00Z",
"created_by": "john.doe@example.com",
"last_visited_at": "2024-03-14T12:00:00Z",
"metadata": {
"utm_source": "google",
"utm_campaign": "campaign_name",
"user_id": "1234567890"
}
}Authorizations
Body
application/json
The lead to create
Response
The created lead details
Was this page helpful?