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

# Profit and Loss

> Generate a Profit and Loss Report, using the specific parameters



## OpenAPI

````yaml https://dev.hurdlr.com/rest/v1/devUtils/documentation?version=5&Authorization=dexfeE6aRK3zwXP4ku5aWm8w&env=sandbox post /v5/reports/profitAndLoss
openapi: 3.0.1
info:
  title: Tight API
  contact:
    name: Hurdlr, Inc. (dba Tight)
    url: https://www.tight.com
    email: api@tight.com
  version: 6.0.0
servers:
  - url: https://sandbox.hurdlr.com/rest
    description: Staging Environment
  - url: https://prod.hurdlr.com/rest
    description: Production Environment
security:
  - accessTokenSecurity: []
  - basicSecurity: []
tags:
  - name: Authentication
  - name: Banks
  - name: Business & Client Management
  - name: Invoicing
  - name: Revenue
  - name: Investments
  - name: Payouts
  - name: Bills
  - name: Expenses
  - name: Payroll
  - name: Reports
  - name: Accounting
  - name: Mileage
  - name: Taxes
  - name: Time Tracking
  - name: Imports
  - name: Files
  - name: Accountant
  - name: Audit Trail
  - name: Support
  - name: Tax Engine Express
  - name: Interview Endpoint
  - name: Ledgering
  - name: Configuration
  - name: Templates
paths:
  /v5/reports/profitAndLoss:
    post:
      tags:
        - Reports
      summary: Profit and Loss
      description: Generate a Profit and Loss Report, using the specific parameters
      operationId: postProfitAndLoss
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/ProfitAndLossReportParam'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfitAndLossReportRetVal'
      security:
        - accessTokenSecurity: []
components:
  schemas:
    ProfitAndLossReportParam:
      required:
        - beginDate
        - endDate
        - exportType
      type: object
      properties:
        grouping:
          type: string
          description: Time period grouping for the report data, defaults to no grouping
          enum:
            - DAILY
            - MONTHLY
            - QUARTERLY
            - YEARLY
        beginDate:
          type: string
          description: Begin date for the report
          format: date
          example: '2023-01-01'
        endDate:
          type: string
          description: End date for the report
          format: date
          example: '2023-12-31'
        businessIds:
          type: array
          description: >-
            List of businesses to include in this report, defaults to all
            businesses
          items:
            type: integer
            description: >-
              List of businesses to include in this report, defaults to all
              businesses
            format: int64
        clientIds:
          type: array
          description: List of clients to include in this report, defaults to all clients
          items:
            type: integer
            description: List of clients to include in this report, defaults to all clients
            format: int64
        exportType:
          type: string
          description: Export type for this report
          enum:
            - HTML
            - PDF
            - JSON
            - XLSX
        emails:
          type: array
          description: >-
            List of emails to which to send the report. Only valid for PDF and
            XLSX exportTypes.
          items:
            type: string
            description: >-
              List of emails to which to send the report. Only valid for PDF and
              XLSX exportTypes.
        ccEmails:
          type: array
          description: >-
            List of emails to be CC'ed on the report email. Only valid for PDF
            and XLSX exportTypes.
          items:
            type: string
            description: >-
              List of emails to be CC'ed on the report email. Only valid for PDF
              and XLSX exportTypes.
        bccEmails:
          type: array
          description: >-
            List of emails to be BCC'ed on the report email. Only valid for PDF
            and XLSX exportTypes.
          items:
            type: string
            description: >-
              List of emails to be BCC'ed on the report email. Only valid for
              PDF and XLSX exportTypes.
        date:
          type: string
          description: >-
            Date the report was generated on (displayed in the footer of the PDF
            report)
          format: date
          example: '2023-01-01'
        projection:
          type: boolean
          description: >-
            Whether to project report data using the trailing twelve months of
            data tracked. Only valid for reports without groupings. Defaults to
            false.
        accountingMethod:
          type: string
          enum:
            - ACCRUAL
            - CASH
            - EITHER
    ProfitAndLossReportRetVal:
      type: object
      properties:
        result:
          type: string
          description: Result of the action performed
          enum:
            - SUCCESS
            - FAILURE_VALIDATION_ERROR
            - FAILURE_NO_DATA
            - FAILURE_UNKNOWN_ERROR
        errors:
          $ref: '#/components/schemas/ValidationRetVal'
        meta:
          $ref: '#/components/schemas/ProfitAndLossReportMeta'
        html:
          type: string
          description: HTML of the report
        json:
          $ref: '#/components/schemas/ProfitAndLossJsonDTO'
        url:
          type: string
          description: Url at which the downloadable report is located
    ValidationRetVal:
      type: object
      properties:
        fieldErrors:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ValidationError'
          description: Map of field-level errors, often originating from validation errors
        globalErrors:
          type: array
          description: List of higher-level errors
          items:
            $ref: '#/components/schemas/ValidationError'
      description: Error object containing details errors incurred, if any
    ProfitAndLossReportMeta:
      type: object
      properties:
        title:
          type: string
        businesses:
          type: array
          items:
            type: string
        generatedOn:
          type: string
          format: date-time
        generatedBy:
          type: string
        footerLine:
          type: string
        params:
          $ref: '#/components/schemas/ProfitAndLossReportParam'
      description: Metadata associated with the report generated
    ProfitAndLossJsonDTO:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ProfitAndLossDTOChild0Data'
    ValidationError:
      type: object
      properties:
        type:
          type: string
          description: A broad categorization of the error
          enum:
            - DUPLICATE
            - REQUIRED
            - DELETE
            - INVALID_VALUE
            - NOT_MODIFIABLE
            - GENERAL
            - INVALID_FORMAT
        errorMessage:
          type: string
          description: Human-friendly message describing this error
        message:
          type: string
          writeOnly: true
          enum:
            - DUPLICATE
            - REQUIRED
            - DELETE
            - INVALID_VALUE
            - NOT_MODIFIABLE
            - GENERAL
            - INVALID_FORMAT
            - INVALID_MAPPING
      description: List of higher-level errors
    ProfitAndLossDTOChild0Data:
      type: object
      properties:
        name:
          type: string
        period:
          $ref: '#/components/schemas/Period'
        netIncome:
          type: number
        income:
          $ref: '#/components/schemas/ProfitAndLossDTOWithChildren'
        cogs:
          $ref: '#/components/schemas/ProfitAndLossDTOWithChildren'
        grossProfit:
          type: number
        profitMargin:
          type: number
        expenses:
          $ref: '#/components/schemas/ProfitAndLossDTOWithChildren'
        netOperatingIncome:
          type: number
        operatingMargin:
          type: number
        otherIncome:
          $ref: '#/components/schemas/ProfitAndLossDTOWithChildren'
        otherExpenses:
          $ref: '#/components/schemas/ProfitAndLossDTOWithChildren'
    Period:
      type: object
      properties:
        beginDate:
          type: string
          format: date-time
        endDate:
          type: string
          format: date-time
    ProfitAndLossDTOWithChildren:
      type: object
      properties:
        name:
          type: string
          description: A user-friendly name of this node, useful for display purposes
        accountId:
          type: integer
          description: >-
            id of the associated account, referencing an account in the Chart of
            Accounts
          format: int64
        accountNo:
          type: string
          description: >-
            Number of the associated account, referencing an account in the
            Chart of Accounts
        total:
          type: number
          description: The total amount of this node
        children:
          type: array
          items:
            type: object
  securitySchemes:
    accessTokenSecurity:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: /auth/account
          scopes:
            write: ''

````