> ## Documentation Index
> Fetch the complete documentation index at: https://alan-ramirez-dev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 🗂️ Formats and Generation

> Documentation of the main endpoint for report compilation.

The microservice processes HTTP requests to render binary documents (CSV or PDF) from data in JSON format, using a dynamic strategy engine.

## 🔌 Generation Endpoint

<ParamField path="POST" type="/api/v1/reportes/generar">
  Compiles a document according to the requested parameters and returns the binary file (`Blob`) for download.
</ParamField>

### 🏷️ Headers

The engine detects the client's preferred language to change it in the generated document.

| Header            | Required | Description                                                                                                                                        |
| :---------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Accept-Language` | Optional | Defines the language of the report. Supported values: `es` (Spanish) or `en` (English). If omitted or invalid, the system applies `es` by default. |

### 📦 Request Payload (Body)

The endpoint expects a body in `application/json` format validated by the strict rules of the controller:

<ParamField body="formato" type="string" required>
  Defines the output engine. Allowed values: `csv`, `pdf`.
</ParamField>

<ParamField body="timezone" type="string">
  Client's timezone to stamp the issuance date (e.g., `America/Mexico_City`). If null, the server's timezone is used.
</ParamField>

<ParamField body="data" type="object" required>
  Main payload container.

  <Expandable title="Properties of the data object">
    <ParamField body="items" type="array">
      Array with the transactional movements. Maximum limits depend on the requested format to protect RAM:

      * **PDF:** Strict limit of **100** elements.
      * **CSV:** Extended limit of **50,000** elements.
    </ParamField>
  </Expandable>
</ParamField>

### 🚦 Infrastructure Rules

To guarantee service stability, the endpoint is protected by a perimeter middleware:

* **Rate Limiting (Throttle):** A maximum of **10 requests per minute per IP address** is allowed. Upon exceeding this threshold, the server will respond with an HTTP `429 Too Many Requests` error.
