← Back to Glossary

Webhook

A webhook is an automatic message one system sends to another when a specific event happens. The sender makes an HTTP request, usually a POST, to a URL called an endpoint. The request can contain details about the event, such as the ID of a completed order or the branch that changed in a code repository.

Example of a payment webhook

A customer pays for a course through a hosted checkout. After the payment succeeds, the payment system sends an event to the course app’s endpoint. The course app verifies who sent the notification before enrolling the customer named on the order. This works even if the customer closes the checkout tab before the confirmation page opens. If the payment is pending, the app can wait for confirmation before enrolling them.

The same webhook can arrive more than once if the sender retries delivery. The course app can check the order record before granting access so a second message doesn’t enroll the customer again.

Webhooks and polling

With polling, the receiving app asks for updates at intervals. A webhook lets the sender tell the app when something happens. The app can still make an API request afterward to get the latest order details.

Spiffy can send event notifications for activity such as order and subscription changes. The Spiffy API settings guide shows how to set up a destination and select the events it receives.