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

# Generar borradores mensuales async para todos los clientes con suscripción activa

> Generar borradores mensuales async para todos los clientes con suscripción activa. Retorna inmediatamente con batch_job_id; el progreso se emite por WebSocket (batch:progress, batch:complete).



## OpenAPI

````yaml /generated/specs/finance.json post /api/v1/billing/invoices/batch/generate-monthly
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/billing/invoices/batch/generate-monthly:
    post:
      tags:
        - Invoices
      summary: >-
        Generar borradores mensuales async para todos los clientes con
        suscripción activa
      description: >-
        Generar borradores mensuales async para todos los clientes con
        suscripción activa. Retorna inmediatamente con batch_job_id; el progreso
        se emite por WebSocket (batch:progress, batch:complete).
      operationId: InvoiceBatchController_batchGenerateMonthly
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateMonthlyDraftsDto'
      responses:
        '202':
          description: 'Batch iniciado. Campos: batch_job_id, total.'
      security:
        - bearerAuth: []
components:
  schemas:
    GenerateMonthlyDraftsDto:
      type: object
      properties:
        periodo:
          type: string
          description: Billing period in YYYY-MM format
          example: 2026-02
        client_rounding_adjustments:
          type: object
          description: >-
            Optional map of client UUID to non-negative CLP rounding adjustment.
            Used to make a draft total match an external document (e.g. a
            purchase order).
          example:
            a1b2c3d4-e5f6-7890-abcd-ef1234567890: 1
      required:
        - periodo
  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.