Websites11 min read

Securing Paystack webhooks in Nigeria: signature verification and idempotency (2026)

Mohamed Bah·Fondateur, Kolonell
August 25, 2026
Share:
Securing Paystack webhooks in Nigeria: signature verification and idempotency (2026)

Securing Paystack webhooks in Nigeria: signature verification and idempotency (2026)

Websites

The verdict in three sentences

A badly secured payment webhook is the leading technical cause of disputes: about 30 % of "I paid but the order isn't confirmed" complaints trace back to it. Four guardrails are enough: HMAC signature verification, idempotency key, exponential retry and logging. Without idempotency, 1 payment in 200 is processed twice, and each manual fix costs roughly NGN 2,600 in labour.

The four technical guardrails

A webhook is an inbound call from the payment provider to your server. Since anyone can try to hit that URL, it must be hardened.

GuardrailRoleRecommended setting
HMAC signatureProves the call comes from the providerReject if signature invalid
Idempotency keyStops processing the same payment twiceKey = transaction reference
Replay windowBlocks attacker-replayed calls5 minutes max
Exponential retryRecovers missed webhooks3 attempts over 24 h
TimeoutAvoids blocking the provider10 s response max
LoggingTrace for disputes and auditKeep 90 days

The HMAC signature is non-negotiable: without it, a third party could fake a successful payment and trigger a shipment without paying.

The real cost of an unsecured webhook

A fragile webhook costs more than bugs: it costs time, customer trust and lost money. Here is the impact on an average store.

ProblemFrequency without guardrailUnit costMonthly impact (500 orders)
Double-processed payment1 in 200NGN 2,600~NGN 6,500
Paid order not confirmed1 in 100lost sale~5 lost sales
Customer dispute to handle30 % of disputesNGN 2,600variable
Shipment without paymentrare but severeproduct valuehigh risk
Manual reconciliationdaily1 h/day~30 h/month

The heaviest line is often manual reconciliation time: up to 30 hours a month that a reliable webhook makes unnecessary.

Idempotency: the detail that kills duplicates

When a provider does not receive your response in time, it resends the webhook. Without an idempotency key, your server re-processes the payment: second confirmation, sometimes second shipment. By storing the transaction reference as a unique key, any repeated call is detected and safely ignored. It is the single line of code that prevents 90 % of duplicates.

Mini case study

Need a professional website?

Kolonell builds websites that attract clients, optimized for the Sénégalese market. Free quote in 2 minutes.

Ibrahim, a developer for a Lagos store, handles 500 orders/month. Before hardening, he saw ~2.5 duplicates/month (1 in 200) at NGN 2,600 each to fix, plus ~1 h/day of manual reconciliation, i.e. 30 h/month. After adding HMAC + idempotency + retry, duplicates fall to zero and reconciliation drops to ~2 h/month thanks to logging. Savings: NGN 6,500 in fixes and 28 hours recovered every month.

FAQ

Is HMAC signature really mandatory?

Yes. It is the only way to prove a call truly comes from Paystack or your provider. Without it, an attacker can fake a successful payment, risking an unpaid shipment.

How many retry attempts should I plan?

A classic scheme is 3 attempts over 24 h with increasing delays (e.g. 1 min, 15 min, 2 h). This recovers temporary network failures without hammering your server.

Why a 5-minute replay window?

It limits replay attacks: a webhook intercepted and resent later is refused if it exceeds 5 minutes. Beyond that, the call is treated as suspicious.

What if a webhook never arrives?

Add an active check: query the payment status API after 10 seconds, then via a retry queue. The webhook must never be the only source of truth.

How long should I keep logs?

At least 90 days. That is the useful window to arbitrate a customer dispute or reconstruct a contested payment.

Let's talk about your project. We secure your Paystack webhooks with signature, idempotency and retry tested in real conditions. WhatsApp +221 77 596 93 33.

Tags:#webhook#paystack#wave#payment security#hmac#idempotency#development#africa
Share:

Mohamed Bah

Fondateur, Kolonell

Passionate about digital and entrepreneurship in Africa, Mohamed has been helping Sénégalese businesses with their digital transformation since 2020. Founder of Kolonell, he believes every SME deserves a professional and accessible online présence.