> ## Documentation Index
> Fetch the complete documentation index at: https://devdraft.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Listen for real-time events.

Receive HTTP POST requests when events occur in your account.

## Event Types

| Category     | Events                                  | Description                  |
| ------------ | --------------------------------------- | ---------------------------- |
| **Payment**  | `payment.completed`, `payment.failed`   | Transaction updates          |
| **Transfer** | `transfer.completed`, `transfer.failed` | Cross-chain/fiat status      |
| **Wallet**   | `wallet.deposit_received`               | Incoming funds               |
| **KYC**      | `customer.verified`                     | Identity verification status |

## Payload Structure

```json theme={null}
{
  "id": "evt_123",
  "type": "payment.completed",
  "created": "2024-03-20T15:30:00Z",
  "data": {
    "object": {
      "id": "pay_abc",
      "status": "completed",
      "amount": 100.00
    }
  }
}
```

## Security

Verify the `x-webhook-signature` header using your signing secret.

```javascript theme={null}
const crypto = require('crypto');

const signature = req.headers['x-webhook-signature'];
const expected = crypto
  .createHmac('sha256', process.env.WEBHOOK_SECRET)
  .update(req.rawBody)
  .digest('hex');

if (signature !== expected) throw new Error('Invalid signature');
```

## Retry Policy

* **Retries**: Automatic exponential backoff.
* **Timeout**: 10 seconds.
* **Failures**: Events are marked failed after 5 attempts.
