curl --request POST \
--url https://api.engrate.io/market-access/v1alpha1/structure \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"kind": "create.supplier-switch",
"supplier-switch": {
"accounting_point_market_identifier": "26611699793",
"accounting_point_type": "consumption",
"balance_group": "11XFC-CONS-----0",
"customer": {
"city": "<string>",
"country_code": "DE",
"house_number": "<string>",
"name": "<string>",
"postcode": "<string>",
"street": "<string>"
},
"effective_date": "2023-12-25",
"enfg_eligibility": {
"kind": "customer_qualifies",
"privilege_reasons": [
"ZU5"
]
},
"grid_operator": "9903123000007",
"market": "DE"
}
}
]
}
'import requests
url = "https://api.engrate.io/market-access/v1alpha1/structure"
payload = { "actions": [
{
"kind": "create.supplier-switch",
"supplier-switch": {
"accounting_point_market_identifier": "26611699793",
"accounting_point_type": "consumption",
"balance_group": "11XFC-CONS-----0",
"customer": {
"city": "<string>",
"country_code": "DE",
"house_number": "<string>",
"name": "<string>",
"postcode": "<string>",
"street": "<string>"
},
"effective_date": "2023-12-25",
"enfg_eligibility": {
"kind": "customer_qualifies",
"privilege_reasons": ["ZU5"]
},
"grid_operator": "9903123000007",
"market": "DE"
}
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
kind: 'create.supplier-switch',
'supplier-switch': {
accounting_point_market_identifier: '26611699793',
accounting_point_type: 'consumption',
balance_group: '11XFC-CONS-----0',
customer: {
city: '<string>',
country_code: 'DE',
house_number: '<string>',
name: '<string>',
postcode: '<string>',
street: '<string>'
},
effective_date: '2023-12-25',
enfg_eligibility: {kind: 'customer_qualifies', privilege_reasons: ['ZU5']},
grid_operator: '9903123000007',
market: 'DE'
}
}
]
})
};
fetch('https://api.engrate.io/market-access/v1alpha1/structure', 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.engrate.io/market-access/v1alpha1/structure",
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([
'actions' => [
[
'kind' => 'create.supplier-switch',
'supplier-switch' => [
'accounting_point_market_identifier' => '26611699793',
'accounting_point_type' => 'consumption',
'balance_group' => '11XFC-CONS-----0',
'customer' => [
'city' => '<string>',
'country_code' => 'DE',
'house_number' => '<string>',
'name' => '<string>',
'postcode' => '<string>',
'street' => '<string>'
],
'effective_date' => '2023-12-25',
'enfg_eligibility' => [
'kind' => 'customer_qualifies',
'privilege_reasons' => [
'ZU5'
]
],
'grid_operator' => '9903123000007',
'market' => 'DE'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.engrate.io/market-access/v1alpha1/structure"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"kind\": \"create.supplier-switch\",\n \"supplier-switch\": {\n \"accounting_point_market_identifier\": \"26611699793\",\n \"accounting_point_type\": \"consumption\",\n \"balance_group\": \"11XFC-CONS-----0\",\n \"customer\": {\n \"city\": \"<string>\",\n \"country_code\": \"DE\",\n \"house_number\": \"<string>\",\n \"name\": \"<string>\",\n \"postcode\": \"<string>\",\n \"street\": \"<string>\"\n },\n \"effective_date\": \"2023-12-25\",\n \"enfg_eligibility\": {\n \"kind\": \"customer_qualifies\",\n \"privilege_reasons\": [\n \"ZU5\"\n ]\n },\n \"grid_operator\": \"9903123000007\",\n \"market\": \"DE\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.post("https://api.engrate.io/market-access/v1alpha1/structure")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"kind\": \"create.supplier-switch\",\n \"supplier-switch\": {\n \"accounting_point_market_identifier\": \"26611699793\",\n \"accounting_point_type\": \"consumption\",\n \"balance_group\": \"11XFC-CONS-----0\",\n \"customer\": {\n \"city\": \"<string>\",\n \"country_code\": \"DE\",\n \"house_number\": \"<string>\",\n \"name\": \"<string>\",\n \"postcode\": \"<string>\",\n \"street\": \"<string>\"\n },\n \"effective_date\": \"2023-12-25\",\n \"enfg_eligibility\": {\n \"kind\": \"customer_qualifies\",\n \"privilege_reasons\": [\n \"ZU5\"\n ]\n },\n \"grid_operator\": \"9903123000007\",\n \"market\": \"DE\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engrate.io/market-access/v1alpha1/structure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"kind\": \"create.supplier-switch\",\n \"supplier-switch\": {\n \"accounting_point_market_identifier\": \"26611699793\",\n \"accounting_point_type\": \"consumption\",\n \"balance_group\": \"11XFC-CONS-----0\",\n \"customer\": {\n \"city\": \"<string>\",\n \"country_code\": \"DE\",\n \"house_number\": \"<string>\",\n \"name\": \"<string>\",\n \"postcode\": \"<string>\",\n \"street\": \"<string>\"\n },\n \"effective_date\": \"2023-12-25\",\n \"enfg_eligibility\": {\n \"kind\": \"customer_qualifies\",\n \"privilege_reasons\": [\n \"ZU5\"\n ]\n },\n \"grid_operator\": \"9903123000007\",\n \"market\": \"DE\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"accounting_point_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"index": 1,
"kind": "create.supplier-switch",
"supplier_switch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"conflicts": [
{
"accounting_point_market_identifier": "<string>",
"action_indexes": [
1
],
"kind": "existing-open-switch",
"state": "requested",
"switch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Submit Structure Batch
Submit up to 100 structuring actions as one structure batch.
Engrate applies all the actions or none of them. Today the only action is create.supplier-switch. For each new supplier switch, Engrate adds the accounting point to your organization if it is not there yet, and makes a request to the grid operator. Follow each switch with List supplier switches.
See Supplier switches.
Errors:
-
400: your organization is not set up for the market of the actions. Contact Engrate. -
404: your organization is not set up for market communication. Contact Engrate. -
409: an action names an accounting point that already has an open switch, or two actions name the same accounting point. Engrate applied nothing.conflictsnames the actions. -
422: the batch is not valid. For example, a MaLo-ID does not have 11 digits.detailnames the fields.
curl --request POST \
--url https://api.engrate.io/market-access/v1alpha1/structure \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"kind": "create.supplier-switch",
"supplier-switch": {
"accounting_point_market_identifier": "26611699793",
"accounting_point_type": "consumption",
"balance_group": "11XFC-CONS-----0",
"customer": {
"city": "<string>",
"country_code": "DE",
"house_number": "<string>",
"name": "<string>",
"postcode": "<string>",
"street": "<string>"
},
"effective_date": "2023-12-25",
"enfg_eligibility": {
"kind": "customer_qualifies",
"privilege_reasons": [
"ZU5"
]
},
"grid_operator": "9903123000007",
"market": "DE"
}
}
]
}
'import requests
url = "https://api.engrate.io/market-access/v1alpha1/structure"
payload = { "actions": [
{
"kind": "create.supplier-switch",
"supplier-switch": {
"accounting_point_market_identifier": "26611699793",
"accounting_point_type": "consumption",
"balance_group": "11XFC-CONS-----0",
"customer": {
"city": "<string>",
"country_code": "DE",
"house_number": "<string>",
"name": "<string>",
"postcode": "<string>",
"street": "<string>"
},
"effective_date": "2023-12-25",
"enfg_eligibility": {
"kind": "customer_qualifies",
"privilege_reasons": ["ZU5"]
},
"grid_operator": "9903123000007",
"market": "DE"
}
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [
{
kind: 'create.supplier-switch',
'supplier-switch': {
accounting_point_market_identifier: '26611699793',
accounting_point_type: 'consumption',
balance_group: '11XFC-CONS-----0',
customer: {
city: '<string>',
country_code: 'DE',
house_number: '<string>',
name: '<string>',
postcode: '<string>',
street: '<string>'
},
effective_date: '2023-12-25',
enfg_eligibility: {kind: 'customer_qualifies', privilege_reasons: ['ZU5']},
grid_operator: '9903123000007',
market: 'DE'
}
}
]
})
};
fetch('https://api.engrate.io/market-access/v1alpha1/structure', 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.engrate.io/market-access/v1alpha1/structure",
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([
'actions' => [
[
'kind' => 'create.supplier-switch',
'supplier-switch' => [
'accounting_point_market_identifier' => '26611699793',
'accounting_point_type' => 'consumption',
'balance_group' => '11XFC-CONS-----0',
'customer' => [
'city' => '<string>',
'country_code' => 'DE',
'house_number' => '<string>',
'name' => '<string>',
'postcode' => '<string>',
'street' => '<string>'
],
'effective_date' => '2023-12-25',
'enfg_eligibility' => [
'kind' => 'customer_qualifies',
'privilege_reasons' => [
'ZU5'
]
],
'grid_operator' => '9903123000007',
'market' => 'DE'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.engrate.io/market-access/v1alpha1/structure"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"kind\": \"create.supplier-switch\",\n \"supplier-switch\": {\n \"accounting_point_market_identifier\": \"26611699793\",\n \"accounting_point_type\": \"consumption\",\n \"balance_group\": \"11XFC-CONS-----0\",\n \"customer\": {\n \"city\": \"<string>\",\n \"country_code\": \"DE\",\n \"house_number\": \"<string>\",\n \"name\": \"<string>\",\n \"postcode\": \"<string>\",\n \"street\": \"<string>\"\n },\n \"effective_date\": \"2023-12-25\",\n \"enfg_eligibility\": {\n \"kind\": \"customer_qualifies\",\n \"privilege_reasons\": [\n \"ZU5\"\n ]\n },\n \"grid_operator\": \"9903123000007\",\n \"market\": \"DE\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.post("https://api.engrate.io/market-access/v1alpha1/structure")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"kind\": \"create.supplier-switch\",\n \"supplier-switch\": {\n \"accounting_point_market_identifier\": \"26611699793\",\n \"accounting_point_type\": \"consumption\",\n \"balance_group\": \"11XFC-CONS-----0\",\n \"customer\": {\n \"city\": \"<string>\",\n \"country_code\": \"DE\",\n \"house_number\": \"<string>\",\n \"name\": \"<string>\",\n \"postcode\": \"<string>\",\n \"street\": \"<string>\"\n },\n \"effective_date\": \"2023-12-25\",\n \"enfg_eligibility\": {\n \"kind\": \"customer_qualifies\",\n \"privilege_reasons\": [\n \"ZU5\"\n ]\n },\n \"grid_operator\": \"9903123000007\",\n \"market\": \"DE\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engrate.io/market-access/v1alpha1/structure")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"actions\": [\n {\n \"kind\": \"create.supplier-switch\",\n \"supplier-switch\": {\n \"accounting_point_market_identifier\": \"26611699793\",\n \"accounting_point_type\": \"consumption\",\n \"balance_group\": \"11XFC-CONS-----0\",\n \"customer\": {\n \"city\": \"<string>\",\n \"country_code\": \"DE\",\n \"house_number\": \"<string>\",\n \"name\": \"<string>\",\n \"postcode\": \"<string>\",\n \"street\": \"<string>\"\n },\n \"effective_date\": \"2023-12-25\",\n \"enfg_eligibility\": {\n \"kind\": \"customer_qualifies\",\n \"privilege_reasons\": [\n \"ZU5\"\n ]\n },\n \"grid_operator\": \"9903123000007\",\n \"market\": \"DE\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"accounting_point_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"index": 1,
"kind": "create.supplier-switch",
"supplier_switch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"conflicts": [
{
"accounting_point_market_identifier": "<string>",
"action_indexes": [
1
],
"kind": "existing-open-switch",
"state": "requested",
"switch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Body
Was this page helpful?