Endpoint Details
- URL:
/api/v0/webhooks
- Method:
POST
- Authentication: Required (API Key Authentication with Scopes)
- Content-Type:
application/json
- Required Scope:
webhook:create
Authentication
This endpoint requires API key authentication with specific scopes:Required Headers
Required Scope
Your API key must have thewebhook:create
scope to access this endpoint.
Request Body
Required Fields
Field | Type | Description | Validation |
---|---|---|---|
name | string | Webhook name for identification | 3-100 characters |
url | string | Endpoint URL where events will be sent | Valid URL format |
Optional Fields
Field | Type | Description | Default | Validation |
---|---|---|---|---|
isActive | boolean | Whether webhook is active | true | Boolean |
signing_secret | string | Secret for payload signature verification | Auto-generated | Min 32 chars, alphanumeric + _- |
encrypted | boolean | Whether payloads should be encrypted | false | Boolean |
Request Schema
Response
Success Response (201 Created)
Error Responses
Field Validation Rules
Name Validation
Name Validation
- Required: Yes
- Type: String
- Length: 3-100 characters
- Description: Human-readable name for webhook identification
URL Validation
URL Validation
- Required: Yes
- Type: String (URL format)
- Protocol: Must be a valid URL (HTTPS recommended for production)
- Description: Endpoint where webhook events will be sent
Signing Secret Validation
Signing Secret Validation
- Required: No (auto-generated if not provided)
- Type: String
- Pattern:
^[a-zA-Z0-9_\-]{32,}$
- Length: Minimum 32 characters
- Characters: Letters, numbers, underscores, and hyphens only
Active Status
Active Status
- Required: No
- Type: Boolean
- Default:
true
- Description: Whether webhook will receive events
Encryption
Encryption
- Required: No
- Type: Boolean
- Default:
false
- Description: Whether webhook payloads should be encrypted
Example Requests
Use Cases
Payment Event Notifications
Receive real-time updates about payment status changes
Invoice Lifecycle Tracking
Monitor invoice creation, updates, and payments
Customer Activity Monitoring
Track customer registration and profile updates
Transaction Processing
Monitor transaction status and settlement events
Balance Updates
Get notified when wallet balances change
Transfer Notifications
Track the status of cross-chain transfers
Integration Examples
Express.js Webhook Handler
Flask Webhook Handler
Security Features
Signature Verification
Signature Verification
- HMAC SHA-256: Cryptographic signature for payload verification
- Timing-safe comparison: Prevent timing attacks
- Automatic generation: Secure secrets generated automatically
Payload Encryption
Payload Encryption
- AES-256 encryption: Industry-standard encryption for sensitive data
- Key rotation: Support for periodic key rotation
- Selective encryption: Choose which webhooks need encryption
Access Control
Access Control
- Scope-based permissions:
webhook:create
scope required - Application isolation: Webhooks isolated by application
- Rate limiting: Protection against abuse
Best Practices
1
Use HTTPS Endpoints
Always use HTTPS URLs for webhook endpoints in production to ensure data security.
2
Verify Signatures
Always verify webhook signatures before processing events to ensure authenticity.
3
Handle Retries
Implement proper error handling and return appropriate HTTP status codes (200 for success).
4
Process Asynchronously
Process webhook events asynchronously to respond quickly and avoid timeouts.
5
Monitor Delivery
Set up monitoring for webhook delivery failures and implement alerting.
Rate Limiting
This endpoint is subject to the standard API rate limits:- Production: 1000 requests per hour per API key
- Development: 100 requests per hour per API key
Webhook Events
Common event types that webhooks receive include:payment.completed
- Payment successfully processedpayment.failed
- Payment processing failedpayment.pending
- Payment is pending processingpayment.refunded
- Payment has been refunded
Related Endpoints
GET /api/v0/webhooks
- List all webhooksGET /api/v0/webhooks/{id}
- Fetch specific webhookPATCH /api/v0/webhooks/{id}
- Update webhookDELETE /api/v0/webhooks/{id}
- Delete webhook