Introduction
Why use webhooks?
Webhooks are a useful tool when building PaySG integrations, as they allow your e-services to receive events in real-time as they occur in your payment service.
To enable webhook events, you will need to register webhook endpoints. Once registered, PaySG can push real-time event data to your application's webhook endpoint whenever events happen in your PaySG account. PaySG uses HTTPS to send webhook events to your app as a JSON payload that includes an Event object.
Receiving webhook events is particularly useful for listening to asynchronous events. The current version of webhooks supports events for when a payer has paid.
Overview
To begin receiving webhook events in your application, you can create and register a webhook endpoint by following these steps:
Identify the specific events that you want to monitor.
Develop a webhook endpoint function that can receive event data POST requests on your e-service.
Register your endpoint with the PaySG team. For now, this can be done by contacting the team and providing the following fields for them.
webhook_url
the endpoint of your e-service that PaySG should send webhooks to.description
optional field for you to describe the webhook.subscribed_events
list of subscribed events from PaySG that your e-service would like to subscribe to.
Ensure that your webhook endpoint is secure to prevent unauthorized access.
Last updated