Overview
When you usewebhookMode: true in payment requests, payment results are delivered to your configured webhook endpoints instead of being returned in the HTTP response. This page covers how to receive, verify, and process these webhook payloads.
Event Types
Webhook Payload Structure
All webhook payloads follow this structure:Payload Fields
string
required
The type of event that triggered this webhook.Values:
payment.completed, payment.failed, payment.cancelled, payment.timeoutstring
required
Unique identifier for this event. Use this for idempotency checks.Example:
"evt_01HQ3K4M5N6P7R8S9T0UVWXYZ"string
required
ISO 8601 timestamp of when the event occurred.
object
required
Event-specific payload data containing the payment result.
Event Payload Examples
payment.completed
payment.failed
payment.cancelled
payment.timeout
Signature Verification
All webhook requests include headers for signature verification. You must verify signatures to ensure webhooks are authentic and haven’t been tampered with.Webhook Headers
Verification Algorithm
- Extract headers:
webhook-id,webhook-timestamp,webhook-signature - Check timestamp is within 5-minute tolerance window
- Construct signed content:
${webhook-id}.${webhook-timestamp}.${raw-body} - Compute HMAC-SHA256 using your webhook secret (base64-decoded)
- Compare computed signature with provided signature
Node.js Example
Python Example
Response Requirements
Your webhook endpoint must respond according to these requirements:If your endpoint doesn’t respond with a
2xx status within 15 seconds, the webhook is considered failed and will be retried.Retry Schedule
After all retries are exhausted, the webhook delivery is marked as failed. You can query the transaction status using
GET /v1/transactions/{transactionId} to reconcile any missed webhooks.
Best Practices
Idempotency
Idempotency
Use the
eventId field to ensure you don’t process the same event twice. Store processed event IDs and skip duplicates:Acknowledge quickly
Acknowledge quickly
Respond to webhooks immediately, then process asynchronously:
Handle all event types
Handle all event types
Subscribe to all relevant event types and handle each appropriately:
Secure your endpoint
Secure your endpoint
- Always verify webhook signatures
- Use HTTPS endpoints only
- Validate the webhook-timestamp is recent
- Consider IP allowlisting if available
Troubleshooting
Signature verification fails
Signature verification fails
Common causes:
- Using the wrong webhook secret
- Modifying the payload before verification (e.g., parsing JSON first)
- Clock skew exceeding 5-minute tolerance
- Decoding the secret incorrectly (must be base64-decoded)
- Verify you’re using the secret from endpoint creation
- Use the raw request body for signature verification
- Ensure your server clock is synchronized with NTP
- Base64-decode the secret before computing HMAC
Not receiving webhooks
Not receiving webhooks
Check:
- Endpoint URL is publicly accessible
- Endpoint is not returning errors
- Firewall allows incoming HTTPS connections
- Endpoint status is
active(notdisabled) - You’re subscribed to the relevant event types
Duplicate webhooks
Duplicate webhooks
Cause: Retries due to slow responses or 5xx errors.Solution: Implement idempotency using
eventId. Store processed event IDs and skip duplicates.Next Steps
Webhook Setup
Configure webhook endpoints
HTTP Endpoints
Use webhookMode in payment requests
Get Transaction
Query transaction status for reconciliation
Data Types
Complete data type reference