Register consumer consent
Completes consumer consent registration after the OAuth 2.0 Authorisation Code
flow. The supplier resolves consumer identity from the token, records consent
against the MPXN, and returns a registration_id for managing the relationship.
Consent can be granted for a one-off access or open-endedly until revoked.
curl --request POST \
--url https://example-supplier.co.uk/v1/consent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://example-supplier.co.uk/v1/consent"
payload = {}
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({})
};
fetch('https://example-supplier.co.uk/v1/consent', 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://example-supplier.co.uk/v1/consent",
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([
]),
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://example-supplier.co.uk/v1/consent"
payload := strings.NewReader("{}")
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://example-supplier.co.uk/v1/consent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://example-supplier.co.uk/v1/consent")
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 = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"registration_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"tariffs": [
{
"mpxn": "1012345678901",
"tariff_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
]
}
}{
"code": "tariff_not_found",
"message": "No tariff found for the given tariff_id and supplier MPID.",
"details": "tariff_id a1b2c3d4-e5f6-7890-abcd-ef1234567890 does not exist for supplier SEBD."
}{
"code": "tariff_not_found",
"message": "No tariff found for the given tariff_id and supplier MPID.",
"details": "tariff_id a1b2c3d4-e5f6-7890-abcd-ef1234567890 does not exist for supplier SEBD."
}{
"code": "tariff_not_found",
"message": "No tariff found for the given tariff_id and supplier MPID.",
"details": "tariff_id a1b2c3d4-e5f6-7890-abcd-ef1234567890 does not exist for supplier SEBD."
}Authorizations
OAuth 2.0 Authorisation Code flow for RTI User authentication and consumer consent.
Each supplier operates its own OAuth server. In production, substitute the
placeholder host with the relevant url from the Supplier Register.
OpenAPI does not permit URI templates in security scheme URLs, so a placeholder
is used here.
Body
No body required. Consumer identity is resolved from the OAuth token.
Empty body — consumer identity is derived from the bearer token.
Response
Consent registered. Returns the registration ID and in-scope metering points.
Show child attributes
Show child attributes
curl --request POST \
--url https://example-supplier.co.uk/v1/consent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://example-supplier.co.uk/v1/consent"
payload = {}
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({})
};
fetch('https://example-supplier.co.uk/v1/consent', 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://example-supplier.co.uk/v1/consent",
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([
]),
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://example-supplier.co.uk/v1/consent"
payload := strings.NewReader("{}")
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://example-supplier.co.uk/v1/consent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://example-supplier.co.uk/v1/consent")
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 = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"registration_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"tariffs": [
{
"mpxn": "1012345678901",
"tariff_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
]
}
}{
"code": "tariff_not_found",
"message": "No tariff found for the given tariff_id and supplier MPID.",
"details": "tariff_id a1b2c3d4-e5f6-7890-abcd-ef1234567890 does not exist for supplier SEBD."
}{
"code": "tariff_not_found",
"message": "No tariff found for the given tariff_id and supplier MPID.",
"details": "tariff_id a1b2c3d4-e5f6-7890-abcd-ef1234567890 does not exist for supplier SEBD."
}{
"code": "tariff_not_found",
"message": "No tariff found for the given tariff_id and supplier MPID.",
"details": "tariff_id a1b2c3d4-e5f6-7890-abcd-ef1234567890 does not exist for supplier SEBD."
}
