Quick Start
1
Create endpoint handler
Build an HTTP endpoint that accepts POST requests
2
Register in Dashboard
Add your endpoint URL in the Fungies Dashboard
3
Verify signatures
Validate that requests are from Fungies
1. Create Your Endpoint Handler
Your webhook endpoint needs to:- Accept
POSTrequests with a JSON body - Return a
2xxstatus code quickly (before any heavy processing) - Handle the Event object payload
Basic Handler Example
2. Register in the Fungies Dashboard
Once your endpoint is ready (or you’re using a tool like ngrok for local development):- Go to Fungies Dashboard → Developers → Webhooks
- Click Create a webhook
- Configure your webhook:
- Click Save
You can create multiple webhooks for different event types, or use a single endpoint that handles all events.
For subscription products, include
payment_success if your handler fulfills orders. subscription_created alone is not enough — see Subscription checkouts and fulfillment.3. Verify Webhook Signatures
Fungies signs every webhook payload using HMAC-SHA256 with your webhook secret. The signature is included in thex-fngs-signature header:
How to Verify
- Get the raw request body (before any JSON parsing)
- Compute HMAC-SHA256 using your webhook secret
- Compare with the signature in the header
Verification Function
Express Middleware Example
Common Patterns
Idempotent Event Handling
Since webhooks guarantee at-least-once delivery, your handler might receive the same event multiple times. Use the event ID to prevent duplicate processing:Async Processing with Queues
For complex operations, queue events for background processing:Troubleshooting
Next Steps
Test Your Webhooks
Learn how to test webhooks locally before deploying to production