How Webhooks Work
- An event occurs (e.g., a customer completes a payment)
- Kyren Pay sends an HTTP POST request to your configured webhook URL
- The request includes a signature for verification
- Your server processes the event and returns a
200response
Configuring Webhooks
Set up your webhook endpoint in the Merchant Dashboard:- Go to Dashboard > Developer > Webhook Settings
- Enter your Webhook URL (e.g.,
https://yoursite.com/webhooks/kyren) - Copy your Webhook Secret — you’ll need this to verify signatures
Webhook Payload
Every webhook request includes these headers:| Header | Description |
|---|---|
Content-Type | application/json |
X-Kyren-Signature | HMAC-SHA256 signature for verification |
X-Kyren-Timestamp | Unix timestamp when the webhook was sent |
Best Practices
Verify Signatures
Always verify the
X-Kyren-Signature header to ensure the webhook is authentic. See Webhook Signatures.Return 200 Quickly
Return a
200 response as soon as you receive the webhook. Process the event asynchronously if it takes more than a few seconds.Handle Duplicates
Use the event
id to deduplicate. Your endpoint may receive the same event more than once due to retries.Use a Queue
For production, consider pushing webhook events to a message queue (e.g., RabbitMQ, SQS) for reliable processing.