Documentation

Register a Webhook

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.

📘

Authentication Route

This route is secured with processor token authentication.


Endpoint

   /processor/api/v1/webhook

 

Request Payload

{
    "webhook_url": [
      "https://example.com/webhook/transaction"
    ],
    "event_names": [
      "TransactionCompleted",
      "TransactionFailed"
    ]
}
FieldsTypeIs RequiredDescription
webhook_urlstring arrayYesHTTPS url with support to receive post requests
event_namesstring arrayYesPossible Values:
BatchPayout
TransactionStarted
TransactionCaptureStarted
TransactionCompleted
TransactionFailed
TransactionCanceled
PayoutOnHold
PayoutCompleted
ClawbackStarted
ClawbackFailed
ClawbackCompleted
BankLinkedSuccessfully
BankLinkFailed
BusinessCreated
BusinessUpdated
BatchPayout
RefundPending
RefundCaptureStarted
RefundCaptureCompleted
RefundCaptureFailed
RefundPayoutPending
RefundPayoutCompleted
RefundPayoutFailed
BatchRefund

Response Object

{
    "status": true,
    "message": "Webhook registered successfully!",
    "data": null,
    "errors": []
}

Errors & Warnings

CodeMessage
401Unauthorized
422Unprocessable Content