Documentación·Webhooks
🪝

Webhooks

Recibe eventos de activaciones, alquileres y cartera como callbacks HTTPS con firma HMAC.

Por qué webhooks

El polling es derrochador: el polling sub-segundo está limitado, el polling de varios segundos añade latencia. Los webhooks te empujan los eventos al instante.

Registrar

Account → Webhooks → New endpoint: URL HTTPS, tipos de evento, estrategia de reintento (exponential / linear / none). La clave de firma se muestra una vez.

Eventos

  • activation.sms_received — SMS entrante asociado a una activación
  • activation.expired — ventana cerrada sin código
  • activation.finished — activación confirmada
  • rent.sms_received — SMS entrante en un alquiler
  • wallet.credited / wallet.debited — movimiento de dinero
  • support.message.received — respuesta de agente en hilo de soporte

Payload

{
  "event": "activation.sms_received",
  "delivery_id": "b7e2c1a0-9f3d-4c5e-8a1b-2d3e4f5a6b7c",
  "created_at": "2026-05-26T14:30:14Z",
  "data": { "order_id": "9a1f2c3d-4e5b-6a7c-8d9e-0f1a2b3c4d5e", "phone": "+380635551822", "code": "123456", "service": "telegram" }
}

Verificar firma

Cabecera: X-Eveses-Signature: sha256=<hmac> (timestamp in X-Eveses-Timestamp). HMAC-SHA256 sobre <ts>.<raw-body> con tu secret.

$ts  = $_SERVER['HTTP_X_EVESES_TIMESTAMP'] ?? '';
$sig = $_SERVER['HTTP_X_EVESES_SIGNATURE'] ?? '';
$expected = 'sha256=' . hash_hmac('sha256', $ts . '.' . file_get_contents('php://input'), $secret);
if (!hash_equals($expected, $sig) || abs(time() - (int) $ts) > 300) { http_response_code(401); exit; }

Rechaza peticiones de más de 5 minutos (ventana de replay).

Reintentos

Entregas fallidas (non-2xx o sin respuesta en 10s) se reintentan según la estrategia. Exponential: 30s, 2min, 10min, 1h, 6h, luego dead. Replay manual desde el dashboard.