Register a webhook
Registering a webhook via API call involves configuring a client application to receive notifications and updates from GrailPay. To enable notification related to transaction, you need to register webhook with sets of predefined Events.
Once registered, the webhook will be triggered by the GrailPay whenever a relevant event occurs, such as a transaction started, completed or failed. The webhook will then send a notification to the configured endpoint, which can be processed by the client application to perform additional actions or update relevant data.
Endpoint
/3p/api/v1/webhook
Request Payload
{
"webhook_url": [
"https://example.com/webhook/transaction"
],
"event_names": [
"TransactionCompleted",
"TransactionFailed"
]
}
Fields | Type | Is Required | Description |
---|---|---|---|
webhook_url | string array | Yes | HTTPS url with support to receive post requests |
event_names | string array | Yes | Possible Values: TransactionStarted TransactionCaptureStarted TransactionCompleted TransactionFailed TransactionCanceled PayoutOnHold PayoutCompleted ClawbackStarted ClawbackFailed ClawbackCompleted BankLinkedSuccessfully BankLinkFailed BusinessCreated BusinessUpdated BatchPayout (only by processor token) RefundPending RefundCaptureStarted RefundCaptureCompleted RefundCaptureFailed RefundPayoutPending RefundPayoutCompleted RefundPayoutFailed BatchRefund |
Response Object
{
"status": true,
"message": "Webhook registered successfully!",
"data": null,
"errors": []
}
Errors & Warnings
Code | Message |
---|---|
401 | |
422 |
Updated 3 months ago