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



## OpenAPI

````yaml /openapi/orders.json post /v1/crm/requests/discounts/
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/requests/discounts/:
    post:
      tags:
        - discounts
      summary: Create discounts
      operationId: discounts_create
      parameters:
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequestDiscount'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/OrderRequestDiscount'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OrderRequestDiscount'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderRequestDiscount'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    OrderRequestDiscount:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        request:
          type: integer
          writeOnly: true
          nullable: true
        request_inventory:
          type: integer
          nullable: true
          title: Позиция аренды
        type:
          allOf:
            - $ref: '#/components/schemas/OrderRequestDiscountTypeEnum'
          title: Тип
          minimum: -32768
          maximum: 32767
        discount:
          type: integer
          nullable: true
          title: Скидка
        discount_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          nullable: true
          default: '0.00'
        scheduled:
          type: boolean
          title: По расписанию
        scheduled_amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
          title: Сумма по расписанию
        start_at:
          type: string
          format: date
          nullable: true
          title: Начало периода
        end_at:
          type: string
          format: date
          nullable: true
          title: Конец периода
        created_by:
          type: integer
          readOnly: true
          nullable: true
          title: Создал
        comments:
          type: array
          items:
            $ref: '#/components/schemas/CommentAttachment'
          readOnly: true
      required:
        - comments
        - created_by
        - id
    OrderRequestDiscountTypeEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Из справочника
        * `1` - Разовая
    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
    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
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````