Skip to main content
Webhooks let your application receive real-time notifications when events occur in your Fungies account. Instead of polling the API, Fungies pushes event data directly to your server.

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

  1. An event occurs (e.g., order.paid)
  2. Fungies sends an HTTP POST request to your webhook URL
  3. Your server processes the event and returns a 2xx response
  4. Fungies marks the delivery as successful

Event Payload

Each webhook delivers a JSON payload containing an Event object:
{
  "object": "event",
  "id": "evt_abc123",
  "type": "order.paid",
  "createdAt": 1704067200000,
  "data": {
    "object": "order",
    "id": "ord_xyz789",
    // ... order details
  }
}

Delivery Guarantees

Fungies guarantees at-least-once delivery for all webhook events. Your endpoint should handle potential duplicate events idempotently.
BehaviorDetails
ProtocolHTTPS (required for production)
MethodPOST
Expected response2xx status code
Retry attempts5 times on failure
Timeout30 seconds

Securing Your Webhooks

Every webhook request includes an x-fngs-signature header containing an HMAC-SHA256 signature. Use your webhook secret to verify that requests actually came from Fungies.
x-fngs-signature: sha256_6808ed5be1262b60818359fa586145810d0793e8a677f1326520d3844e21b640
Always verify webhook signatures in production. This prevents attackers from sending fake events to your endpoint.

Next Steps