Listen for events on your Fanspay account so your integration can automatically trigger reactions.
Fanspay uses webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for asynchronous events like when a blockchain confirms a transaction, a customer disputes a charge, a recurring payment succeeds, or when collecting subscription payments.
How Fanspay uses Webhooks
A webhook enables Fanspay to push real-time notifications to your app. Fanspay uses HTTPS to send these notifications to your app as a JSON payload. You can then use these notifications to execute actions in your backend systems. To learn more, see Fanspay webhook events overview.
Steps to receive webhooks
You can start receiving event notifications in your app using the steps in this section:
- Identify the events you want to monitor and the event payloads to parse.
- Create a webhook endpoint as an HTTP endpoint (URL) on your local server.
- Handle requests from Fanspay by parsing each event object and returning 2xx response status codes.
- Deploy your webhook endpoint so it’s a publicly accessible HTTPS URL.
How to create a webhook endpoint
Creating a webhook endpoint is no different from creating any other page on your website. It’s an HTTP or HTTPS endpoint on your server with a URL. If you’re still developing your endpoint on your local machine, it can be HTTP. After it’s publicly accessible, it must be HTTPS.
Updated about 1 month ago