Introduction
Last updated
Was this helpful?
Last updated
Was this helpful?
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 happen in your PaySG account. PaySG uses HTTPS to send webhook events to your app as a JSON payload that includes an .
Receiving webhook events is particularly useful for listening to asynchronous events. The current version of webhooks supports events for when a payer has paid.
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. Before contacting us, ensure that your endpoint's hostname resolves to a valid public IP address, as we verify this before activating the webhook.
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 from PaySG that your e-service would like to subscribe to.
Ensure that your webhook endpoint is secure to prevent unauthorized access.