Create P&L comparisons
Businesses
- Business
- Financial Accounts
- Documents
- Scoped Authentication
- Configuration
- Tasks & Notifications
Financial Activity
- Accounts Receivable
- Accounts Payable
- Bank Transactions
- General Ledger
- Tags
Accounting Reports
- Profit and Loss
- Balance Sheet
- Cash Flow Statement
Platform Configuration
- Plaid
- SMS
Activity Metrics
- Platform wide activity
- Business Activity
Create P&L comparisons
Compare Profit & Loss views across time periods and/or tags. This endpoint allows specifying multiple time periods (specified in months, years, or custom date ranges) and tags and will generate a comparison for every combination. Note that this endpoint is retrieval only, but uses a POST
HTTP verb rather than GET
because of the complexity of the parameters.
POST
/
v1
/
businesses
/
{businessId}
/
reports
/
profit-and-loss-comparison
curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-comparison \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"periods": {
"type": "Comparison_Months",
"months": [
{
"year": 2024,
"month": 12
}
]
},
"tag_filters": [
{
"required_tags": [
{
"key": "Location",
"value": "MainStreet"
}
]
}
],
"reporting_basis": "ACCRUAL",
"structure": "DEFAULT"
}'
[
{
"pnls": [
{
"period": {
"type": "Comparison_Months",
"months": [
{
"year": 2024,
"month": 12
}
]
},
"tag_filter": {
"key": "<string>",
"value": [
"<string>"
]
},
"pnl": {
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"income": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"cost_of_goods_sold": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"gross_profit": 123,
"expenses": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"profit_before_taxes": 123,
"taxes": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"net_profit": 123,
"other_outflows": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"personal_expenses": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"fully_categorized": true
}
}
]
}
]
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 for
Body
application/json
Response
200
application/json
The response is of type object[]
.
curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/reports/profit-and-loss-comparison \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"periods": {
"type": "Comparison_Months",
"months": [
{
"year": 2024,
"month": 12
}
]
},
"tag_filters": [
{
"required_tags": [
{
"key": "Location",
"value": "MainStreet"
}
]
}
],
"reporting_basis": "ACCRUAL",
"structure": "DEFAULT"
}'
[
{
"pnls": [
{
"period": {
"type": "Comparison_Months",
"months": [
{
"year": 2024,
"month": 12
}
]
},
"tag_filter": {
"key": "<string>",
"value": [
"<string>"
]
},
"pnl": {
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"income": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"cost_of_goods_sold": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"gross_profit": 123,
"expenses": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"profit_before_taxes": 123,
"taxes": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"net_profit": 123,
"other_outflows": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"personal_expenses": {
"name": "<string>",
"display_name": "<string>",
"value": 123,
"line_items": [
{}
],
"is_contra": true
},
"fully_categorized": true
}
}
]
}
]