> ## 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 finances



## OpenAPI

````yaml /openapi/metrics.json get /v1/crm/metrics/finances/
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/:
    get:
      tags:
        - finances
      summary: Get finances
      operationId: finances_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
        - name: ordering
          required: false
          in: query
          description: Which field to use when ordering the results.
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: A page number within the paginated result set.
          schema:
            type: integer
        - name: pageSize
          required: false
          in: query
          description: Number of results to return per page.
          schema:
            type: integer
        - 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:
                $ref: '#/components/schemas/PaginatedMetricsFinanceList'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    PaginatedMetricsFinanceList:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/MetricsFinance'
    MetricsFinance:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        method:
          allOf:
            - $ref: '#/components/schemas/MethodEnum'
          title: Способ
          minimum: -32768
          maximum: 32767
        account:
          type: integer
          nullable: true
          title: Счёт
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          title: Сумма
        type:
          type: integer
          nullable: true
          title: Способ оплаты
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
        comment:
          type: string
          nullable: true
          title: Комментарий
        created_by:
          type: integer
          nullable: true
          title: Создал
        sale:
          type: integer
          nullable: true
          title: Продажа
        workshop:
          type: integer
          nullable: true
          title: Задача сервиса
        request:
          type: integer
          nullable: true
          title: Аренда
        maintenance:
          type: integer
          nullable: true
          title: Обслуживание
        client_id:
          type: integer
        client_name:
          type: string
        client_phone:
          type: string
        client_avatar:
          type: string
          readOnly: true
        request_status:
          type: integer
        deposit:
          type: integer
          nullable: true
          title: Залог
        rental_point:
          type: integer
        category:
          type: integer
          nullable: true
          title: Статья
        statement_id:
          type: integer
          readOnly: true
        statement_type:
          type: integer
          readOnly: true
        statement_inventory:
          allOf:
            - $ref: '#/components/schemas/CarInventory'
          readOnly: true
        statement_counterparty:
          allOf:
            - $ref: '#/components/schemas/Counterparty'
          readOnly: true
        statement_date:
          type: string
          format: date-time
          readOnly: true
        statement_maintenance_resource:
          allOf:
            - $ref: '#/components/schemas/StatementMaintenanceResource'
          readOnly: true
        statement_comments:
          type: array
          items:
            $ref: '#/components/schemas/CommentAttachment'
          readOnly: true
        statement_images:
          type: array
          items:
            $ref: '#/components/schemas/ImageAttachment'
          readOnly: true
        exchange:
          allOf:
            - $ref: '#/components/schemas/TransactionExchange'
          readOnly: true
        tags:
          type: array
          items:
            type: integer
        refund:
          allOf:
            - $ref: '#/components/schemas/TransactionRefund'
          readOnly: true
        extra:
          nullable: true
          title: Доп. данные
        status:
          allOf:
            - $ref: '#/components/schemas/StatusE73Enum'
          title: Статус
        deposit_charge:
          type: boolean
          readOnly: true
      required:
        - client_avatar
        - client_id
        - client_name
        - client_phone
        - created_at
        - deposit_charge
        - exchange
        - id
        - refund
        - rental_point
        - request_status
        - statement_comments
        - statement_counterparty
        - statement_date
        - statement_id
        - statement_images
        - statement_inventory
        - statement_maintenance_resource
        - statement_type
    MethodEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Приход
        * `1` - Расход
    CarInventory:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        group:
          type: integer
          nullable: true
          title: Группа инвентаря
        name:
          type: string
          title: Название
          maxLength: 255
        unique_id:
          type: string
          nullable: true
          title: Артикул
          maxLength: 255
        category:
          type: integer
          nullable: true
          title: Категория
        image:
          type: string
          format: uri
          nullable: true
          title: Изображение
        extra:
          title: Доп. данные
        subleases:
          type: array
          items:
            $ref: '#/components/schemas/InventorySublease'
          readOnly: true
        state:
          type: integer
          nullable: true
          title: Состояние
        disabled:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/DisabledEnum'
            - $ref: '#/components/schemas/NullEnum'
        rental_point:
          type: integer
          nullable: true
          title: Точка проката
        car:
          allOf:
            - $ref: '#/components/schemas/InventoryCar'
          readOnly: true
      required:
        - car
        - id
        - name
        - subleases
    Counterparty:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        access:
          type: array
          items:
            type: integer
          nullable: true
        deleted:
          type: boolean
          readOnly: true
        name:
          type: string
          maxLength: 255
        side:
          allOf:
            - $ref: '#/components/schemas/SideEnum'
          minimum: -32768
          maximum: 32767
        source:
          allOf:
            - $ref: '#/components/schemas/SourceEnum'
          minimum: -32768
          maximum: 32767
        type:
          allOf:
            - $ref: '#/components/schemas/Type6ecEnum'
          minimum: -32768
          maximum: 32767
        category:
          allOf:
            - $ref: '#/components/schemas/CategoryEnum'
          minimum: -32768
          maximum: 32767
        iin:
          type: string
          nullable: true
          maxLength: 12
          minLength: 12
        bin:
          type: string
          nullable: true
          maxLength: 12
          minLength: 12
        iban:
          type: string
          nullable: true
          maxLength: 25
        bank:
          type: string
          nullable: true
          maxLength: 255
        phone:
          type: string
          nullable: true
          maxLength: 32
        owner:
          type: string
          nullable: true
          maxLength: 255
        address:
          type: string
          nullable: true
          maxLength: 255
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        order:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
        extra: {}
        tenant:
          type: integer
      required:
        - deleted
        - id
        - name
    StatementMaintenanceResource:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        maintenance:
          type: integer
        resource:
          allOf:
            - $ref: '#/components/schemas/Resource'
          readOnly: true
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
      required:
        - id
        - maintenance
        - resource
    CommentAttachment:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        body:
          type: string
        user:
          type: integer
          readOnly: true
          nullable: true
        context:
          nullable: true
        content_type:
          type: string
          title: Имя класса модели
        object_id:
          type: integer
          maximum: 9223372036854776000
          minimum: 0
          format: int64
        links:
          type: array
          items:
            $ref: '#/components/schemas/CommentLink'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Обновлен
      required:
        - body
        - content_type
        - created_at
        - id
        - links
        - object_id
        - updated_at
        - user
    ImageAttachment:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        image:
          type: string
          format: uri
          nullable: true
        thumb:
          type: string
          format: uri
          readOnly: true
          nullable: true
        name:
          type: string
          readOnly: true
          nullable: true
        extension:
          type: string
          readOnly: true
        hash:
          type: string
          readOnly: true
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
        created_by:
          type: integer
          readOnly: true
          nullable: true
        content_type:
          type: string
          title: Имя класса модели
        object_id:
          type: integer
          maximum: 9223372036854776000
          minimum: 0
          format: int64
        type:
          type: string
          nullable: true
          maxLength: 255
      required:
        - content_type
        - created_at
        - created_by
        - extension
        - hash
        - id
        - name
        - object_id
        - thumb
    TransactionExchange:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        method:
          allOf:
            - $ref: '#/components/schemas/MethodEnum'
          title: Способ
          minimum: -32768
          maximum: 32767
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          title: Сумма
        type:
          type: integer
          nullable: true
          title: Способ оплаты
        comment:
          type: string
          nullable: true
          title: Комментарий
        account:
          type: integer
          nullable: true
          title: Счёт
        category:
          type: integer
          nullable: true
          title: Статья
        extra:
          nullable: true
          title: Доп. данные
      required:
        - id
    TransactionRefund:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        reason:
          type: string
          nullable: true
      required:
        - id
    StatusE73Enum:
      enum:
        - pending
        - success
        - failure
        - expired
      type: string
      description: |-
        * `pending` - Ожидает оплаты
        * `success` - Успешно
        * `failure` - Ошибка
        * `expired` - Истёк срок
    InventorySublease:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        inventory:
          type: integer
          title: Инвентарь
        user:
          type: integer
          title: Владелец субаренды
        percent:
          type: string
          format: decimal
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          title: Процент субаренды
        start_at:
          type: string
          format: date-time
          nullable: true
          title: Начало периода
        end_at:
          type: string
          format: date-time
          nullable: true
          title: Конец периода
        is_current:
          type: boolean
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
      required:
        - created_at
        - id
        - inventory
        - is_current
        - percent
        - user
    DisabledEnum:
      enum:
        - 0
        - 1
        - 2
      type: integer
      description: |-
        * `0` - удалить
        * `1` - Архив
        * `2` - Списано
    NullEnum:
      enum:
        - null
    InventoryCar:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        type:
          $ref: '#/components/schemas/InventoryCarTypeEnum'
        brand:
          type: string
          nullable: true
          maxLength: 255
        model:
          type: string
          nullable: true
          maxLength: 255
        number:
          type: string
          nullable: true
          maxLength: 255
        tech_passport:
          type: string
          nullable: true
          maxLength: 255
        serial:
          type: string
          nullable: true
          maxLength: 255
        vin:
          type: string
          nullable: true
          maxLength: 18
        extra: {}
      required:
        - id
    SideEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Своё
        * `1` - Внешний
    SourceEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Магазин
        * `1` - Расход
    Type6ecEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
      type: integer
      description: |-
        * `0` - ИП
        * `1` - ТОО
        * `2` - АО
        * `3` - ПК
    CategoryEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Приход
        * `1` - Расход
    Resource:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 255
        type:
          allOf:
            - $ref: '#/components/schemas/ResourceTypeEnum'
          minimum: -32768
          maximum: 32767
        price:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
        count:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
        count_left:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
      required:
        - id
        - name
    CommentLink:
      type: object
      properties:
        content_type:
          type: string
          title: Имя класса модели
          readOnly: true
        content_type_label:
          type: string
          readOnly: true
        object_id:
          type: integer
          maximum: 9223372036854776000
          minimum: 0
          format: int64
          title: ID объекта
        label:
          type: string
          readOnly: true
        url:
          type: string
          readOnly: true
      required:
        - content_type
        - content_type_label
        - label
        - object_id
        - url
    InventoryCarTypeEnum:
      enum:
        - CAR
        - SCOOTER
        - MOTORCYCLE
      type: string
      description: |-
        * `CAR` - Автомобиль
        * `SCOOTER` - Электросамокат
        * `MOTORCYCLE` - Мотоцикл/Мопед
    ResourceTypeEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Количество
        * `1` - Сумма
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````