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

# Listar niveles

> Devuelve los niveles del programa de fidelidad del comercio, paginados y ordenados por puntos mínimos ascendente.

El `id` de cada nivel sirve para filtrar el catálogo de premios con `GET /external/products?levelId=`, y aparece en el array `offers` de cada premio indicando cuántos puntos cuesta para ese nivel.

**Atención**: este endpoint devuelve `{ data, meta, links }` en la raíz, sin el envelope `{ success, status, message, data }`.



## OpenAPI

````yaml /api-reference/openapi.json get /external/levels
openapi: 3.0.0
info:
  title: API de Tienda de Puntos
  description: >-
    API pública de Tienda de Puntos. Permite sumar puntos por compra, consultar
    clientes, validar canjes y consumir cupones desde tu POS, ERP o e-commerce.


    Todas las llamadas se autentican con el header `x-api-key`.
  version: 0.0.1
  contact: {}
servers:
  - url: https://api.tiendadepuntos.com
    description: Producción
  - url: https://apidev.tiendadepuntos.com
    description: Desarrollo
security:
  - ApiKeyAuth: []
tags: []
paths:
  /external/levels:
    get:
      tags:
        - Niveles
      summary: Listar niveles
      description: >-
        Devuelve los niveles del programa de fidelidad del comercio, paginados y
        ordenados por puntos mínimos ascendente.


        El `id` de cada nivel sirve para filtrar el catálogo de premios con `GET
        /external/products?levelId=`, y aparece en el array `offers` de cada
        premio indicando cuántos puntos cuesta para ese nivel.


        **Atención**: este endpoint devuelve `{ data, meta, links }` en la raíz,
        sin el envelope `{ success, status, message, data }`.
      operationId: ExternalLevelController_findAll
      parameters:
        - name: order
          required: false
          in: query
          description: Campo por el que ordenar.
          schema:
            type: string
            enum:
              - name
              - minPoints
              - createdAt
        - name: page
          required: false
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
            example: 1
        - name: limit
          required: false
          in: query
          description: Cantidad de resultados por página. Máximo 200.
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 10
            example: 10
        - name: query
          required: false
          in: query
          description: Búsqueda parcial por nombre.
          schema:
            type: string
            example: café
        - name: direction
          required: false
          in: query
          description: Sentido del orden. Solo aplica si se envía `order`.
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        '200':
          description: Página de niveles. Sin envelope.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ExternalLevelOutputDto'
                  meta:
                    type: object
                    properties:
                      totalItems:
                        type: integer
                        example: 128
                      itemCount:
                        type: integer
                        example: 10
                      itemsPerPage:
                        type: integer
                        example: 10
                      totalPages:
                        type: integer
                        example: 13
                      currentPage:
                        type: integer
                        example: 1
                      from:
                        type: integer
                        example: 1
                      to:
                        type: integer
                        example: 10
                  links:
                    type: object
                    properties:
                      first:
                        type: string
                        example: external/levels?page=1&limit=10
                      previous:
                        type: string
                        example: null
                        nullable: true
                      next:
                        type: string
                        nullable: true
                        example: external/levels?page=2&limit=10
                      last:
                        type: string
                        example: external/levels?page=13&limit=10
                      path:
                        type: string
                        example: external/levels
                      firstPageUrl:
                        type: string
                        example: external/levels?page=1&limit=10
                      lastPageUrl:
                        type: string
                        example: external/levels?page=13&limit=10
        '400':
          description: El cuerpo o los parámetros no pasaron la validación.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 400
                  timestamp:
                    type: string
                    format: date-time
                    example: '2026-07-31T14:05:12.431Z'
                  path:
                    type: string
                    example: /external/tags/add
                  method:
                    type: string
                    example: POST
                  message:
                    type: string
                    example: Error de validación
                  errors:
                    type: array
                    nullable: true
                    items:
                      type: object
                  data:
                    type: object
                    nullable: true
        '404':
          description: >-
            Falta el header `x-api-key` (`Api Key is required`) o la API key no
            corresponde a ningún comercio (`Business not found`). También se usa
            cuando el recurso pedido no existe.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    example: 404
                  timestamp:
                    type: string
                    format: date-time
                    example: '2026-07-31T14:05:12.431Z'
                  path:
                    type: string
                    example: /external/tags/add
                  method:
                    type: string
                    example: POST
                  message:
                    type: string
                    example: Api Key is required
                  errors:
                    type: array
                    nullable: true
                    items:
                      type: object
                  data:
                    type: object
                    nullable: true
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ExternalLevelOutputDto:
      type: object
      properties:
        id:
          type: number
          description: ID del nivel.
          example: 3
        name:
          type: string
          description: Nombre del nivel.
          example: Nivel 2
        description:
          type: string
          description: Descripción del nivel.
          example: Beneficios para clientes frecuentes.
          nullable: true
        minPoints:
          type: number
          description: Puntos acumulados que necesita un cliente para alcanzar este nivel.
          example: 5000
        pointsMultiplier:
          type: number
          description: >-
            Multiplicador de puntos que se aplica a las compras de los clientes
            de este nivel. `1` significa sin bonificación.
          example: 1.5
        colors:
          type: object
          description: Colores con los que el nivel se muestra en la app del cliente.
          example:
            primary: '#55ffff'
            secondary: '#abffff'
            border: '#000000'
        createdAt:
          format: date-time
          type: string
          example: '2026-02-14T12:30:00.000Z'
        updatedAt:
          format: date-time
          type: string
          example: '2026-06-01T09:15:00.000Z'
      required:
        - id
        - name
        - description
        - minPoints
        - pointsMultiplier
        - colors
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key del comercio. Se genera desde el panel de Tienda de Puntos, en
        Configuración → Integraciones.

````