Overview
Webhooks are essential for:- Real-time payment confirmations
- Automatic order fulfillment
- Subscription management
- Transfer status updates
- Dispute notifications
The SDK handles signature verification, payload parsing, and type-safe event handling automatically.
Setup Webhook Handler
Register event handlers for the events you want to process.1
Initialize the SDK
2
Register event handlers
3
Create webhook endpoint
Set up an endpoint to receive webhook requests from Paystack.
Framework Integration
Express.js
Next.js (App Router)
Hono (Bun/Cloudflare Workers)
Available Events
The SDK provides type-safe handlers for all Paystack webhook events:Transaction Events
Transfer Events
Virtual Account Events
Subscription Events
Refund Events
Security
The SDK automatically verifies webhook signatures using HMAC SHA-512.How It Works
- Paystack signs each webhook with your secret key
- The SDK verifies the signature before processing
- Invalid signatures are rejected automatically
Best Practices
Common Patterns
Asynchronous Processing
Idempotent Webhook Handling
Error Handling with Retries
Complete Order Fulfillment
Testing Webhooks
Test your webhook handlers locally:Troubleshooting
Webhook Not Received
- Check your webhook URL in Paystack Dashboard
- Ensure your server is publicly accessible
- Verify your server returns 200 OK
- Check firewall settings
Signature Verification Failed
- Use the raw request body (not parsed JSON)
- Verify you’re using the correct secret key
- Check for middleware that modifies the body
- Ensure the signature header is being read correctly
Duplicate Webhooks
- Implement idempotency checks
- Use unique references to track processed webhooks
- Return 200 OK even for duplicates
Related Resources
- Transactions Guide - Process payments
- Transfers Guide - Handle transfer events
- Virtual Accounts Guide - Manage virtual account events
- Webhook API Reference - Full event documentation

