Prompt
I'm building a payments integration and need to forward events to multiple downstream systems
Latest observation
Oct 5, 2026
OpenAI APIWeb search: off
A good pattern for this is an event fan-out / webhook router between your payments platform and downstream systems.
Recommended architecture
-
Payments system emits events
- e.g.
payment.succeeded,payment.failed,refund.created - Include a stable
event_id,event_type,created_at, and payload
- e.g.
-
Event router / delivery service receives events
- Validates authenticity
- Normalizes the payload
- Stores the event durably before delivery
-
Route to multiple downstream targets
- Internal services
- Partner webhooks
- Message bus topics/queues
- Analytics / data warehouse
-
Delivery worker pushes events asynchronously
- Retry with exponential backoff
- Dead-letter failed deliveries
- Track per-destination status
Key design considerations
Reliability
- Use at-least-once delivery
- Make downstream consumers idempotent
- Persist events before forwarding
Ordering
- If ordering matters, preserve it per payment or per account
- Don’t assume global ordering across all events
Fan-out strategy
You can either:
- Broadcast all events to all systems, letting consumers filter, or
- Use routing rules so only relevant systems receive each event
Routing rules are usually better for payments because they reduce noise and risk.
Security
- Sign outbound requests
- Support mTLS or HMAC verification
- Encrypt sensitive fields
- Avoid sending raw PCI-sensitive data unless absolutely necessary
Observability
Track:
- Event received count
- Delivery success/failure per destination
- Retry counts
- Lag/latency
- Dead-letter queue size
Common implementation options
Option 1: Webhook dispatcher
Best if downstream systems are external or loosely coupled.
- Each destination has its own endpoint and secret
- Retry failed deliveries
- Send signed payloads
Option 2: Message broker fan-out
Best if downstream systems are internal.
- Publish to Kafka, SNS/SQS, Pub/Sub, RabbitMQ, etc.
- Each consumer subscribes to the topics it needs
Option 3: Hybrid
Common in payments:
- Core event stream goes to broker
- Webhooks are delivered from the same event log
- Analytics pipeline reads from the stream separately
Event schema suggestion
{
"event_id": "evt_123",
"event_type": "payment.succeeded",
"created_at": "2026-10-05T12:34:56Z",
"source": "payments-api",
"account_id": "acct_456",
"object": {
"payment_id": "pay_789",
"amount": 1250,
"currency": "USD",
"status": "succeeded"
}
}
Practical recommendation
If you’re just starting:
- Store events in a durable database table
- Add an async delivery worker
- Support multiple destinations with per-destination configs
- Use HMAC-signed webhooks
- Add idempotency keys and retries
If you want, I can also help you design:
- a database schema for event fan-out,
- a webhook retry model, or
- a Kafka/SQS-based architecture for this.