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.

Transactions are created automatically when a customer completes (or attempts) a payment through the captive portal. These read-only endpoints give client admins visibility into payment activity, revenue totals, and recent events — without requiring access to the payment gateway dashboard. All endpoints require Authorization: Bearer <session_token> for a cliente_admin user.

GET /api/v1/admin/mi-empresa/transacciones

Returns a paginated list of all transactions for the authenticated company, sorted by creation date descending (most recent first).
cURL
curl -X GET "https://api.example.com/api/v1/admin/mi-empresa/transacciones?limit=20&offset=0" \
  -H "Authorization: Bearer <session_token>"

Query Parameters

limit
integer
default:"50"
Maximum number of transactions to return. Use together with offset to page through large result sets.
offset
integer
default:"0"
Number of records to skip before returning results. For example, to fetch page 3 with 20 items per page: offset=40&limit=20.

Response

empresa_id
string
required
The company ID that owns these transactions.
total
integer
required
Total number of transactions in the database for this company (across all pages). Use this to calculate total page count.
limit
integer
required
The limit value applied to this response.
offset
integer
required
The offset value applied to this response.
transacciones
array
required
Array of transaction objects.
Example Response
{
  "empresa_id": "EMP_3A9F1C0B2D",
  "total": 142,
  "limit": 20,
  "offset": 0,
  "transacciones": [
    {
      "id": 142,
      "transaccion_id": "ord_2xxxxxxxxxxxxxb",
      "monto": 50.0,
      "estado_pago": "paid",
      "cliente_nombre": "Juan Pérez",
      "creada_en": "2025-01-15T14:32:10.123456"
    },
    {
      "id": 141,
      "transaccion_id": "ord_2xxxxxxxxxxxxxc",
      "monto": 10.0,
      "estado_pago": "paid",
      "cliente_nombre": "Ana López",
      "creada_en": "2025-01-15T13:10:05.654321"
    },
    {
      "id": 140,
      "transaccion_id": "pref_1234567890",
      "monto": 50.0,
      "estado_pago": "pending",
      "cliente_nombre": "Carlos Ramos",
      "creada_en": "2025-01-15T12:00:00.000000"
    }
  ]
}

Pagination Example

cURL — Page 2 (items 21–40)
curl -X GET "https://api.example.com/api/v1/admin/mi-empresa/transacciones?limit=20&offset=20" \
  -H "Authorization: Bearer <session_token>"

GET /api/v1/admin/mi-empresa/dashboard

Returns a summary of company activity: aggregate statistics computed from all transactions plus the 5 most recent transactions. Designed for the main admin dashboard view.
cURL
curl -X GET "https://api.example.com/api/v1/admin/mi-empresa/dashboard" \
  -H "Authorization: Bearer <session_token>"

Response

empresa
object
required
estadisticas
object
required
transacciones_recientes
array
required
The 5 most recent transactions, ordered by creada_en descending.
Example Response
{
  "empresa": {
    "nombre": "WiFi Parque Central",
    "activa": true
  },
  "estadisticas": {
    "total_transacciones": 142,
    "ingresos_totales": 5740.0,
    "transacciones_pagadas": 138,
    "transacciones_pendientes": 4,
    "total_routers": 3
  },
  "transacciones_recientes": [
    {
      "id": 142,
      "transaccion_id": "ord_2xxxxxxxxxxxxxb",
      "monto": 50.0,
      "estado": "paid",
      "fecha": "2025-01-15T14:32:10.123456"
    },
    {
      "id": 141,
      "transaccion_id": "ord_2xxxxxxxxxxxxxc",
      "monto": 10.0,
      "estado": "paid",
      "fecha": "2025-01-15T13:10:05.654321"
    },
    {
      "id": 140,
      "transaccion_id": "pref_1234567890",
      "monto": 50.0,
      "estado": "pending",
      "fecha": "2025-01-15T12:00:00.000000"
    },
    {
      "id": 139,
      "transaccion_id": "ord_2xxxxxxxxxxxxxd",
      "monto": 10.0,
      "estado": "paid",
      "fecha": "2025-01-15T11:45:00.000000"
    },
    {
      "id": 138,
      "transaccion_id": "ord_2xxxxxxxxxxxxxe",
      "monto": 50.0,
      "estado": "paid",
      "fecha": "2025-01-15T10:20:00.000000"
    }
  ]
}

Transaccion Model Fields

All transaction objects stored in the transacciones table share the following columns. The list endpoint returns only a subset (see above); the full schema is documented here for reference.
id
integer
required
Auto-incremented internal database ID.
transaccion_id
string
Unique transaction reference string generated at payment creation. For Conekta this is the Order ID (e.g. "ord_2xxxxxxxxxxxxxb"); for Mercado Pago it is derived from the preference or payment ID. Unique across the platform.
external_reference
string
External reference string used as the correlation key in payment gateway webhooks. Unique across the platform.
empresa_id
string
required
ID of the company that owns this transaction (e.g. "EMP_3A9F1C0B2D").
router_id
string
required
ID of the router through which the hotspot session is granted (e.g. "RTR_A1B2C3D4").
producto_id
integer
ID of the product (plan) the customer purchased. May be null for legacy transactions created before products were introduced.
monto
number
required
Transaction amount as a decimal, e.g. 50.00.
moneda
string
ISO 4217 currency code. Defaults to "MXN".
cliente_nombre
string
Customer full name collected at checkout. null if not captured.
cliente_email
string
Customer email address. null if not captured.
cliente_telefono
string
Customer phone number. null if not captured.
usuario_hotspot
string
MikroTik Hotspot username generated for the customer upon successful payment. null before payment is confirmed.
password_hotspot
string
MikroTik Hotspot password paired with usuario_hotspot. null before payment is confirmed.
expiracion_hotspot
string (ISO 8601)
Timestamp when the hotspot session will expire. Derived from the MikroTik profile’s session_timeout. null before the hotspot user is created.
estado_pago
string
Payment gateway state. See Payment States below. Defaults to "pending".
estado_hotspot
string
State of the hotspot user creation step. "pending" until the webhook is processed; set to "created" once the MikroTik user is created, or "failed" if creation failed. Defaults to "pending".
webhook_processed
boolean
true once the payment gateway webhook has been received and processed. Defaults to false.
notification_id
string
Mercado Pago notification ID from the incoming webhook payload. Used for idempotency. null for Conekta transactions.
metadata_json
object
Arbitrary JSON metadata attached to the transaction. Contains gateway-specific raw response data. Stored as JSONB.
api_key_usada
string
SHA-256 hash (first 64 chars) of the router API key that was used to create this transaction. Used for auditing.
creada_en
string (ISO 8601)
Timestamp when the transaction record was inserted. Defaults to CURRENT_TIMESTAMP.
pagada_en
string (ISO 8601)
Timestamp when the payment was confirmed by the gateway webhook. null until payment is confirmed.
usuario_creado_en
string (ISO 8601)
Timestamp when the MikroTik hotspot user was created. null until the hotspot step completes.
webhook_received_at
string (ISO 8601)
Timestamp when the payment gateway webhook was received by the API server. null if no webhook has been received yet.

Payment States

The estado_pago field on a transaction can hold the following values:
ValueGatewayMeaning
"pending"AllTransaction created, payment not yet confirmed. The customer may still be on the payment page.
"paid"ConektaPayment confirmed by Conekta webhook. Hotspot user has been created.
"approved"Mercado PagoPayment approved by Mercado Pago webhook. Hotspot user has been created.
"rejected"Mercado PagoPayment rejected by Mercado Pago (e.g. insufficient funds, card declined).
The ingresos_totales field in the dashboard aggregates all transaction amounts regardless of state, including "pending" and "rejected" records. For confirmed revenue, multiply transacciones_pagadas by average ticket size, or query the transaction list and filter client-side.

Build docs developers (and LLMs) love