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

# Create inventories



## OpenAPI

````yaml /openapi/main.json post /v1/crm/inventories/
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/inventories/:
    post:
      tags:
        - inventories
      summary: Create inventories
      operationId: inventories_create
      parameters:
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryEdit'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/InventoryEdit'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/InventoryEdit'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InventoryEdit'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    InventoryEdit:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        car:
          allOf:
            - $ref: '#/components/schemas/InventoryCarCreateUpdate'
          nullable: true
        subleases:
          type: array
          items:
            $ref: '#/components/schemas/InventorySublease'
          readOnly: true
        category:
          type: integer
          nullable: true
        rental_point:
          type: integer
          nullable: true
        deleted:
          type: boolean
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
          title: Создан
        updated_at:
          type: string
          format: date-time
          readOnly: true
          title: Обновлен
        name:
          type: string
          title: Название
          maxLength: 255
        unique_id:
          type: string
          nullable: true
          title: Артикул
          maxLength: 255
        device_unique_id:
          type: string
          readOnly: true
          nullable: true
          title: Идентификатор устройства
        type:
          allOf:
            - $ref: '#/components/schemas/Type9ddEnum'
          title: Тип
          minimum: 0
          maximum: 32767
        buy_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          nullable: true
          title: Цена покупки
        buy_date:
          type: string
          format: date
          nullable: true
          title: Дата покупки
        sell_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          nullable: true
          title: Цена продажи
        sell_date:
          type: string
          format: date-time
          nullable: true
          title: Дата продажи
        lifetime:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          nullable: true
          title: Срок службы, дней
        stock_price:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          nullable: true
          title: Складская цена
        comment:
          type: string
          nullable: true
          title: Комментарий
          maxLength: 1024
        image:
          type: string
          format: uri
          nullable: true
          title: Изображение
        prev_earning:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          title: Заработано ранее
        extra:
          title: Доп. данные
        tenant:
          type: integer
        group:
          type: integer
          nullable: true
          title: Группа инвентаря
        state:
          type: integer
          nullable: true
          title: Состояние
      required:
        - created_at
        - deleted
        - device_unique_id
        - id
        - name
        - subleases
        - updated_at
    InventoryCarCreateUpdate:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/Type839Enum'
          default: CAR
        number:
          type: string
          nullable: true
        tech_passport:
          type: string
          nullable: true
        serial:
          type: string
          nullable: true
        vin:
          type: string
          nullable: true
        brand:
          type: string
          nullable: true
        model:
          type: string
          nullable: true
        extra:
          nullable: true
    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
    Type9ddEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Аренда
        * `1` - Продажа
    Type839Enum:
      enum:
        - CAR
        - SCOOTER
        - MOTORCYCLE
      type: string
      description: |-
        * `CAR` - Автомобиль
        * `SCOOTER` - Электросамокат
        * `MOTORCYCLE` - Мотоцикл/Мопед
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````