Webhook
Last updated
Last updated
When an event occurs on your KKiaPay account you can use the webhooks provided by KKiaPay to keep an eye on their execution. To date, you can use webhooks to notify your backend of the status of a transaction (is the transaction a success or a failure).
In order to configure your webhooks, you will need to follow the steps below once on the form to add a webhook available after clicking on the "Add a webhook" button in the Webhook tab of the API Keys submenu of your dashboard:
Enter the URL on which you want to be notified. You can enter any URL as the destination for events. However, it must be a dedicated page on your server, configured to receive events.
Choose the events for which you want to be notified. You will only be notified of the specified events.
Define a hash secret. It will be used to verify the source of the information you receive.
Once the callback has been created, you can perform a test to verify that KKiaPay is contacting your URL.
It is important to know how to acknowledge receipt of an event after notification from KKiaPay. To do this, you must first use your URL to identify the type of event and return an HTTP 2xx status code. All response codes outside this range, including 3xx codes, tell KKiaPay that you have not received the event.
In case of non-receipt KKiaPay tries 5 times in a row (in an interval of 500ms incremental) to send you the information.
KKiaPay signs webhooks events before sending them to your URLs. Indeed, in the header of each x-kkiapay-secret request (using your hash secret previously entered on your dashboard), a signature is entered. It is used to allow you to verify that the events were sent by KKiaPay and not by a third party.
The skeleton of the request is as follows:
Any x-kkiapay-secret request uses the hash secret provided by your person on the KKiaPay dashboard.
With each event notification we send you a body request in json format below:
In the case of a failed transaction
In the case of a successful transaction