curl --request GET \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary', 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://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"type": "Pnl_Summary",
"start_date": "2024-01-01T00:00:00Z",
"end_date": "2024-12-31T23:59:59Z",
"income": 1050000,
"costOfGoodsSold": 350000,
"grossProfit": 700000,
"operatingExpenses": 300000,
"profitBeforeTaxes": 400000,
"taxes": 100000,
"netProfit": 300000,
"totalExpenses": 750000,
"uncategorizedInflows": 500,
"uncategorizedOutflows": 300,
"fullyCategorized": false,
"uncategorized_transactions": 5,
"categorized_transactions": 42
}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}Fetch P&L summary
Returns a profit and loss summary for a single arbitrary date range. Unlike the monthly summaries endpoint which returns per-month breakdowns, this endpoint aggregates the entire specified period into one summary. Both date bounds are optional: omitting start_date uses the business activation date, and omitting end_date uses the current time. Omitting both returns an all-time summary. This endpoint is useful for dashboard cards showing aggregate financial metrics like total revenue, expenses, net profit, and uncategorized transaction counts.
curl --request GET \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary', 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://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"type": "Pnl_Summary",
"start_date": "2024-01-01T00:00:00Z",
"end_date": "2024-12-31T23:59:59Z",
"income": 1050000,
"costOfGoodsSold": 350000,
"grossProfit": 700000,
"operatingExpenses": 300000,
"profitBeforeTaxes": 400000,
"taxes": 100000,
"netProfit": 300000,
"totalExpenses": 750000,
"uncategorizedInflows": 500,
"uncategorizedOutflows": 300,
"fullyCategorized": false,
"uncategorized_transactions": 5,
"categorized_transactions": 42
}
}{
"type": "InvalidParameters",
"description": "<string>",
"error_enum": "InvalidPayload",
"meta": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Content-Type must be set to application/json.
Path Parameters
The UUID of the business to fetch the profit and loss summary for.
Query Parameters
The start of the period (ISO 8601 instant, e.g. 2024-01-01T00:00:00Z). If omitted, defaults to the business activation date.
The end of the period (ISO 8601 instant, e.g. 2024-12-31T23:59:59Z). If omitted, defaults to the current time.
Accounting basis for the report. Defaults to the business default or ACCRUAL if not set.
ACCRUAL, CASH P&L structure template to use.
Tag key to filter results by (use together with tag_values).
Comma-separated tag values to filter results by (use together with tag_key).
Response
A profit and loss summary for an arbitrary date range. Unlike MonthlyPnlSummary which represents a single calendar month, this object can represent any time period including all-time when both dates are null.
Show child attributes
Show child attributes