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

# Get pnl



## OpenAPI

````yaml /openapi/metrics.json get /v1/crm/metrics/finances/pnl/
openapi: 3.0.3
info:
  title: Yume API — Аналитика
  version: 1.0.0
  description: Системные метрики, аналитика и отчётность.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v1/crm/metrics/finances/pnl/:
    get:
      tags:
        - finances
      summary: Get pnl
      operationId: finances_pnl_list
      parameters:
        - in: query
          name: account
          schema:
            type: integer
        - in: query
          name: category
          schema:
            type: integer
        - in: query
          name: category__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: choice
          schema:
            type: string
            enum:
              - credit
              - debit
              - exchange
          description: |-
            * `credit` - credit
            * `debit` - debit
            * `exchange` - exchange
        - in: query
          name: created_by
          schema:
            type: integer
        - in: query
          name: created_by__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: end_at
          schema:
            type: string
            format: date
        - in: query
          name: maintenance__isnull
          schema:
            type: boolean
        - in: query
          name: method
          schema:
            type: integer
            title: Способ
            enum:
              - 0
              - 1
          description: |-
            * `0` - Приход
            * `1` - Расход
        - in: query
          name: method__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: rental_point
          schema:
            type: number
        - in: query
          name: request__client
          schema:
            type: integer
        - in: query
          name: request__client__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: request__isnull
          schema:
            type: boolean
        - in: query
          name: request__rental_point
          schema:
            type: integer
        - in: query
          name: request__rental_point__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: request__status
          schema:
            type: integer
            title: Статус
            enum:
              - 0
              - 1
              - 2
              - 3
              - 4
              - 5
              - 6
          description: |-
            * `0` - Запрос
            * `1` - Забронировано
            * `2` - В аренде
            * `3` - Отменено
            * `4` - Завершено
            * `5` - Должник
            * `6` - Просрочка
        - in: query
          name: request__status__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: sale__isnull
          schema:
            type: boolean
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - in: query
          name: start_at
          schema:
            type: string
            format: date
        - in: query
          name: statement__counterparty
          schema:
            type: integer
        - in: query
          name: statement__counterparty__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: statement__inventory
          schema:
            type: integer
        - in: query
          name: statement__inventory__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: statement__inventory__rental_point
          schema:
            type: integer
        - in: query
          name: statement__inventory__rental_point__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: statement__isnull
          schema:
            type: boolean
        - in: query
          name: statement_end_at
          schema:
            type: string
            format: date
        - in: query
          name: statement_start_at
          schema:
            type: string
            format: date
        - in: query
          name: status
          schema:
            type: string
            title: Статус
            enum:
              - expired
              - failure
              - pending
              - success
          description: |-
            * `pending` - Ожидает оплаты
            * `success` - Успешно
            * `failure` - Ошибка
            * `expired` - Истёк срок
        - in: query
          name: status__in
          schema:
            type: array
            items:
              type: string
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: tags
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: type
          schema:
            type: integer
        - in: query
          name: type__in
          schema:
            type: array
            items:
              type: integer
          description: Несколько значений могут быть разделены запятыми.
          explode: false
          style: form
        - in: query
          name: workshop__isnull
          schema:
            type: boolean
        - $ref: '#/components/parameters/TenantId'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetricsFinancePnL'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    MetricsFinancePnL:
      type: object
      properties:
        year:
          type: integer
        month:
          type: integer
        prediction:
          type: string
          readOnly: true
        prediction_request:
          type: string
          readOnly: true
        prediction_service:
          type: string
          readOnly: true
        prediction_delivery:
          type: string
          readOnly: true
        prediction_penalty:
          type: string
          readOnly: true
        prediction_sale:
          type: string
          readOnly: true
        prediction_workshop:
          type: string
          readOnly: true
        prediction_maintenance:
          type: string
          readOnly: true
        expenses:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
        profit:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
        categories:
          type: string
          readOnly: true
        saldo:
          type: string
          readOnly: true
      required:
        - categories
        - expenses
        - month
        - prediction
        - prediction_delivery
        - prediction_maintenance
        - prediction_penalty
        - prediction_request
        - prediction_sale
        - prediction_service
        - prediction_workshop
        - profit
        - saldo
        - year
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````