Webhooks API
Create Webhook
Create a new webhook endpoint.
POST /v1/webhooksRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Webhook URL |
events | array | Yes | Array of event types |
secret | string | Yes | Webhook secret |
description | string | No | Webhook description |
Response
{
"data": {
"id": "wh_123456",
"url": "https://your-domain.com/webhook",
"events": ["payout.completed", "payout.failed"],
"status": "active",
"created_at": "2024-03-20T10:00:00Z"
}
}List Webhooks
Retrieve a list of webhooks.
GET /v1/webhooksQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Number of items per page (max: 100) |
cursor | string | No | Pagination cursor |
status | string | No | Filter by status |
Response
{
"data": [
{
"id": "wh_123456",
"url": "https://your-domain.com/webhook",
"events": ["payout.completed", "payout.failed"],
"status": "active",
"created_at": "2024-03-20T10:00:00Z"
}
],
"has_more": false,
"next_cursor": null
}Get Webhook
Retrieve details of a specific webhook.
GET /v1/webhooks/{webhook_id}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook_id | string | Yes | Webhook ID |
Response
{
"data": {
"id": "wh_123456",
"url": "https://your-domain.com/webhook",
"events": ["payout.completed", "payout.failed"],
"status": "active",
"created_at": "2024-03-20T10:00:00Z",
"last_triggered_at": "2024-03-20T10:30:00Z"
}
}Update Webhook
Update a webhook endpoint.
PUT /v1/webhooks/{webhook_id}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook_id | string | Yes | Webhook ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | No | New webhook URL |
events | array | No | New event types |
secret | string | No | New webhook secret |
description | string | No | New description |
Response
{
"data": {
"id": "wh_123456",
"url": "https://your-domain.com/webhook",
"events": ["payout.completed", "payout.failed"],
"status": "active",
"updated_at": "2024-03-20T10:00:00Z"
}
}Delete Webhook
Delete a webhook endpoint.
DELETE /v1/webhooks/{webhook_id}Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook_id | string | Yes | Webhook ID |
Response
{
"data": {
"id": "wh_123456",
"deleted_at": "2024-03-20T10:00:00Z"
}
}Test Webhook
Test a webhook endpoint.
POST /v1/webhooks/{webhook_id}/testPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook_id | string | Yes | Webhook ID |
Response
{
"data": {
"id": "wh_123456",
"status": "success",
"response_code": 200,
"response_time": 150,
"tested_at": "2024-03-20T10:00:00Z"
}
}Webhook Events
| Event | Description |
|---|---|
payout.created | Payout initiated |
payout.completed | Payout successful |
payout.failed | Payout failed |
payout.cancelled | Payout cancelled |
wallet.credited | Funds added to wallet |
wallet.debited | Funds withdrawn from wallet |
account.verified | Bank account verified |
account.failed | Bank account verification failed |
Webhook Payload
{
"id": "evt_123456",
"type": "payout.completed",
"created_at": "2024-03-20T10:00:00Z",
"data": {
"id": "pyt_123456",
"amount": 100000,
"status": "completed"
}
}Webhook Headers
| Header | Description |
|---|---|
X-Webhook-Signature | HMAC-SHA256 signature |
X-Webhook-Timestamp | Event timestamp |
X-Webhook-Id | Webhook ID |
X-Event-Id | Event ID |
Error Codes
| Code | Description |
|---|---|
INVALID_URL | Invalid webhook URL |
INVALID_EVENTS | Invalid event types |
WEBHOOK_FAILED | Webhook delivery failed |
WEBHOOK_NOT_FOUND | Webhook not found |
Rate Limits
| Endpoint | Limit |
|---|---|
| Create webhook | 10/min |
| List webhooks | 100/min |
| Get webhook | 100/min |
| Update webhook | 10/min |
| Delete webhook | 10/min |
| Test webhook | 5/min |