Appearance
Webhooks
NGN collections and payouts complete asynchronously. Treat webhooks as the source of truth and verify each one with the LB-X-Signature HMAC-SHA512 header.
Set up a webhook
- Log in to the Rexel Dashboard.
- Go to Developers > Configuration > Webhooks.
- Click Add Webhook, enter your URL and attach it to Payment Gateway, Accounts and/or Payouts.
HTTPS required
Webhook URLs must be public HTTPS. HTTP and localhost are rejected; use a tunnelling service for local testing.
Delete a webhook
In Developers > Configuration > Webhooks, click the three dots next to the URL and choose Delete Webhook.
Events
| Flow | Event values | Status field |
|---|---|---|
| Payment link (collections) | PaymentSuccessful, PaymentFailed | PaymentStatus |
| Card / bank transfer API (collections) | PaymentSuccessful, PaymentFailed | PaymentStatus |
| NGN payout (disbursement) | Transaction lifecycle events | FundsTransferStatus |
| Payout account | Account lifecycle events | AuthorizationStatus |
Payload
json
{
"status": true,
"event": "payment.completed",
"data": {
"id": "txn_abc123def456",
"reference": "payout_ORDER123_20240115",
"amount": 50000,
"currency": "NGN",
"status": "completed",
"createdAt": "2024-01-15T10:30:00Z",
"completedAt": "2024-01-15T10:35:22Z"
},
"timestamp": "2024-01-15T10:35:22Z"
}Verify the signature
Signature = HMAC_SHA512(<raw request body>, <webhook secret>), as an uppercase hex string, sent in the LB-X-Signature header.
- Read the raw body exactly as received.
- Read
LB-X-Signaturefrom the headers. - Compute HMAC-SHA512 of the body with your secret.
- Compare the two values; reject on mismatch or missing header.
javascript
async function generateHMACSHA512Hash(requestBodyString, secret) {
const enc = new TextEncoder();
const key = await crypto.subtle.importKey(
"raw", enc.encode(secret),
{ name: "HMAC", hash: { name: "SHA-512" } }, false, ["sign"]
);
const sig = await crypto.subtle.sign("HMAC", key, enc.encode(requestBodyString));
return Array.from(new Uint8Array(sig))
.map(b => b.toString(16).padStart(2, "0")).join("").toUpperCase();
}IP allowlist
Rexel sends webhooks only from:
[REXEL EGRESS IPS](published before go-live)
Use the allowlist alongside signature checks, not instead of them.
Best practices
- Return
200 OKright after verifying; process the event asynchronously. - De-duplicate on event
idor transactionreference. - Log unknown event types instead of failing.
- Alert on delivery failures; the Dashboard shows delivery logs and retries.