Update EndUser P&L layout
curl --request PUT \
--url https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"category_labels": [
"Postage"
],
"section_slug": "operational_expenses"
}
'import requests
url = "https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout"
payload = {
"category_labels": ["Postage"],
"section_slug": "operational_expenses"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({category_labels: ['Postage'], section_slug: 'operational_expenses'})
};
fetch('https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout', 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://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'category_labels' => [
'Postage'
],
'section_slug' => 'operational_expenses'
]),
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://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout"
payload := strings.NewReader("{\n \"category_labels\": [\n \"Postage\"\n ],\n \"section_slug\": \"operational_expenses\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"category_labels\": [\n \"Postage\"\n ],\n \"section_slug\": \"operational_expenses\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category_labels\": [\n \"Postage\"\n ],\n \"section_slug\": \"operational_expenses\"\n}"
response = http.request(request)
puts response.read_body{
"sections": [
{
"labels": [
"<string>"
],
"metrics": [
{
"denominator": {
"labels": [
"<string>"
],
"sections": [
"<string>"
]
},
"indent": 123,
"is_growth": true,
"name": "<string>",
"numerator": {
"labels": [
"<string>"
],
"sections": [
"<string>"
]
}
}
],
"name": "<string>",
"slug": "<string>"
}
]
}EndUserCalculations
Update EndUser P&L layout
Update the profit and loss layout for the end user, which determines how the profit and loss table is calculated
PUT
/
api
/
end_users
/
{end_user_id_or_heron_id}
/
profit_and_loss_layout
Update EndUser P&L layout
curl --request PUT \
--url https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"category_labels": [
"Postage"
],
"section_slug": "operational_expenses"
}
'import requests
url = "https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout"
payload = {
"category_labels": ["Postage"],
"section_slug": "operational_expenses"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({category_labels: ['Postage'], section_slug: 'operational_expenses'})
};
fetch('https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout', 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://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'category_labels' => [
'Postage'
],
'section_slug' => 'operational_expenses'
]),
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://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout"
payload := strings.NewReader("{\n \"category_labels\": [\n \"Postage\"\n ],\n \"section_slug\": \"operational_expenses\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"category_labels\": [\n \"Postage\"\n ],\n \"section_slug\": \"operational_expenses\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.herondata.io/api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category_labels\": [\n \"Postage\"\n ],\n \"section_slug\": \"operational_expenses\"\n}"
response = http.request(request)
puts response.read_body{
"sections": [
{
"labels": [
"<string>"
],
"metrics": [
{
"denominator": {
"labels": [
"<string>"
],
"sections": [
"<string>"
]
},
"indent": 123,
"is_growth": true,
"name": "<string>",
"numerator": {
"labels": [
"<string>"
],
"sections": [
"<string>"
]
}
}
],
"name": "<string>",
"slug": "<string>"
}
]
}Authorizations
Path Parameters
Body
application/json
Response
200 - application/json
OK
Ordered list of P&L sections
Show child attributes
Show child attributes
Was this page helpful?
⌘I