Webhooks are basically user defined HTTP callbacks which are triggered by specific events.
When to use webhooks
The most common use-case of webhooks is to automate the communication between Cryptlex and other 3rd party apps asynchronously. You might use webhooks to:
Email a license key to your customer after a successful purchase.
Email your customer when the license expires.
Renew subscription licenses when your customer makes the payment.
Get notified through email or chatting apps like slack when any user activates the trial or license.
Any other integration your business needs.
Creating a webhook
You can easily create a webhook through dashboard. Go to the webhooks section in the dashboard and click the add the button. A webhook form with following fields will popup:
Name for the webhook.
The endpoint which will receive the HTTP POST payload.
The secret which will be used to sign the payload using HMAC256 algorithm.
The list of events you want to subscribe.
Whether webhook should be triggered or not, you can use it to disable a webhook.
Each event type has a specific payload format with the relevant event information. Additionally, the signature generated using HMAC256 algorithm is included in "Webhook-Signature" header. A typical payload will have a following structure: