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



## OpenAPI

````yaml /openapi/main.json get /v1/crm/clients/
openapi: 3.0.3
info:
  title: Yume API — Основное
  version: 1.0.0
  description: Базовые сущности и бизнес-логика CRM.
servers:
  - url: https://api.yume.cloud
    description: Production
  - url: https://api.stage.yume.cloud
    description: Stage
security: []
paths:
  /v1/crm/clients/:
    get:
      tags:
        - clients
      summary: Get clients
      operationId: clients_list
      parameters:
        - 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
        - name: search
          required: false
          in: query
          description: A search term.
          schema:
            type: string
        - $ref: '#/components/parameters/TenantId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedClientList'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    PaginatedClientList:
      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/Client'
    Client:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        ticks:
          type: array
          items:
            $ref: '#/components/schemas/ClientTickRelation'
          readOnly: true
        bonus:
          allOf:
            - $ref: '#/components/schemas/ClientBonus'
          readOnly: true
        orders_count:
          type: integer
          readOnly: true
        orders_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
        orders_paid_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
        orders_debt_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
        overdue_rentals_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
        transfer_count:
          type: integer
          readOnly: true
        transfer_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          readOnly: true
        last_rent_date:
          type: string
          format: date-time
          readOnly: true
        total_time:
          type: string
          readOnly: true
        iin:
          type: string
          readOnly: true
        bin:
          type: string
          readOnly: true
        legal:
          allOf:
            - $ref: '#/components/schemas/PassportLegal'
          writeOnly: true
          nullable: true
        individual:
          allOf:
            - $ref: '#/components/schemas/PassportIndividual'
          writeOnly: true
          nullable: true
        balance:
          type: string
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Обновлен
        created_at:
          type: string
          format: date-time
        uuid:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          title: Название
          maxLength: 512
        type:
          allOf:
            - $ref: '#/components/schemas/Type433Enum'
          title: Тип
          minimum: 0
          maximum: 2147483647
        legal_type:
          nullable: true
          title: Форма организации
          minimum: 0
          maximum: 2147483647
          oneOf:
            - $ref: '#/components/schemas/LegalTypeEnum'
            - $ref: '#/components/schemas/NullEnum'
        gender:
          nullable: true
          title: Пол
          minimum: 0
          maximum: 2147483647
          oneOf:
            - $ref: '#/components/schemas/GenderEnum'
            - $ref: '#/components/schemas/NullEnum'
        comment:
          type: string
          nullable: true
          title: Комментарий
          maxLength: 512
        avatar:
          type: string
          format: uri
          nullable: true
          title: Фото
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        phone:
          type: string
          title: Телефон
          maxLength: 32
        deposit:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          nullable: true
          title: Залог
        agreement_id:
          type: string
          readOnly: true
          nullable: true
        signed:
          type: boolean
        sign_date:
          type: string
          format: date
          nullable: true
        sign_expires:
          type: string
          format: date
          nullable: true
        extra:
          title: Доп. данные
        tenant:
          type: integer
        legal_passport:
          type: integer
          nullable: true
          title: Реквизиты юр. лица
        individual_passport:
          type: integer
          nullable: true
          title: Документ, удостоверяющий личность
        attraction:
          type: integer
          nullable: true
          title: Источник привлечения
        discount:
          type: integer
          nullable: true
          title: Скидка
        user:
          type: integer
          nullable: true
      required:
        - agreement_id
        - balance
        - bin
        - bonus
        - id
        - iin
        - last_rent_date
        - name
        - orders_amount
        - orders_count
        - orders_debt_amount
        - orders_paid_amount
        - overdue_rentals_amount
        - phone
        - ticks
        - total_time
        - transfer_amount
        - transfer_count
        - updated_at
        - uuid
    ClientTickRelation:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        tick:
          type: integer
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
      required:
        - created_at
        - id
        - tick
    ClientBonus:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
      required:
        - created_at
        - id
    PassportLegal:
      type: object
      properties:
        bin:
          type: string
          nullable: true
          maxLength: 12
          minLength: 12
        address:
          type: string
          nullable: true
          maxLength: 255
        director:
          type: string
          nullable: true
          maxLength: 255
        iban:
          type: string
          nullable: true
          maxLength: 25
        bik:
          type: string
          nullable: true
          maxLength: 8
        bank:
          type: string
          nullable: true
          maxLength: 255
    PassportIndividual:
      type: object
      properties:
        iin:
          type: string
          nullable: true
          maxLength: 14
          minLength: 12
        address:
          type: string
          nullable: true
          maxLength: 255
        document_number:
          type: string
          nullable: true
          maxLength: 255
        issuer_manual:
          type: string
          nullable: true
          maxLength: 255
        issue_date:
          type: string
          format: date
          nullable: true
        issue_date_end:
          type: string
          format: date
          nullable: true
        birth_date:
          type: string
          format: date
          nullable: true
    Type433Enum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Физ. лицо
        * `1` - Юр. лицо
    LegalTypeEnum:
      enum:
        - 0
        - 1
        - 2
        - 3
      type: integer
      description: |-
        * `0` - ИП
        * `1` - ТОО
        * `2` - АО
        * `3` - ПК
    NullEnum:
      enum:
        - null
    GenderEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - мужской
        * `1` - женский
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````