> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a Profit and Loss

> This endpoint retrieves a profit and loss.

<ParamField path="business_id" required="true" type="string">
  ID of the Business to generate a Profit and Loss report for.
</ParamField>

<ParamField query="start_date" type="ISO8601 timestamp">
  The start date for the Profit and Loss report in ISO-8601 format. Either `start_date` and `end_date` or `year` and `month` must be provided.
</ParamField>

<ParamField query="end_date" type="ISO8601 timestamp">
  The end date for the Profit and Loss report in ISO-8601 format. Either `start_date` and `end_date` or `year` and `month` must be provided.
</ParamField>

<ParamField query="year" type="integer">
  The year for the Profit and Loss report. Either `start_date` and `end_date` or `year` and `month` must be provided.
</ParamField>

<ParamField query="month" type="integer">
  The month for the Profit and Loss report. Either `start_date` and `end_date` or `year` and `month` must be provided.
</ParamField>

<ParamField query="reporting_basis" type="string">
  The reporting basis for the report (e.g., "CASH" or "ACCRUAL").
</ParamField>

<ParamField query="tag_key" type="string">
  Filter the report by specific tags. If `tag_key` is provided, `tag_values` must also be provided.
</ParamField>

<ParamField query="tag_values" type="string">
  Filter the report by specific tags. Multiple values can be specified, separated by commas. If `tag_values` is provided, `tag_key` must also be provided.
</ParamField>

### Response

Returns the generated [Profit and Loss](/api-reference/reports/pnl/pnl) report.

<RequestExample>
  ```bash Request theme={null}
  curl -X GET 'https://sandbox.layerfi.com/v1/businesses/d2f6d97f-3345-4299-9ec2-468738c5d536/reports/profit-and-loss?start_date=2023-01-01T00:00:00-06:00&end_date=2023-12-01T00:00:00-06:00' \
    -H 'Authorization: Bearer <access_token>'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
        "type": "Profit_And_Loss",
        "business_id": "d2f6d97f-3345-4299-9ec2-468738c5d536",
        "start_date": "2023-01-01T06:00:00Z",
        "end_date": "2023-12-01T06:00:00Z",
        "income": {
            "name": "REVENUE",
            "display_name": "Revenue",
            "value": 49397,
            "line_items": [
                {
                    "name": "SERVICES_REVENUE",
                    "display_name": "Service Revenue",
                    "value": 46897,
                    "line_items": null
                },
                {
                    "name": "GOODS_REVENUE",
                    "display_name": "Sale of Goods Revenue",
                    "value": 0,
                    "line_items": null
                },
                {
                    "name": "DISCOUNTS",
                    "display_name": "Discounts & Refunds",
                    "value": 2500,
                    "line_items": null
                }
            ]
        },
        "cost_of_goods_sold": {
            "name": "COGS",
            "display_name": "Cost of Goods Sold",
            "value": 8026,
            "line_items": [
                {
                    "name": "JOB_SUPPLIES",
                    "display_name": "Job supplies",
                    "value": 8026,
                    "line_items": null
                }
            ]
        },
        "gross_profit": 41371,
        "expenses": {
            "name": "OPERATING_EXPENSES",
            "display_name": "Operating Expenses",
            "value": 0,
            "line_items": [
                {
                    "name": "INSURANCE",
                    "display_name": "Insurance",
                    "value": 0,
                    "line_items": null
                },
                {
                    "name": "RENT_EXPENSE",
                    "display_name": "Rent",
                    "value": 0,
                    "line_items": null
                },
                {
                    "name": "UTILITIES",
                    "display_name": "Utilities",
                    "value": 0,
                    "line_items": null
                },
                {
                    "name": "EQUIPMENT",
                    "display_name": "Equipment & Tools",
                    "value": 0,
                    "line_items": null
                },
                {
                    "name": "ADVERTISING",
                    "display_name": "Advertising",
                    "value": 0,
                    "line_items": null
                },
                {
                    "name": "VEHICLE_EXPENSES",
                    "display_name": "Vehicle Expenses",
                    "value": 0,
                    "line_items": null
                }
            ]
        },
        "profit_before_taxes": 41371,
        "taxes": {
            "name": "TAXES",
            "display_name": "Taxes",
            "value": 0,
            "line_items": null
        },
        "net_profit": 41371,
        "other_outflows": null,
        "personal_expenses": null,
        "fully_categorized": true
    }
  }
  ```
</ResponseExample>
