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

# Regenerate billing drafts by group for a client

> Regenerates one DRAFT invoice per billing group for a client.



## OpenAPI

````yaml /generated/specs/finance.json post /api/v1/billing/clients/{clientId}/groups/regenerate-drafts
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/clients/{clientId}/groups/regenerate-drafts:
    post:
      tags:
        - Billing - Grupos de Facturación
      summary: Regenerate billing drafts by group for a client
      description: Regenerates one DRAFT invoice per billing group for a client.
      operationId: BillingGroupController_regenerateDraftsByGroups
      parameters:
        - name: clientId
          required: true
          in: path
          description: Client UUID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegenerateClientDraftDto'
      responses:
        '200':
          description: Grouped draft regeneration report
      security:
        - bearerAuth: []
components:
  schemas:
    RegenerateClientDraftDto:
      type: object
      properties:
        periodo:
          type: string
          description: Billing period in YYYY-MM format
          example: 2026-03
        billing_group_id:
          type: string
          description: >-
            When provided, regenerate only the draft for this specific billing
            group
          example: uuid-of-billing-group
        receiver_rut:
          type: string
          description: >-
            Override receiver RUT (e.g. after correcting a client RUT). When
            provided, uses this value instead of reading from the client table.
          example: 76072681-8
        rounding_adjustment_amount:
          type: number
          description: >-
            Optional non-negative CLP adjustment added to the draft total to
            match an external document (e.g. a purchase order).
          example: 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.