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

# Patch discounts



## OpenAPI

````yaml /openapi/config.json patch /v1/crm/discounts/{id}/
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/discounts/{id}/:
    patch:
      tags:
        - discounts
      summary: Patch discounts
      operationId: discounts_partial_update
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
        - $ref: '#/components/parameters/TenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDiscountUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDiscountUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedDiscountUpdate'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountUpdate'
          description: ''
      security:
        - jwtAuth: []
components:
  parameters:
    TenantId:
      name: X-Tenant-Id
      in: header
      required: false
      schema:
        type: integer
      description: >-
        Компания, в контексте которой выполняется запрос — её id из `GET
        /v1/tenant/`. Пользователь должен состоять в этой компании: чужой id
        доступа к данным не даёт. Без заголовка компания определяется по домену
        запроса.
  schemas:
    PatchedDiscountUpdate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          title: Название
          maxLength: 255
        discount:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Размер скидки
        discount_type:
          allOf:
            - $ref: '#/components/schemas/DiscountTypeEnum'
          title: Тип скидки
          minimum: -2147483648
          maximum: 2147483647
        type:
          allOf:
            - $ref: '#/components/schemas/TypeEnum'
          title: Тип
          minimum: -2147483648
          maximum: 2147483647
        extra:
          title: Доп. данные
        active:
          type: boolean
          title: Активна
        start_at:
          type: string
          format: date-time
          nullable: true
          title: Начало Акции
        end_at:
          type: string
          format: date-time
          nullable: true
          title: Конец Акции
        usage_limit:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Лимит использований
    DiscountUpdate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          title: Название
          maxLength: 255
        discount:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Размер скидки
        discount_type:
          allOf:
            - $ref: '#/components/schemas/DiscountTypeEnum'
          title: Тип скидки
          minimum: -2147483648
          maximum: 2147483647
        type:
          allOf:
            - $ref: '#/components/schemas/TypeEnum'
          title: Тип
          minimum: -2147483648
          maximum: 2147483647
        extra:
          title: Доп. данные
        active:
          type: boolean
          title: Активна
        start_at:
          type: string
          format: date-time
          nullable: true
          title: Начало Акции
        end_at:
          type: string
          format: date-time
          nullable: true
          title: Конец Акции
        usage_limit:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Лимит использований
      required:
        - id
        - name
    DiscountTypeEnum:
      enum:
        - 0
        - 1
      type: integer
      description: |-
        * `0` - Процент
        * `1` - Сумма
    TypeEnum:
      enum:
        - 0
        - 1
        - 2
      type: integer
      description: |-
        * `0` - Скидка
        * `1` - Промокод
        * `2` - Сумма
  securitySchemes:
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````