Webhooks
Receive real-time notifications for events.
Webhooks
Webhooks allow your system to receive real-time updates when events occur on Uverus.
Setting Up
- Navigate to Settings > Webhooks in your dashboard.
- Add your endpoint URL (e.g.,
https://your-api.com/webhook). - Uverus will send a
POSTrequest to this URL whenever an event occurs.
Event Types
| Event | Description |
|---|---|
checkout.completed | Triggered when a customer completes a payment successfully. |
checkout.failed | Triggered when a payment fails. |
merchant.settled | Triggered when funds are credited to your settlement balance. |
Payload Structure
{
"event": "checkout.completed",
"data": {
"reference": "uvr_123456",
"amount": 500000,
"currency": "NGN",
"status": "completed",
"customerEmail": "customer@example.com",
"metadata": {}
}
}Security (HMAC Verification)
Uverus signs every webhook payload with a secret key. You should verify this signature to ensure the request came from us.
The signature is sent in the X-Uverus-Signature header.
const crypto = require('crypto');
const signature = request.headers['x-uverus-signature'];
const hash = crypto
.createHmac('sha256', YOUR_WEBHOOK_SECRET)
.update(JSON.stringify(request.body))
.digest('hex');
if (hash === signature) {
// Request is valid
}