Webhooks
Learn how to receive, verify, and process webhooks from Katu9 securely.
Webhook Integration Guide
Katu9 supports webhooks to notify your application of important events, such as when a transaction is created. This guide explains how to receive, verify, and process webhooks securely.
Receiving Webhooks
- Register your webhook endpoint URL in the Katu9 dashboard or via the API.
- Choose the events you want to subscribe to (e.g.,
transaction.created
). - Katu9 will send a POST request to your endpoint for each event.
Webhook Request Structure
- Method:
POST
- Headers:
Content-Type: application/json
X-Katu9-Signature
: HMAC SHA256 signature of the payload (see below)X-Webhook-Event
: Event name (e.g.,transaction.created
)
- Body:
Verifying the Signature
To ensure the webhook is from Katu9 and hasn't been tampered with:
- Retrieve your webhook's secret from the dashboard or API.
- Compute the HMAC SHA256 hash of the raw request body using your secret.
- Compare the computed hash (as a hex string) with the value in the
X-Katu9-Signature
header.- If they match, the webhook is authentic.
Example (Node.js)
Best Practices
- Always verify the signature before processing the event.
- Respond with a 2xx status code quickly; Katu9 will retry on failure.
- Log received events for debugging/audit.
- Use HTTPS for your webhook endpoint.
Supported Events
transaction.created
: Triggered when a new transaction is created.payment_link.created
: Triggered when a new payment link is generated for a transaction (including regenerated links).
The payload for payment_link.created
is:
More events will be added in the future. Subscribe only to the events you need.
For more details or troubleshooting, contact support@katu9.com.