curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"periods": {
"type": "Comparison_Months",
"months": [
{
"year": 2024,
"month": 12
}
]
},
"tag_filters": [
{
"required_tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
]
}
]
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv"
payload = {
"periods": {
"type": "Comparison_Months",
"months": [
{
"year": 2024,
"month": 12
}
]
},
"tag_filters": [{ "required_tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
] }]
}
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({
periods: {type: 'Comparison_Months', months: [{year: 2024, month: 12}]},
tag_filters: [
{
required_tags: [
{
key: 'department',
value: 'sales',
dimension_display_name: 'Department',
value_display_name: 'Sales Department'
}
]
}
]
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv', 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/exports/comparison-csv",
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([
'periods' => [
'type' => 'Comparison_Months',
'months' => [
[
'year' => 2024,
'month' => 12
]
]
],
'tag_filters' => [
[
'required_tags' => [
[
'key' => 'department',
'value' => 'sales',
'dimension_display_name' => 'Department',
'value_display_name' => 'Sales Department'
]
]
]
]
]),
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://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv"
payload := strings.NewReader("{\n \"periods\": {\n \"type\": \"Comparison_Months\",\n \"months\": [\n {\n \"year\": 2024,\n \"month\": 12\n }\n ]\n },\n \"tag_filters\": [\n {\n \"required_tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ]\n}")
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://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"periods\": {\n \"type\": \"Comparison_Months\",\n \"months\": [\n {\n \"year\": 2024,\n \"month\": 12\n }\n ]\n },\n \"tag_filters\": [\n {\n \"required_tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv")
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 = "{\n \"periods\": {\n \"type\": \"Comparison_Months\",\n \"months\": [\n {\n \"year\": 2024,\n \"month\": 12\n }\n ]\n },\n \"tag_filters\": [\n {\n \"required_tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "S3_Presigned_Url",
"presignedUrl": "https://example-bucket.s3.amazonaws.com/example-object?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=FAKEAWSACCESSKEY%2F20240710%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=FAKESIGNATURE1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\n",
"fileType": "csv"
}""""Export P&L comparison as CSV
Exports a profit and loss comparison report as a CSV file. Returns a pre-signed URL for downloading the generated CSV file.
curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"periods": {
"type": "Comparison_Months",
"months": [
{
"year": 2024,
"month": 12
}
]
},
"tag_filters": [
{
"required_tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
]
}
]
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv"
payload = {
"periods": {
"type": "Comparison_Months",
"months": [
{
"year": 2024,
"month": 12
}
]
},
"tag_filters": [{ "required_tags": [
{
"key": "department",
"value": "sales",
"dimension_display_name": "Department",
"value_display_name": "Sales Department"
}
] }]
}
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({
periods: {type: 'Comparison_Months', months: [{year: 2024, month: 12}]},
tag_filters: [
{
required_tags: [
{
key: 'department',
value: 'sales',
dimension_display_name: 'Department',
value_display_name: 'Sales Department'
}
]
}
]
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv', 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/exports/comparison-csv",
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([
'periods' => [
'type' => 'Comparison_Months',
'months' => [
[
'year' => 2024,
'month' => 12
]
]
],
'tag_filters' => [
[
'required_tags' => [
[
'key' => 'department',
'value' => 'sales',
'dimension_display_name' => 'Department',
'value_display_name' => 'Sales Department'
]
]
]
]
]),
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://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv"
payload := strings.NewReader("{\n \"periods\": {\n \"type\": \"Comparison_Months\",\n \"months\": [\n {\n \"year\": 2024,\n \"month\": 12\n }\n ]\n },\n \"tag_filters\": [\n {\n \"required_tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ]\n}")
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://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"periods\": {\n \"type\": \"Comparison_Months\",\n \"months\": [\n {\n \"year\": 2024,\n \"month\": 12\n }\n ]\n },\n \"tag_filters\": [\n {\n \"required_tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss/exports/comparison-csv")
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 = "{\n \"periods\": {\n \"type\": \"Comparison_Months\",\n \"months\": [\n {\n \"year\": 2024,\n \"month\": 12\n }\n ]\n },\n \"tag_filters\": [\n {\n \"required_tags\": [\n {\n \"key\": \"department\",\n \"value\": \"sales\",\n \"dimension_display_name\": \"Department\",\n \"value_display_name\": \"Sales Department\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "S3_Presigned_Url",
"presignedUrl": "https://example-bucket.s3.amazonaws.com/example-object?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=FAKEAWSACCESSKEY%2F20240710%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=FAKESIGNATURE1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\n",
"fileType": "csv"
}""""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 export the P&L comparison for
Query Parameters
Format for monetary values in the export
DOLLAR_STRING, CENTS_INTEGER Body
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Show child attributes
Show child attributes
ACCRUAL, CASH DEFAULT, TRUCKING, MEDSPA, MEDSPA_NO_LICENSING, CITRUS, CITRUS_NO_LICENSING, FLORIST Response
Pre-signed URL for downloading the CSV export
A pre-signed URL to download a document
Resource type. Value will be 'S3_Presigned_Url'.
"S3_Presigned_Url"
Pre-signed URL to download a document
"https://example-bucket.s3.amazonaws.com/example-object?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=FAKEAWSACCESSKEY%2F20240710%2Fus-west-1%2Fs3%2Faws4_request&X-Amz-Date=20240710T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=FAKESIGNATURE1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\n"
The file type of the document
"csv"