Webhooks

Webhooks Overview

Get a call on your own server the moment something happens in your Fungies workspace.

A webhook is an address on your server that Fungies calls when something happens: an order is paid, a subscription renews, a dispute opens. You add the address in the dashboard, pick the events it should hear about, and Fungies sends each one as a signed POST with a JSON body.

Use webhooks to deliver what was bought, keep your own records in step, or start your own workflows, without asking the API over and over whether anything changed.

How it works

  1. Something happens in your workspace, for example order.paid.
  2. Fungies sends a POST to every endpoint that picked that event.
  3. Your server checks the signature and answers with any 2xx status.
  4. Anything else counts as a failed try, and Fungies tries again later.

Live and test

Endpoints belong to a mode. An endpoint you add while the dashboard is in test mode hears only about test events, and a live endpoint only about live ones. Each event says which it is in liveMode.

What we send

Every call carries one event:

{
  "id": "evt_01JC8Y7N3Q4R5S6T7V8W9X0YZA",
  "type": "order.paid",
  "apiVersion": "2026-09-08",
  "occurredAt": "2026-11-05T14:03:11.000Z",
  "workspaceId": "...",
  "liveMode": true,
  "sequence": 4,
  "aggregate": { "type": "order", "id": "...", "version": 4 },
  "traceparent": "00-...-01",
  "data": {
    // the order, as it is after this event
  }
}
FieldWhat it is
idThe event's id, evt_ and 26 characters. A retry of the same event keeps it, so use it to skip events you have already handled.
typeThe event name, see Events.
apiVersionThe format the endpoint was added with. It never changes for that endpoint.
occurredAtWhen the change happened, not when we sent it.
liveModetrue for live, false for test.
aggregateWhat the event is about: its kind (order, subscription, ...) and id.
sequenceA counter per aggregate. A higher number is a later change to the same thing.
dataThe full object the event is about.
previousOnly on subscription.updated, dispute.updated and workspace.capabilities_updated: the fields that changed, with their old values.

Events can arrive out of order: a retry of an older event may land after a newer one. Before you act on an event, compare its sequence with the last one you stored for the same aggregate.id, and ignore it when it is not higher.

Events

You pick events by group when you add an endpoint. These are sent today:

GroupEvents
Ordersorder.paid, order.payment_failed, order.authentication_requested, order.refunded, order.partially_refunded, order.refund_failed, order.cancelled
Checkoutcheckout.completed, checkout.expired
Disputesdispute.created, dispute.evidence_submitted, dispute.updated, dispute.funds_withdrawn, dispute.funds_reinstated, dispute.closed
Subscriptionssubscription.created, subscription.renewed, subscription.updated, subscription.cancelled, subscription.payment_method_updated
Payoutspayout.paid, payout.failed
Customerscustomer.created
Activationactivation.approved, activation.rejected, activation.info_requested
Workspaceworkspace.capabilities_updated, workspace.payments_disabled, workspace.payments_recovered, workspace.checkout_paused, workspace.checkout_resumed, workspace.subscription_collection_paused, workspace.subscription_collection_resumed, workspace.purge_scheduled, workspace.banned, workspace.archived
Endpointswebhook_endpoint.enabled, webhook_endpoint.disabled, webhook_endpoint.pinged, webhook_endpoint.failing, webhook_endpoint.blocked, webhook_endpoint.recovered

The picker also lists events tagged Not sent yet. You can pick them now; they start arriving once they are turned on.

A few rules worth knowing:

  • A renewal that succeeds after a failed one arrives as subscription.renewed. There is no separate "payment recovered" event.
  • When the ability to take payments changes, you get workspace.payments_disabled or workspace.payments_recovered instead of workspace.capabilities_updated.
  • webhook_endpoint.disabled (when we turn an endpoint off), failing, blocked and recovered go to your other endpoints, never to the one they are about.

Delivery and retries

Delivery is at least once. The same event can reach you more than once, so handle each id only once.

MethodPOST, Content-Type: application/json
SuccessAny 2xx status
Time to answer10 seconds. Answer first, then do the slow work.
RedirectsA 307 or 308 is followed up to 3 times, only to https and only within the same domain. Any other 3xx counts as a failure.
RetriesEvery other answer, a timeout or a network error is tried again: 12 tries in all, the gaps doubling from 30 seconds, then about 22 hours apart. Retries keep going for at least three days.
An address that does not resolveIf your endpoint's host name does not resolve in DNS, we stop after about a day (9 tries) instead of three days. Sending the call again starts a new day.
After the last tryThe call shows as Gave up in the endpoint's history, where you can send it again.

Each call also carries these headers:

HeaderValue
Fngs-SignatureThe signature, see Verify the signature
Fngs-Event-IdThe event's id
Fngs-Webhook-IdThe endpoint's id, whe_ and 26 characters
Fngs-Api-VersionThe endpoint's format
Fngs-Delivery-AttemptWhich try this is
User-AgentFungies-Webhooks/2

When an endpoint keeps failing

We count events that end in Gave up in a row. At 3, your other endpoints get webhook_endpoint.failing. At 10, we turn the endpoint off and your other endpoints get webhook_endpoint.disabled. One delivered call resets the count.

An endpoint that is off receives nothing, and events that happen while it is off are not sent later. Turn it back on from the endpoint's menu once it is fixed.

Old format endpoints

When you add an endpoint you can pick Old format (v1) instead of the current one. It sends the API v0 event payload and the x-fngs-signature header. Pick it only if your code already reads that format: see Webhook signatures (v0) and Webhook delivery (v0).

Next steps

Last updated