# Webhooks / Callback Url

The webhooks/callback url provide real-time notifications after successfully consuming the API. These events could range from a successful transaction to a failed transaction.

{% hint style="info" %}
The webhook/callback url should be valid for your system to get a response. If your server or webhook is not reachable, we try a maximum of 4 times, every 120 seconds to reach the webhook.
{% endhint %}

Some examples of events that you could be notified of include:

* When you receive a payment transaction.
* When you performed a successful payout transaction.
* When you performed a failed transaction.

Sample webhook response on a successful Mpesa payment:

```json
{
    "Message":"Successful",
    "Success": true,
    "Status": 200,
    "Amount": 100,
    "transaction_code": "QWERTY1234",
    "transaction_reference": "12345678901345644",
    
}
```

Some examples of things you could do with our webhooks include :

* Update your database when the status of a pending payment is successful.
* Notify a customer when payment is successful or unsuccessful etc.

Sample webhook response on failed payment:

```json
{
    "Message":"Request cancelled by user",
    "Success": false,
    "Status": 200,
    "transaction_reference":"12345678901345644"
}
```

For more information on the webhook responses check them out on [Mpesa Payments](https://chpter.gitbook.io/chpter-3.0-public-api-reference/api-reference/payments/m-pesa-payments), [Card Payments](https://chpter.gitbook.io/chpter-3.0-public-api-reference/api-reference/broken-reference), [Mobile Payouts](https://chpter.gitbook.io/chpter-3.0-public-api-reference/api-reference/payouts/mobile-payouts) and [Domestic Bank Payouts](https://chpter.gitbook.io/chpter-3.0-public-api-reference/api-reference/payouts/domestic-banks-payouts).

\\
