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

# Get EndUser cashflow P&L

> Calculates the cashflow profit & loss table for an end user, based on the layout defined (if any)




## OpenAPI

````yaml https://app.herondata.io/swagger get /api/end_users/{end_user_id_or_heron_id}/profit_and_loss
openapi: 3.0.0
info:
  contact:
    email: support@herondata.io
    name: Support
  title: Heron Data API
  version: '2021-07-19'
servers:
  - description: Production
    url: https://app.herondata.io
security:
  - ApiKeyAuth:
      - key_XXX
externalDocs:
  description: Read Tutorial
  url: https://docs.herondata.io/
paths:
  /api/end_users/{end_user_id_or_heron_id}/profit_and_loss:
    get:
      tags:
        - EndUserCalculations
      summary: Get EndUser cashflow P&L
      description: >
        Calculates the cashflow profit & loss table for an end user, based on
        the layout defined (if any)
      parameters:
        - in: path
          name: end_user_id_or_heron_id
          required: true
          schema:
            type: string
        - description: The earliest transaction timestamp date to use
          in: query
          name: from_date
          required: false
          schema:
            example: '2022-01-01'
            format: date
            nullable: true
            type: string
        - description: The latest transaction timestamp date to use
          in: query
          name: to_date
          required: false
          schema:
            example: '2022-01-31'
            format: date
            nullable: true
            type: string
        - description: >-
            If true, dates are sorted left to right by ascending order. False by
            default, i.e., by default sorted in descending date order so more
            recent dates are first
          in: query
          name: dates_ascending
          required: false
          schema:
            default: false
            type: boolean
        - description: ISO 4217 currency code for balance
          in: query
          name: currency
          required: false
          schema:
            enum:
              - GBP
              - USD
              - EUR
              - CAD
              - AUD
              - null
            example: USD
            nullable: true
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfitAndLossSchema'
          description: OK
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ProfitAndLossSchema:
      properties:
        dates:
          description: Ordered list of dates representing the columns of the P&L table
          items:
            format: date
            type: string
          type: array
        sections:
          description: Ordered list of P&L sections
          items:
            $ref: '#/components/schemas/PnlSection'
          type: array
      type: object
    PnlSection:
      properties:
        metrics:
          description: Ordered list of P&L metrics
          items:
            $ref: '#/components/schemas/PnlMetric'
          type: array
        name:
          description: Name of P&L section, e.g,. Operating Expenses
          type: string
        slug:
          description: Slugified version of the name
          type: string
      type: object
    PnlMetric:
      properties:
        confidence:
          description: >-
            Amount weighted confidence for the metric, based on the confidene
            associated with category labels of related transactions
          nullable: true
          type: number
        indent:
          description: Indentation level for formatting purposes
          type: integer
        is_ratio:
          description: Whether the metric is a ratio or not
          type: boolean
        name:
          description: Name of metric
          type: string
        values:
          description: The list of values ordered according to date
          items:
            nullable: true
            type: number
          type: array
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````