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

# Previsualizar el impacto de una bajada de plan

> GET /plans/downgrade-impact/

Previsualiza qué recursos bloquearían una bajada de plan antes de confirmar el pago, en el host de la **API de gestión** (`api.scanova.io`), autenticado con tu clave sin procesar de la API de gestión.

```
GET https://api.scanova.io/plans/downgrade-impact/
Authorization: 401f7ac837da42b97f613d789819ff93537bee6a
```

<ParamField query="target_plan" type="string" required>
  El slug del plan objetivo (del campo `slug` de [Listar planes disponibles](/es/api-reference/management-api/plans/available)).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.scanova.io/plans/downgrade-impact/?target_plan=starter-scanova-io" \
    -H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "violations": [
      {
        "codename": "TOTAL_QR_CODES",
        "quota_name": "Total QR Codes",
        "exceed_value": 12,
        "resolvable": true,
        "total_affected_count": 112,
        "affected_resources": ["Q07afe81aa0034c01", "Q19bd72cc1145d02"]
      }
    ],
    "current_plan_expiry": "2027-08-16",
    "days_remaining": 365
  }
  ```
</ResponseExample>

Un array `violations` vacío significa que la bajada es limpia por ahora — no habría que cambiar nada antes. Esto es completamente de solo lectura y no cambia nada; reutiliza exactamente el mismo motor de reglas que aplica el pago real, así que no puede contradecir lo que realmente ocurriría al proceder con la bajada.

### Campos de la respuesta

<ResponseField name="violations" type="array">
  Una entrada por cada cuota que el plan objetivo no puede cubrir dado el uso actual de la cuenta.

  <Expandable title="propiedades de violation">
    <ResponseField name="codename" type="string">El identificador estable de la cuota (p. ej. `TOTAL_QR_CODES`, `SHARED_USERS`).</ResponseField>
    <ResponseField name="quota_name" type="string">Nombre legible de la cuota.</ResponseField>
    <ResponseField name="exceed_value" type="integer">Cuánto excede la cuenta actualmente el límite del plan objetivo.</ResponseField>
    <ResponseField name="resolvable" type="boolean">Si la cuenta puede resolverlo por sí misma (p. ej. eliminando/desactivando algunos recursos) antes de bajar de plan.</ResponseField>
    <ResponseField name="total_affected_count" type="integer">Recuento total de recursos contabilizados contra esta cuota.</ResponseField>
    <ResponseField name="affected_resources" type="array">Identificadores de los recursos concretos contabilizados (p. ej. valores `qrid` de QR) — puede ser una muestra truncada para recuentos altos.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="current_plan_expiry" type="string">
  La fecha de expiración del plan actual, o `null` para un plan sin expiración.
</ResponseField>

<ResponseField name="days_remaining" type="integer | null">
  Días restantes hasta `current_plan_expiry`, o `null` si el plan no tiene expiración.
</ResponseField>

`400` si falta `target_plan`.

## Relacionado

* [Listar planes disponibles](/es/api-reference/management-api/plans/available) — encuentra un `slug` para previsualizar la bajada.
* [Plan actual](/es/api-reference/management-api/plans/current) — el plan actual y las asignaciones de cuota de la cuenta.
* [Resumen de la API de gestión](/es/api-reference/management-api/overview) — el esquema de autenticación y las reglas de cuota que aplican a este endpoint.


## OpenAPI

````yaml api-reference/openapi/management-api.json GET /plans/downgrade-impact/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    api.scanova.io (QR codes, folders, tags, leads, forms, analytics, plans,
    shared users & roles), plus the token-creation and usage-stats endpoints
    used to authenticate against it. Every path and request/response shape below
    was verified live against a real API key and the actual running backend
    (Phase 7, 2026-08-16) — not guessed from reading urls.py alone.
  version: 2.0.0
servers:
  - url: https://api.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /plans/downgrade-impact/:
    get:
      summary: Preview a plan downgrade's impact
      description: >-
        Read-only preview of which specific resources (e.g. QR codes over a new
        lower limit, shared users beyond a new seat count) would block a
        downgrade to `target_plan`, before committing to checkout. Reuses the
        exact same violation-detection logic real checkout enforces, so this
        preview can never disagree with what actually happens at order creation.
      operationId: getManagedDowngradeImpact
      parameters:
        - name: target_plan
          in: query
          required: true
          schema:
            type: string
          description: The target plan's slug.
      responses:
        '200':
          description: >-
            Violations that would block the downgrade (empty array if none),
            plus the current plan's remaining time.
          content:
            application/json:
              example:
                violations:
                  - codename: TOTAL_QR_CODES
                    quota_name: Total QR Codes
                    exceed_value: 12
                    resolvable: true
                    total_affected_count: 112
                    affected_resources:
                      - Q07afe81aa0034c01
                      - Q19bd72cc1145d02
                current_plan_expiry: '2027-08-16'
                days_remaining: 365
        '400':
          description: Missing `target_plan` query parameter.
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Send your Management API key as the raw value of the Authorization
        header — no "Bearer " or "Token " prefix, and no other characters.
        Example: `Authorization: 401f7ac837da42b97f613d789819ff93537bee6a`. A
        header containing more than one space-separated part is rejected
        outright. Requests also require the request's Host header to be the
        management API host (e.g. api.scanova.io) — the same key sent to the
        regular API host will not authenticate.

````