First, generate the Profit and Loss and Balance Sheet reports by following their respective guides.
let
Token = "Bearer (Paste the Bearer Token Here)",
Url = "(Profit & Loss API URL)",
GetAPIData = (token as text) as record =>
let
Source = Json.Document(Web.Contents(Url, [Headers=[Authorization=token]])),
AnotherAPICall = if Record.HasFields(Source, {"url"}) then
Json.Document(Web.Contents(Source[url]))
else
Json.Document(Source[data]),
Result = AnotherAPICall
in
Result,
FinalResult = GetAPIData(Token)
in
FinalResult