Webhooks
Understand ClickPesa Webhooks (Callbacks) and how to integrate them in your application
Webhooks are HTTP POST
callbacks that deliver notification messages for events.
ClickPesa uses webhooks to inform your systems when transactional events occur. This way, your servers are always up to date with transaction information.
Webhook Events
PAYOUT INITIATED
-
Description - This event is triggered when a payout process is initiated. The webhook will provide details such as the payout amount, recipient information, and the initial status of the payout.
-
Sample Payload Data
PAYOUT REFUNDED
-
Description - This event occurs when a payout is refunded, due to an issue with the payout process. The webhook will include the refund details and the original payout information.
-
Sample Payload Data
PAYOUT REVERSED
-
Description: This event is triggered when a payout is reversed, typically due to an error or a dispute. The webhook will contain details about the reversal, the original payout, and any related information.
-
Sample Payload Data
PAYMENT RECEIVED
When a payment is received successfully, this event is triggered. This event provides you with key information about the payment, including identifiers, amounts, and customer details.
-
Description - This event is triggered whenever a customer makes a successful payment. The webhook will send details of the transaction, including the amount, payer information, and transaction status.
-
Sample Payload Data
PAYMENT FAILED
-
Description - This event is triggered when a payment attempt fails. The webhook will include information about the failure reason, the attempted transaction, and any relevant error codes.
-
Sample Payload Data
Setting Up Webhooks
1. Access Webhooks Settings
- Log in to your ClickPesa Dashboard.
- Navigate to Settings -> Developers.
- Locate the Webhooks Settings section.
2. Add a Webhook URL
- Select event types to subscribe to, such as
PAYOUT INITIATED
,PAYOUT REVERSED
,PAYOUT REFUNDED
,PAYMENT RECEIVED
, orPAYMENT FAILED
and set the webhook URL.
3. Receiveing Webhook Calls
- The gateway sends HTTP POST requests to the provided URL upon an event.
- Your system should respond with a 2xx HTTP status code to acknowledge receipt.
Extra data in the response is ignored.