Skip to main content

Webhook Service

The Webhook service handles outbound webhook delivery and external system integrations. It receives events from other tenant services via RabbitMQ and delivers them to configured external endpoints.

Architecture

  Other Tenant Services
│ (RabbitMQ events)

Webhook Backend (Laravel 12)

├──▶ PostgreSQL (webhook schema)
├──▶ Redis (rate limiting, retry scheduling)
├──▶ RabbitMQ (event consumption)
└──▶ External APIs (HTTP delivery)

Key Features

Webhook Management

  • Configure webhook endpoints per event type
  • Custom HTTP headers and authentication
  • Payload transformation and filtering
  • Enable/disable individual webhooks

Reliable Delivery

  • Automatic retry with exponential backoff
  • Configurable retry count and intervals
  • Dead letter queue for permanently failed deliveries
  • Delivery logging and debugging

Security

  • HMAC signature verification (SHA-256)
  • Custom secret per webhook endpoint
  • IP allowlisting (optional)
  • TLS verification enforcement

API Endpoints

Base URL: https://{tenant}.vecton.hu/api/webhooks (production) | http://localhost:8013/api (dev)

MethodEndpointDescription
GET/webhooksList configured webhooks
POST/webhooksCreate webhook endpoint
PUT/webhooks/{id}Update webhook
DELETE/webhooks/{id}Delete webhook
GET/webhooks/{id}/deliveriesDelivery history
POST/webhooks/{id}/testSend test payload
GET/eventsList available event types

Webhook Configuration Example

{
"url": "https://external-system.com/webhook",
"events": ["order.created", "order.status_changed"],
"secret": "your-signing-secret",
"headers": {
"X-Custom-Header": "value"
},
"active": true,
"retry_count": 5
}

Delivery Payload

{
"id": "evt_abc123",
"event": "order.created",
"timestamp": "2026-02-16T12:00:00Z",
"tenant": "tenant-name",
"data": {
"order_id": 12345,
"total": 15000,
"currency": "HUF"
},
"signature": "sha256=abc123..."
}

Supported Events

All events from other tenant services can be forwarded:

SourceEvents
Webshoporder.created, order.status_changed, product.created, product.updated
Warehousestock.received, stock.low, stock.adjusted
CRMcustomer.created, customer.updated, campaign.sent
Analyticsreport.generated

Database Schema

TableDescription
webhooksWebhook endpoint configurations
webhook_eventsEvent type subscriptions per webhook
deliveriesDelivery attempts and results
dead_lettersPermanently failed deliveries

Configuration

VariableDescriptionDefault
APP_URLService base URLhttp://localhost:8013
DB_SCHEMADatabase schemawebhook
WEBHOOK_TIMEOUTHTTP request timeout (seconds)30
WEBHOOK_MAX_RETRIESMaximum retry attempts5

Development

cd tenant/tenant-backend-webhook
composer install
php artisan migrate --seed
php artisan serve --port=8013