Why Use Webhooks?
Webhooks are essential for building reactive integrations:- Fulfill orders automatically - Deliver digital products when a payment succeeds
- Sync with your database - Keep your user records up-to-date with subscription changes
- Trigger workflows - Send confirmation emails, update inventory, or notify your team
- Handle async events - Respond to events that happen outside of direct API calls
How It Works
- An event occurs (e.g.,
order.paid) - Fungies sends an HTTP POST request to your webhook URL
- Your server processes the event and returns a
2xxresponse - Fungies marks the delivery as successful
Event Payload
Each webhook delivers a JSON payload containing an Event object:Delivery Guarantees
Fungies guarantees at-least-once delivery for all webhook events. Your endpoint should handle potential duplicate events idempotently.
| Behavior | Details |
|---|---|
| Protocol | HTTPS (required for production) |
| Method | POST |
| Expected response | 2xx status code |
| Retry attempts | 5 times on failure |
| Timeout | 30 seconds |
Securing Your Webhooks
Every webhook request includes anx-fngs-signature header containing an HMAC-SHA256 signature. Use your webhook secret to verify that requests actually came from Fungies.
Next Steps
Set Up Webhooks
Create your webhook endpoint and register it with Fungies
Test Webhooks
Test your integration locally with ngrok or webhook.site