This is a sample of a webhook that can be used on any system (e.g. gateways) that will notify your application via a POST endpoint.
This sample code used Netlify to host the Express server. Follow the guide here.
Once you have deployed the repository in your Netlify account, the POST endpoint /api/webhook
will now work. You can use any cURL application like Postman to simulate a webhook call
On live applications, webhook endpoints are typically registered on the 3rd party APIs (e.g. payment service providers) to enable these APIs to notify their client's applications.