What is a webhook?
A webhook is an HTTP callback one system sends to another when an event happens, such as a payment, signup, invoice, refund, or subscription change.
A webhook is an event notification sent from one system to another over HTTP. In SaaS analytics, webhooks are often how payment providers send reliable revenue, subscription, refund, and churn events to your backend.
- Understand what webhooks are
- Compare webhooks with polling
- Know common SaaS webhook use cases
- Use webhooks safely for revenue events
A webhook is an HTTP callback sent by one system to another when an event happens.
Instead of your app repeatedly asking "did anything change?", the other system sends a request when there is something to report.
For example, a payment provider can send a webhook when a customer pays an invoice, starts a subscription, receives a refund, or cancels.
Webhook example
A webhook flow looks like this:
event happens -> provider sends HTTP request -> your backend processes the event
The request usually contains event data in JSON. Your backend verifies the request, records the event, and returns a successful response.
Webhooks vs polling
Polling means your app asks another API for updates on a schedule.
Webhooks are event-driven. They are usually better when you need to react quickly to changes, such as payments, signups, failed invoices, support events, or deployment notifications.
Polling can still be useful for reconciliation, but webhooks are usually the primary path for payment lifecycle events.
Common webhook use cases
SaaS teams use webhooks for:
- Payment completed.
- Invoice paid.
- Subscription updated.
- Subscription cancelled.
- Refund created.
- Trial started.
- User invited.
- Form submitted.
- Lead created.
- Deployment finished.
For revenue analytics, payment webhooks are especially important because they provide a backend source of truth.
Webhook safety basics
Webhook endpoints should:
- Verify signatures from the provider.
- Process events idempotently.
- Store the provider event ID.
- Return success only after safe processing.
- Retry internal work when downstream systems fail.
- Avoid trusting browser-only payment events as revenue.
Idempotency matters because providers can retry the same webhook. Your system should not create duplicate revenue if the same event arrives twice.
Webhooks and attribution
Webhooks tell you that a payment happened. They do not automatically tell you which campaign, page, or source created the customer.
For attribution, your checkout flow needs to pass a visitor or session identifier into the payment system before the webhook arrives. Then the webhook processor can connect payment data back to analytics context.
Read what a Stripe webhook is for a payment-specific example, then use Stripe webhook revenue events when you are ready to map events into reports.
FAQ
What is a webhook in simple terms?
A webhook is an automated message one app sends to another app when something happens.
How is a webhook different from an API request?
An API request is usually made when your app asks for data. A webhook is sent when another system notifies your app that an event happened.
Are webhooks reliable?
Good webhook providers retry failed deliveries, but your endpoint still needs signature verification, idempotency, and error handling.
Why do payment providers use webhooks?
Payment state changes after checkout. Webhooks let your backend receive completed payments, renewals, refunds, cancellations, and failed payment events without relying on the browser.
Connect payments to the dashboard
Install the tracker, pass attribution into checkout, and report revenue by source, campaign, landing page, and path.