Webhooks
Receive events at your endpoint instead of polling. Every delivery is signed, retried if it fails, and logged.
Add an endpoint
In the dashboard under Developers → Webhooks, or with POST /v1/webhook_endpoints. Choose the events, or * for all. The response contains the endpoint's signing secret, shown once. Endpoint URLs must resolve to public addresses.
Events
| Event | When |
|---|---|
mandate.created, mandate.revoked | A mandate is created or revoked. |
check.created | A check is made, with its decision. |
approval.requested, approval.approved, approval.declined | The user is asked, and answers. |
check.outcome_reported | A payment is reported, redeemed, failed or released. |
check.fulfilment_reported | The merchant, provider or you reported what happened to the order. |
payment.matched, payment.over_amount, payment.unchecked | A reported debit is reconciled. |
dispute.opened, dispute.evidence_added, dispute.resolved, dispute.appealed, dispute.closed, dispute.withdrawn, dispute.remedy_updated, dispute.suggestion_updated, dispute.assigned, dispute.party_invited, dispute.party_responded | The dispute lifecycle. dispute.suggestion_updated follows a fulfilment report that changed the suggested finding. |
agent.key_added, agent.key_revoked | An agent's signing key changes. |
end_user.erased | One end user's personal data was erased. |
usage.threshold_reached | Live mode only. This month's free checks are used up (kind: free_tier_used), or the estimate reached 80% or 100% of your budget (budget_80, budget_100). Once each per month. |
invoice.issued, credit_note.issued | Live mode only. A tax invoice or credit note was issued, with its number and amounts in paise. |
Each event has an id, type, livemode, object_id, data and created_at. The same events are in the audit log.
Verify the signature
Each request carries a Wavly-Signature header: t=<unix seconds>,v1=<hex>, where v1 is the HMAC-SHA256 of t + "." + raw body with your endpoint's secret. Reject anything that does not match, or is older than five minutes. The SDKs do it for you:
import { Wavly } from "@thewavly/sdk";
app.post("/webhooks/wavly", express.raw({ type: "application/json" }), async (req, res) => {
const event = await Wavly.verifyWebhook(req.body.toString(), req.get("Wavly-Signature"), process.env.WAVLY_WEBHOOK_SECRET);
if (event.type === "approval.approved") resumeOrder(event.data);
res.sendStatus(200);
});from thewavly import Wavly
event = Wavly.verify_webhook(raw_body, headers["Wavly-Signature"], os.environ["WAVLY_WEBHOOK_SECRET"])event, err := wavly.VerifyWebhook(rawBody, r.Header.Get("Wavly-Signature"), secret, 0)Important: Verify against the raw request body, before any JSON parsing, or the signature will not match.
Retries
Answer with any 2xx within a few seconds. A delivery that fails is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours, then marked failed. You can retry any delivery from the dashboard. Delivery logs are kept for 90 days. Deliveries may arrive more than once or out of order: use the event id to skip duplicates.