Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sistemashm24/pagos_hotspot_api/llms.txt

Use this file to discover all available pages before exploring further.

Pagos Hotspot API is a production-ready FastAPI service that powers paid WiFi access on MikroTik Hotspot networks. When a customer pays through your captive portal, the API processes the card charge, creates a Hotspot user on your router, and optionally auto-connects the device — all in a single request.

Quickstart

Make your first payment request and get WiFi credentials in under 5 minutes

API Reference

Full endpoint documentation with request/response schemas and examples

Authentication

Understand API Keys, JWT sessions, and the dual-auth system

Captive Portal Guide

Integrate the API into a MikroTik captive portal HTML page

How It Works

The API sits between your MikroTik captive portal and your payment gateway. Each router gets its own JWT-based API Key, and each company manages its own payment credentials.
1

Customer connects to WiFi

The device is redirected to the MikroTik captive portal page hosted by the operator.
2

Customer selects a plan and pays

The portal calls GET /api/v1/catalogo_perfiles_venta to list plans, then tokenizes the card using Conekta.js or Mercado Pago SDK.
3

API processes the payment

A POST to /api/v1/payments/pagar-conekta or /api/v1/payments/pagar-mercado-pago creates the MikroTik user first, then charges the card. If the charge fails, the user is rolled back automatically.
4

Credentials delivered, device connected

The response includes the hotspot username and password. If auto_connect: true and a MAC address were sent, the API injects a MAC cookie so the device connects without requiring manual login.

Key Features

Dual Payment Gateways

Accept cards through Conekta (Mexico) or Mercado Pago (LATAM). Each company configures its own credentials independently.

Automatic MikroTik Integration

Users are created and deleted directly on the RouterOS API. Rollback is automatic if payment fails.

Auto-Connection

Inject MAC cookies into MikroTik so customers with random MAC addresses connect automatically after purchase.

Multi-Tenant

Separate companies, routers, products, and API Keys. A single deployment serves unlimited operators.

Webhook Support

Mercado Pago webhooks update transaction state in real time. HMAC-SHA256 signature verification included.

Telegram Notifications

Optional Telegram bot alerts for every approved or rejected payment, per company.

Quick Example

curl -X POST https://your-api.com/api/v1/payments/pagar-conekta \
  -H "X-API-Key: jwt_eyJhbGci..." \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": 1,
    "card_token": "tok_test_xxxx",
    "customer_name": "Juan García",
    "customer_email": "[email protected]",
    "mac_address": "AA:BB:CC:DD:EE:FF",
    "auto_connect": true
  }'
{
  "success": true,
  "id_transaccion": "ord_2tL4XXXX",
  "estado_pago": "paid",
  "usuario_hotspot": {
    "usuario": "AB3C9D",
    "contrasena": "1234"
  },
  "auto_conexion": {
    "estado": "conectado",
    "mac": "AA:BB:CC:DD:EE:FF",
    "verificado": true
  }
}
The interactive API docs are available at /docs (Swagger UI) and /redoc on your running server instance.

Build docs developers (and LLMs) love