Przejdź do głównej zawartości

Manage Webhooks

GET
/user/webhooks

Retrieves all webhook configurations for the account. Webhooks allow you to receive real-time notifications about events such as payment confirmations, withdrawal status changes, and security events.

Example Request

GET /user/webhooks
X-API-Key: your_api_key_here

Response Parameters

ParameterTypeDescription
webhooksarrayList of webhook configurations
countnumberTotal number of webhook configurations

Webhook Object

ParameterTypeDescription
idstringUnique identifier for the webhook
urlstringThe URL where webhook notifications are sent
event_typesarrayArray of event types this webhook will receive
statusstring"active" or "inactive"
created_atstringISO 8601 timestamp of when the webhook was created
last_triggered_atstringISO 8601 timestamp of when the webhook was last triggered
failure_countnumberNumber of consecutive failed delivery attempts
secretstringPartially redacted secret key used for webhook signature verification

Example Response

{
"webhooks": [
{
"id": "wh_550e8400e29b41d4a716446655440000",
"url": "https://example.com/crypto/webhook",
"event_types": [
"payment.completed",
"payment.failed",
"withdrawal.status_changed"
],
"status": "active",
"created_at": "2025-03-15T12:30:45.123Z",
"last_triggered_at": "2025-04-30T14:22:33.456Z",
"failure_count": 0,
"secret": "whsk_6E****************************hT"
},
{
"id": "wh_98765432abcdef0123456789abcdef01",
"url": "https://backup.example.com/webhooks",
"event_types": [
"payment.all",
"withdrawal.all",
"security.all"
],
"status": "inactive",
"created_at": "2025-04-01T09:15:30.789Z",
"last_triggered_at": null,
"failure_count": 3,
"secret": "whsk_7A****************************dZ"
}
],
"count": 2
}

Error Codes

Status CodeError CodeDescription
401authentication_failedAuthentication failed. Check your API key or OAuth 2.0 access token
403insufficient_permissionsYour API key does not have permission to manage webhooks
429rate_limit_exceededYou have exceeded the rate limit for this endpoint
POST
/user/webhooks

Creates a new webhook configuration. The webhook will receive notifications for the specified event types.

Request Parameters

ParameterTypeDescription
url requiredstringThe URL where webhook notifications will be sent (must be HTTPS)
event_types optionalarrayArray of event types to subscribe to (defaults to all events if not specified)
description optionalstringDescription of the webhook for your reference

Example Request

POST /user/webhooks
Content-Type: application/json
X-API-Key: your_api_key_here

{
"url": "https://example.com/crypto/webhook",
"event_types": [
"payment.completed",
"payment.failed",
"withdrawal.status_changed"
],
"description": "Main payment notifications webhook"
}

Response Parameters

ParameterTypeDescription
idstringUnique identifier for the newly created webhook
urlstringThe URL where webhook notifications will be sent
event_typesarrayArray of event types this webhook will receive
statusstring"active" by default for new webhooks
created_atstringISO 8601 timestamp of when the webhook was created
secretstringSecret key for webhook signature verification (shown only once during creation)
descriptionstringDescription of the webhook

Example Response

{
"id": "wh_550e8400e29b41d4a716446655440000",
"url": "https://example.com/crypto/webhook",
"event_types": [
"payment.completed",
"payment.failed",
"withdrawal.status_changed"
],
"status": "active",
"created_at": "2025-04-30T16:22:33.456Z",
"secret": "whsk_6E8F92D4C7B31A5E9D0F87H2T",
"description": "Main payment notifications webhook"
}

Error Codes

Status CodeError CodeDescription
400invalid_urlThe URL is invalid or doesn't use HTTPS
400invalid_event_typesOne or more event types are invalid
400url_already_existsA webhook with this URL already exists
401authentication_failedAuthentication failed. Check your API key or OAuth 2.0 access token
403insufficient_permissionsYour API key does not have permission to manage webhooks
429rate_limit_exceededYou have exceeded the rate limit for this endpoint
DELETE
/user/webhooks

Deletes a webhook configuration. Once deleted, notifications will no longer be sent to the URL associated with the webhook.

Request Parameters

ParameterTypeDescription
webhook_id requiredstringThe ID of the webhook to delete

Example Request

DELETE /user/webhooks
Content-Type: application/json
X-API-Key: your_api_key_here

{
"webhook_id": "wh_550e8400e29b41d4a716446655440000"
}

Response Parameters

ParameterTypeDescription
deletedbooleanTrue if the webhook was successfully deleted
webhook_idstringThe ID of the deleted webhook

Example Response

{
"deleted": true,
"webhook_id": "wh_550e8400e29b41d4a716446655440000"
}

Error Codes

Status CodeError CodeDescription
400invalid_webhook_idThe webhook ID is invalid
404webhook_not_foundNo webhook with the specified ID was found
401authentication_failedAuthentication failed. Check your API key or OAuth 2.0 access token
403insufficient_permissionsYour API key does not have permission to manage webhooks
429rate_limit_exceededYou have exceeded the rate limit for this endpoint

Webhook Event Types

Event TypeDescription
payment.createdA new payment has been created
payment.processingA payment is being processed (transaction detected on blockchain)
payment.completedA payment has been completed successfully
payment.failedA payment has failed
payment.expiredA payment has expired without being completed
payment.allAll payment-related events
withdrawal.createdA new withdrawal has been created
withdrawal.approvedA withdrawal has been approved
withdrawal.processingA withdrawal is being processed
withdrawal.completedA withdrawal has been completed successfully
withdrawal.failedA withdrawal has failed
withdrawal.cancelledA withdrawal has been cancelled
withdrawal.status_changedAny change to a withdrawal's status
withdrawal.allAll withdrawal-related events
wallet.createdA new wallet has been created
wallet.balance_changedA wallet's balance has changed
wallet.allAll wallet-related events
security.login_attemptA login attempt has been detected
security.settings_changedSecurity settings have been changed
security.allAll security-related events

Webhook Payload Format

All webhooks are sent as HTTP POST requests with a JSON payload containing the following fields:

ParameterTypeDescription
idstringUnique identifier for this webhook notification
eventstringThe type of event that triggered the webhook
created_atstringISO 8601 timestamp of when the event occurred
dataobjectThe data associated with the event (varies by event type)

Notes

  • Webhooks are only sent to HTTPS URLs for security reasons.
  • Each webhook request includes a signature in the X-Signature header for verification.
  • Webhook deliveries are retried up to 5 times with exponential backoff in case of failure.
  • After 5 consecutive failures, a webhook is automatically set to "inactive" status.
  • You can create up to 10 webhooks per account.
  • The secret key for verifying webhook signatures is only shown once during creation.
  • Keep the secret key secure and never expose it in client-side code.

iGaming Integration Note

For online casino platforms, webhook integration is crucial for maintaining accurate player balances. Configure webhooks to track all payment.completed and withdrawal.completed events to update player balances in real-time. Set up redundant webhook endpoints to ensure no transaction notifications are missed. For high-volume casinos, consider implementing separate webhooks for deposits and withdrawals to manage the processing load more efficiently.