Developers tabs

Webhooks Tab

Add the endpoints Fungies calls when something happens in your store, and follow every call.

A webhook endpoint is an address on your server that Fungies calls as soon as something happens: an order is paid, a subscription renews, a dispute opens. Open Developers → Webhooks.

Use this tab when your server needs to react to events without asking the API over and over: to deliver what was bought, end access, or keep your own records in step.

The list

Each row shows the Address, the Events it is subscribed to (three, then "+N more"), its Mode, its Status (On or Off) and its Last call: Delivered, a count of calls failed in a row, or Nothing sent yet. Search by address, id, format or event, or use Filters to narrow by status or by one event. The count line says how many endpoints the workspace has across live and test together.

Click a row to open the endpoint's page. The row's ⋯ menu offers History, Edit, Send a test, Turn off or Turn on, New secret and Copy endpoint ID.

An endpoint marked "Read-only here" was set up outside this dashboard and cannot be changed here.

Add an endpoint

  1. Check the mode: an endpoint added in test mode receives test events only.
  2. Click Add endpoint and fill in Address we call (an https address, port 443), Format (keep Current) and What it hears about (at least one event).
  3. Click Add endpoint, then copy the signing secret from Copy your signing secret now and click I have saved it. It is shown this once.

Set up webhooks walks through each field and has the handler code.

Check the signing secret

Every call carries an Fngs-Signature header: a signature of the time and the raw body, made with the endpoint's signing secret. Your server makes the same signature and refuses a call whose signature does not match. The dashboard never shows the signature of a call it sent; it says "Hidden here. Check it with your signing secret." The code is in Check the signature.

To change the secret, click New secret → Create a new secret. The new secret is shown once, and the old one keeps working for a day, so you have time to swap it on your server.

Retries

Your endpoint must answer 2xx within 10 seconds. Any other answer, a timeout or a network error is tried again, 12 tries in all over at least three days; see Delivery and retries. The endpoint's page shows each call as Waiting, Sending, Delivered or Gave up. Send again sends a call that was delivered or gave up one more time, with the same event id.

The endpoint's page

The page shows the address, status, mode, the events it is subscribed to, its format, and when it was created and last changed. Send a test is its main button; the other actions are under More, with Delete endpoint last: type the address to confirm, there is no undo.

Under it, Recent calls lists the newest calls. Click one to read it beside the list: the payload with Copy payload, and for each try the Request we sent and the Endpoint response (status code, why it failed, the first 8,192 characters of the body). Show older calls pages further back.

Example: get told when an order is paid

  1. In test mode, click Add endpoint. Enter https://example.com/webhooks/fungies, keep Current, tick order.paid under Orders, and click Add endpoint.
  2. Copy the whsec_… secret into your server's secret store and click I have saved it.
  3. Open the endpoint, click Send a test, pick order.paid and click Send it: "Test event sent."
  4. Start your server if it is down: the call shows Waiting with a next try scheduled, and the next try is Delivered. If it shows Gave up, click Send again.

Next steps

Last updated