curl --request PATCH \
--url https://api.otark.energy/v1/customers/{customer_id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"metadata": {
"customer_number": "KD-2026-0815",
"cost_center": "CC-4200"
}
}
'import requests
url = "https://api.otark.energy/v1/customers/{customer_id}"
payload = { "metadata": {
"customer_number": "KD-2026-0815",
"cost_center": "CC-4200"
} }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadata: {customer_number: 'KD-2026-0815', cost_center: 'CC-4200'}})
};
fetch('https://api.otark.energy/v1/customers/{customer_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.otark.energy/v1/customers/{customer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'customer_number' => 'KD-2026-0815',
'cost_center' => 'CC-4200'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.otark.energy/v1/customers/{customer_id}"
payload := strings.NewReader("{\n \"metadata\": {\n \"customer_number\": \"KD-2026-0815\",\n \"cost_center\": \"CC-4200\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.patch("https://api.otark.energy/v1/customers/{customer_id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"customer_number\": \"KD-2026-0815\",\n \"cost_center\": \"CC-4200\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.otark.energy/v1/customers/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"customer_number\": \"KD-2026-0815\",\n \"cost_center\": \"CC-4200\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "cust_r8s9t0u1",
"name": "SolarDach GmbH",
"status": "active",
"balance_group": {
"eic": "11YSOLARDACH--A",
"tso": "DE_AMPRION"
},
"metadata": {
"customer_number": "KD-2026-0815",
"cost_center": "CC-4200",
"region": "NRW"
},
"assigned_at": "2026-01-10T09:00:00Z",
"created_at": "2026-01-10T09:00:00Z",
"activated_at": "2026-01-10T11:30:00Z"
}{
"type": "https://brp.otark.team/errors/validation",
"title": "Validation Failed",
"status": 400,
"instance": "/v1/customers/cust_r8s9t0u1",
"errors": [
{
"field": "balance_group.tso",
"code": "invalid_enum_value",
"message": "Invalid enum value. Expected 'DE_AMPRION' | 'DE_TENNET' | 'DE_TRANSNET_BW' | 'DE_50HERTZ', received 'INVALID'"
}
]
}{
"type": "https://brp.otark.team/errors/invalid_api_key",
"title": "Invalid API Key",
"status": 401
}{
"type": "https://brp.otark.team/errors/insufficient_scopes",
"title": "Insufficient API Key Scopes",
"status": 403,
"detail": "Missing scope: customers:write. Please create a new API key with the required scopes."
}{
"type": "https://brp.otark.team/errors/customer_not_found",
"title": "Customer Not Found",
"status": 404,
"instance": "/v1/customers/cust_r8s9t0u1"
}{
"type": "https://brp.otark.team/errors/already_active",
"title": "Customer Already Active",
"status": 409
}Update customer
Update a customer’s status, balance group, or metadata. Used to activate a pending customer, deactivate an existing one, change their balance group, or manage custom metadata. Metadata is merged on update — only provided keys are added or overwritten. Set a key’s value to null to remove it.
Required scope: customers:write
curl --request PATCH \
--url https://api.otark.energy/v1/customers/{customer_id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"metadata": {
"customer_number": "KD-2026-0815",
"cost_center": "CC-4200"
}
}
'import requests
url = "https://api.otark.energy/v1/customers/{customer_id}"
payload = { "metadata": {
"customer_number": "KD-2026-0815",
"cost_center": "CC-4200"
} }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({metadata: {customer_number: 'KD-2026-0815', cost_center: 'CC-4200'}})
};
fetch('https://api.otark.energy/v1/customers/{customer_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.otark.energy/v1/customers/{customer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'metadata' => [
'customer_number' => 'KD-2026-0815',
'cost_center' => 'CC-4200'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.otark.energy/v1/customers/{customer_id}"
payload := strings.NewReader("{\n \"metadata\": {\n \"customer_number\": \"KD-2026-0815\",\n \"cost_center\": \"CC-4200\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.patch("https://api.otark.energy/v1/customers/{customer_id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"customer_number\": \"KD-2026-0815\",\n \"cost_center\": \"CC-4200\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.otark.energy/v1/customers/{customer_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"customer_number\": \"KD-2026-0815\",\n \"cost_center\": \"CC-4200\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "cust_r8s9t0u1",
"name": "SolarDach GmbH",
"status": "active",
"balance_group": {
"eic": "11YSOLARDACH--A",
"tso": "DE_AMPRION"
},
"metadata": {
"customer_number": "KD-2026-0815",
"cost_center": "CC-4200",
"region": "NRW"
},
"assigned_at": "2026-01-10T09:00:00Z",
"created_at": "2026-01-10T09:00:00Z",
"activated_at": "2026-01-10T11:30:00Z"
}{
"type": "https://brp.otark.team/errors/validation",
"title": "Validation Failed",
"status": 400,
"instance": "/v1/customers/cust_r8s9t0u1",
"errors": [
{
"field": "balance_group.tso",
"code": "invalid_enum_value",
"message": "Invalid enum value. Expected 'DE_AMPRION' | 'DE_TENNET' | 'DE_TRANSNET_BW' | 'DE_50HERTZ', received 'INVALID'"
}
]
}{
"type": "https://brp.otark.team/errors/invalid_api_key",
"title": "Invalid API Key",
"status": 401
}{
"type": "https://brp.otark.team/errors/insufficient_scopes",
"title": "Insufficient API Key Scopes",
"status": 403,
"detail": "Missing scope: customers:write. Please create a new API key with the required scopes."
}{
"type": "https://brp.otark.team/errors/customer_not_found",
"title": "Customer Not Found",
"status": 404,
"instance": "/v1/customers/cust_r8s9t0u1"
}{
"type": "https://brp.otark.team/errors/already_active",
"title": "Customer Already Active",
"status": 409
}Authorizations
Path Parameters
Customer identifier
"cust_r8s9t0u1"
Body
Partial update for a customer. Metadata is merged — only provided keys are added or overwritten. Set a key to null to remove it. Sending read-only fields (id, name, assigned_at, activated_at, created_at) returns a read_only_field error.
New customer status
pending, active, deactivated A balance group assignment
Show child attributes
Show child attributes
Key-value pairs to merge into existing metadata
Show child attributes
Show child attributes
{
"customer_number": "KD-2026-0815",
"cost_center": "CC-4200"
}
Response
Updated customer
A customer assigned to the BRP
Unique customer identifier
"cust_r8s9t0u1"
Customer display name
"SolarDach GmbH"
Customer status
pending, active, deactivated "active"
A balance group assignment
Show child attributes
Show child attributes
BRP-defined key-value pairs (free-form)
Show child attributes
Show child attributes
{
"customer_number": "KD-2026-0815",
"cost_center": "CC-4200",
"region": "NRW"
}
ISO 8601 timestamp when the customer was assigned
"2026-01-10T09:00:00Z"
ISO 8601 creation timestamp
"2026-01-10T09:00:00Z"
ISO 8601 timestamp when the customer was activated
"2026-01-10T11:30:00Z"
Was this page helpful?