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

# Fetch P&L line items

> Returns detailed line item information for a specific P&L account or category over a specified time period.



## OpenAPI

````yaml get /v1/businesses/{businessId}/reports/profit-and-loss/lines
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/reports/profit-and-loss/lines:
    get:
      tags: []
      summary: Fetch P&L line items
      description: >-
        Returns detailed line item information for a specific P&L account or
        category over a specified time period.
      operationId: business.reports.profit-and-loss.lines.get
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business to fetch the P&L line items for
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be set to application/json
          schema:
            type: string
        - name: start_date
          in: query
          description: Start date for the line item report (ISO 8601 format)
          required: true
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          description: End date for the line item report (ISO 8601 format)
          required: true
          schema:
            type: string
            format: date-time
        - name: line_item_name
          in: query
          description: Name of the specific line item to fetch details for
          required: true
          schema:
            type: string
        - name: reporting_basis
          in: query
          description: Accounting basis for the report
          schema:
            type: string
            enum:
              - ACCRUAL
              - CASH
        - name: structure
          in: query
          description: P&L structure template to use
          schema:
            type: string
      responses:
        '200':
          description: P&L line item detail report
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiPnlLineItemDetailReport'
        '400':
          description: >-
            Invalid parameters or P&L not yet reconciled for the requested
            period.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            Business id is not found. This indicates the business id is invalid
            or the business has been archived.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    ApiPnlLineItemDetailReport:
      type: object
      description: >-
        Detailed report for a specific P&L line item showing all ledger entries
        that contribute to it
      required:
        - business_id
        - start_date
        - end_date
        - pnl_structure_line_item_name
        - pnl_structure_line_item_display_name
        - reporting_basis
        - lines
      properties:
        business_id:
          type: string
          format: uuid
          description: UUID of the business for this report
          example: 550e8400-e29b-41d4-a716-446655440000
        start_date:
          type: string
          format: date-time
          description: Start date of the report period (ISO 8601 timestamp)
          example: '2024-01-01T00:00:00Z'
        end_date:
          type: string
          format: date-time
          description: End date of the report period (ISO 8601 timestamp)
          example: '2024-12-31T23:59:59.999Z'
        pnl_structure_line_item_name:
          type: string
          description: Internal name of the P&L structure line item
          example: operating_expenses
        pnl_structure_line_item_display_name:
          type: string
          description: Display-friendly name of the P&L structure line item
          example: Operating Expenses
        reporting_basis:
          $ref: '#/components/schemas/ReportingBasis'
        pnl_structure:
          $ref: '#/components/schemas/PnlTemplates'
          nullable: true
          description: Optional P&L template structure used for this report
        tag_filter:
          $ref: '#/components/schemas/TagFilter'
          nullable: true
          description: Optional tag filter applied to this report
        lines:
          type: array
          description: List of ledger line items that contribute to this P&L line item
          items:
            $ref: '#/components/schemas/ApiLedgerLineItemWithSource'
    ApiError:
      type: object
      properties: {}
      example: ''
      description: ''
    ReportingBasis:
      type: string
      enum:
        - ACCRUAL
        - CASH
    PnlTemplates:
      type: string
      enum:
        - DEFAULT
        - TRUCKING
        - MEDSPA
        - MEDSPA_NO_LICENSING
        - CITRUS
        - CITRUS_NO_LICENSING
        - FLORIST
    TagFilter:
      type: object
      properties:
        key:
          type: string
        value:
          type: array
          items:
            type: string
    ApiLedgerLineItemWithSource:
      type: object
      description: A ledger line item with its source information
      required:
        - id
        - entry_id
        - account
        - amount
        - direction
        - date
      properties:
        id:
          type: string
          description: Unique identifier for this line item
          example: li_abc123def456
        entry_id:
          type: string
          description: ID of the parent ledger entry
          example: 550e8400-e29b-41d4-a716-446655440000
        account:
          $ref: '#/components/schemas/SingleApiChartAccount'
        amount:
          type: integer
          format: int64
          description: Amount in cents (or smallest currency unit)
          example: 125050
        direction:
          $ref: '#/components/schemas/LedgerEntryDirection'
        date:
          type: string
          format: date-time
          description: Date of this line item entry
          example: '2024-03-15T14:30:00Z'
        source:
          oneOf:
            - $ref: '#/components/schemas/TransactionLedgerEntrySource'
            - $ref: '#/components/schemas/InvoiceLedgerEntrySource'
            - $ref: '#/components/schemas/ManualLedgerEntrySource'
            - $ref: '#/components/schemas/InvoicePaymentLedgerEntrySource'
            - $ref: '#/components/schemas/InvoiceWriteOffLedgerEntrySource'
          nullable: true
          description: >-
            Source information for this ledger entry (transaction, invoice,
            manual entry, etc.)
          discriminator:
            propertyName: entity_name
    SingleApiChartAccount:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/AccountIdentifier'
        name:
          type: string
          description: Name of the account
          example: Current Assets
        account_number:
          type: string
          nullable: true
          description: Account number if configured
          example: '4000'
        stable_name:
          $ref: '#/components/schemas/AccountStableName'
        normality:
          $ref: '#/components/schemas/BankTransactionDirection'
        account_type:
          $ref: '#/components/schemas/ApiLedgerAccountType'
        account_subtype:
          $ref: '#/components/schemas/ApiLedgerAccountSubtype'
      description: A single ledger account without nested children
    LedgerEntryDirection:
      type: string
      enum:
        - CREDIT
        - DEBIT
      description: Direction of the ledger entry (credit or debit).
    TransactionLedgerEntrySource:
      type: object
      properties:
        transaction_id:
          type: string
          format: uuid
        external_id:
          type: string
        account_name:
          type: string
        date:
          type: string
          format: date-time
        amount:
          type: integer
          format: int64
        direction:
          $ref: '#/components/schemas/BankTransactionDirection'
        counterparty:
          type: string
          nullable: true
        entity_name:
          type: string
          default: Bank Transaction
        display_description:
          type: string
          default: Generated display description based on account name and date
    InvoiceLedgerEntrySource:
      type: object
      properties:
        invoice_id:
          type: string
          format: uuid
        external_id:
          type: string
          nullable: true
        invoice_number:
          type: string
          nullable: true
        recipient_name:
          type: string
        date:
          type: string
          format: date-time
        amount:
          type: integer
          format: int64
        entity_name:
          type: string
          default: Invoice
        display_description:
          type: string
          default: Generated display description based on invoice number and date
    ManualLedgerEntrySource:
      type: object
      properties:
        manual_entry_id:
          type: string
          format: uuid
        memo:
          type: string
        created_by:
          type: string
        entity_name:
          type: string
          default: Manual Entry
        display_description:
          type: string
          default: Manual Entry
    InvoicePaymentLedgerEntrySource:
      type: object
      properties:
        external_id:
          type: string
          nullable: true
        invoice_id:
          type: string
          format: uuid
        invoice_number:
          type: string
          nullable: true
        amount:
          type: integer
          format: int64
        entity_name:
          type: string
          default: Invoice Payment
        display_description:
          type: string
          default: Payment on invoice based on invoice number
    InvoiceWriteOffLedgerEntrySource:
      type: object
      description: Source information for an invoice write-off ledger entry
      required:
        - entity_name
        - display_description
        - invoice_id
        - customer_description
        - date
        - write_off_amount
        - invoice_identifiers
      properties:
        entity_name:
          type: string
          description: Type of entity (discriminator)
          default: Invoice Write-Off
        display_description:
          type: string
          description: Human-readable description
        external_id:
          type: string
          nullable: true
          description: External system identifier
        invoice_id:
          type: string
          format: uuid
          description: UUID of the invoice being written off
        invoice_number:
          type: string
          nullable: true
          description: Invoice number
        recipient_name:
          type: string
          nullable: true
          description: Invoice recipient name
        customer_description:
          type: string
          description: Customer description
        date:
          type: string
          format: date-time
          description: Write-off date
        write_off_amount:
          type: integer
          format: int64
          description: Amount written off in cents
        invoice_identifiers:
          type: object
          description: Invoice identification information
          properties:
            external_id:
              type: string
              nullable: true
        memo:
          type: string
          nullable: true
          description: Optional memo/note
        metadata:
          type: object
          nullable: true
          description: Platform-defined JSON metadata
        reference_number:
          type: string
          nullable: true
          description: Reference number for this entry
    AccountIdentifier:
      oneOf:
        - $ref: '#/components/schemas/AccountId'
          description: ID of the account
          title: Account ID
        - $ref: '#/components/schemas/AccountStableName'
          description: Stable name associated with the account
          title: Account Stable Name
    AccountStableName:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be `StableName`.
          example: StableName
        stable_name:
          type: string
          example: CURRENT_ASSETS
          description: Stable name of the account
    BankTransactionDirection:
      type: string
      enum:
        - CREDIT
        - DEBIT
    ApiLedgerAccountType:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/LedgerAccountType'
          description: Type of the account
        display_name:
          type: string
          description: Display name of the account type
          example: Asset
    ApiLedgerAccountSubtype:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/LedgerAccountSubtype'
        display_name:
          type: string
          description: Display name of the account subtype
          example: Current Assets
    AccountId:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be `AccountId`.
          example: AccountId
        id:
          type: string
          format: uuid
          description: ID of the account
    LedgerAccountType:
      type: string
      enum:
        - ASSET
        - LIABILITY
        - EQUITY
        - REVENUE
        - COGS
        - EXPENSE
    LedgerAccountSubtype:
      type: string
      enum:
        - BANK_ACCOUNTS
        - ACCOUNTS_RECEIVABLE
        - INVENTORY
        - PAYMENT_PROCESSOR_CLEARING_ACCOUNT
        - FIXED_ASSET
        - ACCUMULATED_DEPRECIATION
        - CASH
        - UNDEPOSITED_FUNDS
        - CURRENT_ASSET
        - NON_CURRENT_ASSET
        - PREPAID_EXPENSES
        - DEVELOPMENT_COSTS
        - LOANS_RECEIVABLE
        - INTANGIBLE_ASSET
        - ACCOUNTS_PAYABLE
        - CREDIT_CARD
        - TAXES_PAYABLE
        - INCOME_TAXES_PAYABLE
        - SALES_TAXES_PAYABLE
        - OTHER_TAXES_PAYABLE
        - PAYROLL_TAXES_PAYABLE
        - UNEARNED_REVENUE
        - PAYROLL_LIABILITY
        - PAYROLL_CLEARING
        - LINE_OF_CREDIT
        - TIPS
        - REFUND_LIABILITIES
        - UNDEPOSITED_OUTFLOWS
        - OUTGOING_PAYMENT_CLEARING_ACCOUNT
        - OTHER_CURRENT_LIABILITY
        - LOANS_PAYABLE
        - NOTES_PAYABLE
        - SHAREHOLDER_LOAN
        - NON_CURRENT_LIABILITY
        - CONTRIBUTIONS
        - DISTRIBUTIONS
        - COMMON_STOCK
        - PREFERRED_STOCK
        - ADDITIONAL_PAID_IN_CAPITAL
        - RETAINED_EARNINGS
        - ACCUMULATED_ADJUSTMENTS
        - OPENING_BALANCE_EQUITY
        - OTHER_EQUITY
        - SALES
        - UNCATEGORIZED_REVENUE
        - RETURNS_ALLOWANCES
        - DIVIDEND_INCOME
        - INTEREST_INCOME
        - OTHER_INCOME
        - COGS
        - OPERATING_EXPENSES
        - PAYROLL
        - TAXES_LICENSES
        - UNCATEGORIZED_EXPENSE
        - CHARITABLE_CONTRIBUTIONS
        - LOAN_EXPENSES
        - FINANCE_COSTS
        - INTEREST_EXPENSES
        - DEPRECIATION
        - AMORTIZATION
        - BAD_DEBT
        - OTHER_EXPENSES
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````