Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
reports
/
profit-and-loss-comparison
Create P&L comparisons
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": "department",
          "value": "sales",
          "dimension_display_name": "Department",
          "value_display_name": "Sales Department"
        }
      ]
    }
  ]
}
'
{
  "data": [
    {
      "type": "Comparison_Pnl",
      "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,
              "is_contra": true,
              "line_items": "<array>"
            },
            "cost_of_goods_sold": {
              "name": "<string>",
              "display_name": "<string>",
              "value": 123,
              "is_contra": true,
              "line_items": "<array>"
            },
            "gross_profit": 123,
            "expenses": {
              "name": "<string>",
              "display_name": "<string>",
              "value": 123,
              "is_contra": true,
              "line_items": "<array>"
            },
            "profit_before_taxes": 123,
            "taxes": {
              "name": "<string>",
              "display_name": "<string>",
              "value": 123,
              "is_contra": true,
              "line_items": "<array>"
            },
            "net_profit": 123,
            "other_outflows": {
              "name": "<string>",
              "display_name": "<string>",
              "value": 123,
              "is_contra": true,
              "line_items": "<array>"
            },
            "personal_expenses": {
              "name": "<string>",
              "display_name": "<string>",
              "value": 123,
              "is_contra": true,
              "line_items": "<array>"
            },
            "fully_categorized": true
          }
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string

Content-Type must be set to application/json.

Path Parameters

businessId
string
required

The UUID of the business to fetch the profit and loss for.

Body

application/json
periods
object
tag_filters
object[] | null
reporting_basis
enum<string> | null
Available options:
ACCRUAL,
CASH
structure
enum<string> | null
Available options:
DEFAULT,
TRUCKING,
MEDSPA,
MEDSPA_NO_LICENSING,
CITRUS,
CITRUS_NO_LICENSING,
FLORIST

Response

data
object[]
required