Java · Track 7 · Tutorial 5 of 5

Read the consolidation entries, exchange rates and KPIs

Read what's behind the group's figures: the entries consolidation posted, the exchange rates it used, and the KPIs your group tracks.

You will needA month recalculated, from the earlier tutorials.
By the endScripts that read the consolidation entries, any exchange rate, and any KPI.

1What the consolidation posted

Behind the group's figures are the entries consolidation makes: currency translation (cta), minority interests (nci), journal vouchers, adjustments, and intercompany. Each can be read for a month, and each answers for the group your company belongs to.

The five consolidation datasets
What the consolidation posted, in five datasets - answered for your company's group.

2Read one

Create ConsolidationEntries.java. It reads one dataset and prints what came back:

ConsolidationEntries.java

// ConsolidationEntries.java - reads what the consolidation posted for September, one dataset at a time.
//   gradle -q run -Pmain=ConsolidationEntries --args="cta"
public class ConsolidationEntries {
    public static void main(String[] args) throws Exception {
        String dataset = args.length > 0 ? args[0] : "cta"; // cta, nci, journal-vouchers, adjustments or intercompany

        Brizo.Answer answer = Brizo.call("GET", "/organisations/" + Brizo.COMPANY_ID + "/consolidation/" + dataset + "?period=2026-09");
        if (answer.status() != 200) {
            System.out.println("Refused (" + answer.status() + "): " + answer.body().path("message").asText());
            return;
        }

        System.out.println(dataset + " for " + answer.body().path("group").path("name").asText() + ":");
        System.out.println(Brizo.JSON.writerWithDefaultPrettyPrinter().writeValueAsString(answer.body()));
    }
}
gradle -q run -Pmain=ConsolidationEntries --args="cta"

Check

The dataset's name and your group, then the entries for September. What each holds depends on your group: a group with no foreign subsidiaries has no translation to show.

3Read exchange rates and KPIs

Create RatesKpis.java. It reads September's closing USD to SGD rate, lists the KPIs your group defines, and reads the first:

RatesKpis.java

// RatesKpis.java - reads September's USD to SGD rate and one KPI.
import com.fasterxml.jackson.databind.JsonNode;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

public class RatesKpis {
    public static void main(String[] args) throws Exception {
        Brizo.Answer rate = Brizo.call("GET", "/organisations/" + Brizo.COMPANY_ID + "/exchange-rates?from=USD&to=SGD&period=2026-09&rate_type=closing");
        if (rate.status() == 200) {
            System.out.println("1 USD = " + rate.body().path("rate").asText() + " SGD (" + rate.body().path("rate_type").asText()
                    + ", " + rate.body().path("period").asText() + ")");
        } else {
            System.out.println("No rate: " + rate.body().path("message").asText());
        }

        JsonNode kpis = Brizo.call("GET", "/kpis").body().path("data");
        List<String> names = new ArrayList<>();
        kpis.forEach(kpi -> names.add(kpi.path("name").asText()));
        System.out.println("KPIs the group defines: " + String.join(", ", names));

        if (!names.isEmpty()) {
            String first = names.get(0);
            JsonNode value = Brizo.call("GET", "/organisations/" + Brizo.COMPANY_ID + "/kpi-values?metric="
                    + URLEncoder.encode(first, StandardCharsets.UTF_8).replace("+", "%20") + "&period=2026-09").body();
            System.out.println(first + ", " + value.path("period").asText() + ": " + value.path("this_month").asText()
                    + " this month, " + value.path("this_month_ytd").asText() + " year to date");
        }
    }
}
Exchange rates and KPIs
Exchange rates by pair and month; KPIs by the names your group defines.

4Run it

gradle -q run -Pmain=RatesKpis

Check

The rate, with its type and month - or the reason there isn't one, if the group holds no rate for that pair and month. Then your group's KPI names, and the first one's figure for September.

5Good to know

  • rate_type is average (the default) or closing.
  • A KPI is read by the name /kpis gives it. A name the group doesn't define answers 404.
  • Each of these needs its own box on the credential: Consolidation (read), Exchange rates (read), KPIs (read).

Want more detail? See the documentation