# Webhooks

## Introduction&#x20;

Webhooks are a way for Sonic Payment Gateway to notify your server about events that happen within your account. These events include things like new transactions, successful payouts, and more. With webhooks, you can receive real-time notifications of these events and take action accordingly.

## Sample webhook payloads for deposit transactions&#x20;

When a new transaction is created, Sonic Payment Gateway will send a POST request to the webhook URL specified in your account settings. The request will contain a JSON payload with information about the transaction. A sample payload for a deposit transaction might look like this:

```
{
    "id": "tr_1234567890",
    "type": "deposit",
    "status": "success",
    "amount": 1000,
    "currency": "USDT",
    "created_at": "2022-01-01T12:00:00Z",
    "metadata": {
        "customer_id": "cus_1234567890"
    }
}

```

## Sample webhook for bank payout&#x20;

When a bank payout is created, Sonic Payment Gateway will send a POST request to the webhook URL specified in your account settings. The request will contain a JSON payload with information about the bank payout. A sample payload for a bank payout might look like this:

```
{
    "id": "po_1234567890",
    "type": "bank_payout",
    "status": "success",
    "amount": 1000,
    "currency": "USD",
    "recipient_name": "John Doe",
    "recipient_bank_name": "Acme Bank",
    "recipient_account_number": "1234567890",
    "created_at": "2022-01-01T12:00:00Z",
    "metadata": {
        "customer_id": "cus_1234567890"
    }
}

```

Note: It is important to ensure that the webhook URL is a secure endpoint and that it properly handles the payload sent by Sonic Payment Gateway. You can also configure the webhooks to use a secret key to sign the payloads so that you can verify that they were sent by Sonic Payment Gateway.
