API Reference
Webhooks

Webhooks API

Create Webhook

Create a new webhook endpoint.

POST /v1/webhooks

Request Body

FieldTypeRequiredDescription
urlstringYesWebhook URL
eventsarrayYesArray of event types
secretstringYesWebhook secret
descriptionstringNoWebhook 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/webhooks

Query Parameters

ParameterTypeRequiredDescription
limitintegerNoNumber of items per page (max: 100)
cursorstringNoPagination cursor
statusstringNoFilter 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

ParameterTypeRequiredDescription
webhook_idstringYesWebhook 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

ParameterTypeRequiredDescription
webhook_idstringYesWebhook ID

Request Body

FieldTypeRequiredDescription
urlstringNoNew webhook URL
eventsarrayNoNew event types
secretstringNoNew webhook secret
descriptionstringNoNew 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

ParameterTypeRequiredDescription
webhook_idstringYesWebhook ID

Response

{
  "data": {
    "id": "wh_123456",
    "deleted_at": "2024-03-20T10:00:00Z"
  }
}

Test Webhook

Test a webhook endpoint.

POST /v1/webhooks/{webhook_id}/test

Path Parameters

ParameterTypeRequiredDescription
webhook_idstringYesWebhook ID

Response

{
  "data": {
    "id": "wh_123456",
    "status": "success",
    "response_code": 200,
    "response_time": 150,
    "tested_at": "2024-03-20T10:00:00Z"
  }
}

Webhook Events

EventDescription
payout.createdPayout initiated
payout.completedPayout successful
payout.failedPayout failed
payout.cancelledPayout cancelled
wallet.creditedFunds added to wallet
wallet.debitedFunds withdrawn from wallet
account.verifiedBank account verified
account.failedBank 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

HeaderDescription
X-Webhook-SignatureHMAC-SHA256 signature
X-Webhook-TimestampEvent timestamp
X-Webhook-IdWebhook ID
X-Event-IdEvent ID

Error Codes

CodeDescription
INVALID_URLInvalid webhook URL
INVALID_EVENTSInvalid event types
WEBHOOK_FAILEDWebhook delivery failed
WEBHOOK_NOT_FOUNDWebhook not found

Rate Limits

EndpointLimit
Create webhook10/min
List webhooks100/min
Get webhook100/min
Update webhook10/min
Delete webhook10/min
Test webhook5/min