A webhook is a way for an app to provide other applications with real-time information. It delivers data to other applications when triggered, meaning you get data immediately, unlike typical API calls where you would need to poll for data very frequently to get it in real-time.
In this article, we will go through the LearnWorlds available webhooks and demonstrate their usage through various use cases.
If you want more information on how to use Webhooks with Zapier, check this article.
Available Webhooks
- When a user is registered/updated
- When products are bought
- When a free course enrollment occurs
- When an email lead is captured
- When a certificate is awarded
- When a course is completed
- When a subscription/installment is paid
- When a subscription/installment is canceled
- When a subscription trial is started
- When a subscription trial ends in three days
- When a free section is previewed
- When a subscription is updated
- When a user unenrolls from product
- When tags added to a user
- When tags removed from a user
- When a payment is created
- The legacy webhooks will remain intact, so no existing setup is expected to break. We suggest you utilize the updated version of them. In the already activated checkboxes, you will notice a dropdown menu in both the legacy and the new version of the webhooks will be available. Once you're ready to move, select the new version and save your choice.
- When you migrate to the "New Version," it's essential to set up the webhook again, as the "payload" (the data sent to the webhook) will be different.
Important Cases
→ The When a subscription/installment is paid Webhook is activated:
a. When a user purchases a subscription.
b. When the admin Manually Adds Users to a Subscription Plan through Stripe without payment
c. When the admin Manually Enrolls a User in a Subscription Plan in LearnWorlds without payment.
→ When a user is Manually Enrolled into the Subscription (bypassing the payment) again the following Webhooks are triggered:
a. When a subscription/installment is paid
b. When a payment is created
→ When a subscription without trial days is purchased, the below Webhooks will fire:
a. When a subscription/installment is paid
b. When a payment is created
→ When a subscription with trial days is purchased, the below Webhook will fire:
a. When a subscription trial is started
→ When an actual payment is done after the trial days again the below Webhooks will fire:
a. When a subscription/installment is paid
b. When a payment is created
→ The When a subscription/installment is canceled Webhook fires:
When a subscription expires not when the user does the actual cancel action.
When the user actually cancels this action triggers the Schedule for the cancellation event. The webhook fires when the Cancellation is actually canceled, that is on the next renewal or expiration date.
→ The When a subscription is updated Webhook is triggered:
When the learner changes the subscription plan or when the Admin Updates a subscription via Stripe (Edit a subscription by removing the existing subscription and adding a new one) meaning "downgrading-upgrading" & subscribing from one subscription to another subscription.
Webhook Signatures
With each incoming webhook from Learnworlds, a pre-shared Learnworlds-Webhook-Signature header is included.
All the webhooks are signed with the following unique signature, so you can optionally verify their integrity. You can find out more in this documentation guide.
You can find the webhook signature in your LearnWorlds school under Settings → Developers → Webhooks.
- The When a user is registered/updated applies to manual updates/registrations and to SSO registrations too (When manually enrolled by the admin & when the learner is registered from the sign-up form, When the user profile is updated by the learner & updated by the admin).
- The When a free section is previewed webhook, refers to the free sections within Paid courses, not Free courses.
- The When a free section is previewed webhook, is not triggered for the enrolled users. It's clear that a user who is already enrolled in a course would not require access to a free section preview, as they already have full access to the course. Therefore, the concept of previewing does not apply in this scenario.
- If a webhook does not receive a successful response, we retry 20 times, each time double the time between retries, i.e., 1 minute, 2 minutes, 4 minutes, etc.