> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ugps.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new discount

> Operacion: Create a new discount.



## OpenAPI

````yaml /generated/specs/finance.json post /api/v1/descuentos
openapi: 3.0.0
info:
  title: Raul API - Finanzas
  description: >-
    Facturas, boletas, ejecuciones de billing, cuentas por pagar y medios de
    pago.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/descuentos:
    post:
      tags:
        - Billing - Descuentos
      summary: Create a new discount
      description: 'Operacion: Create a new discount.'
      operationId: DescuentoController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDescuentoDto'
      responses:
        '201':
          description: Discount created successfully
        '400':
          description: Validation error
      security:
        - bearerAuth: []
components:
  schemas:
    CreateDescuentoDto:
      type: object
      properties:
        client_id:
          type: string
          description: Client UUID
        subscription_id:
          type: string
          description: >-
            Subscription UUID (null = entire invoice). Deprecated: use
            subscription_ids.
        subscription_ids:
          description: Array of subscription UUIDs for multi-subscription discounts
          type: array
          items:
            type: string
        motivo_descuento_id:
          type: string
          description: Motivo descuento UUID
        motivo_otro:
          type: string
          description: Custom reason text (only when motivo is "Otro")
        tipo_descuento:
          type: string
          description: Discount type
          enum:
            - porcentaje
            - monto_clp
            - monto_uf
        valor:
          type: number
          description: Discount value (10 = 10% or $10 or 10 UF)
        periodo_inicio:
          type: string
          description: Start period in YYYY-MM format
          example: 2026-03
        duracion_meses:
          type: number
          description: Duration in months (1 = one-time, N = recurring)
          minimum: 1
          maximum: 36
      required:
        - client_id
        - motivo_descuento_id
        - tipo_descuento
        - valor
        - periodo_inicio
        - duracion_meses
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Token de sesión Better Auth para rutas de backoffice; las rutas de
        portal usan su token propio.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.