Webhooks are an essential feature for integrating external services with Fermion. They enable real-time notifications and actions based on specific events that occur within your course platform. This article will guide you through setting up and using webhooks effectively.Documentation Index
Fetch the complete documentation index at: https://docs.fermion.app/llms.txt
Use this file to discover all available pages before exploring further.
When and Why Webhooks are Needed
Webhooks are needed when you want to automate tasks or notifications based on events that happen in your Fermion course. For example, you might want to:- Notify your CRM system when a new user enrolls in a course.
- Update your accounting software when a payment is completed.
- Provide a third-party solution to a user. That’s exclusively available.
Setting Up Your Webhook URL
To start using webhooks, you need to configure a webhook URL where Fermion will send notifications about specific events. Follow these steps:- Navigate to the Webhooks Settings: Go to your Fermion dashboard and find the Webhooks page on the sidebar.
- Enter Your Webhook URL: In the Webhook URL field, enter the URL of your server endpoint that will handle the webhook events.
- Set the Webhook Secret: Ensure the integrity of your webhook events by setting a secret. This secret will be sent in every webhook event in a header named
X-Fermion-Webhook-Secret. Your server must validate all incoming requests and check if this header is present with the correct value.
When and Why Webhooks are Needed
Webhooks are needed when you want to automate tasks or notifications based on events that happen in your Fermion course. For example, you might want to:- Notify your CRM system when a new user enrolls in a course.
- Update your accounting software when a payment is completed.
- Trigger marketing automation workflows based on user actions.
Setting Up Your Webhook URL
To start using webhooks, you need to configure a webhook URL where Fermion will send notifications about specific events. Follow these steps:- Navigate to the Webhooks Settings: Go to your Fermion dashboard and find the Webhooks page on the sidebar.
- Enter Your Webhook URL: In the Webhook URL field, enter the URL of your server endpoint that will handle the webhook events.
- Set the Webhook Secret: Ensure the integrity of your webhook events by setting a secret. This secret will be sent in every webhook event in a header named
X-Fermion-Webhook-Secret. Your server must validate all incoming requests and check if this header is present with the correct value.
Webhook Events
Currently, Fermion supports webhooks for four specific events, you can choose to turn on/off each specific event based on your requirements.- Free Course Enrollment: Triggered when a user enrolls in a free course.
- Paid Course Sale: Triggered when a user purchases a paid course.
- Payment Failed: Triggered when a user’s payment fails for any reason.
- Payment Initiated But Never Completed: Triggered when a user initiates a purchase but does not complete it within 60 minutes.
Webhooks Schema
Here is a sample TypeScript type to understand the data format of the Free Course Enrollment event that will be sent for each webhook. You can click on the “copy” icon to see the schema of each webhook event and configure your endpoint for getting the data from the event.Testing Webhooks
Fermion provides a test button to help you ensure that your webhooks are working correctly. You can use this feature to send test events to your webhook URL and verify that your server is handling them as expected. You can manually trigger a test event by clicking on theflask icon.
