Payment Status Updates via Webhooks
Kashimi supports webhooks to notify you about unique status changes in a payment. Typically, you will receive a webhook when a payment is initiated (statusPENDING), and when it is finalised (status COMPLETED or FAILED).
You can opt-in to receive webhooks per payment by including a webhookUrl in the payment metadata when initiating a payment.
IP Allowlist
Kashimi sends webhooks from a fixed set of IP addresses. To ensure your endpoint only accepts legitimate webhook traffic, allowlist the following IPs in your firewall or infrastructure:| Environment | IP Addresses |
|---|---|
| Production | Contact the Kashimi team for the current production IP list |
| Sandbox | Contact the Kashimi team for the current sandbox IP list |
Reach out to [email protected] to receive the up-to-date list of Kashimi webhook IP addresses for your environment.
Secret Key Best Practices
Secret Key Best Practices
Follow these security best practices for your webhook secret:Randomness
- Use a cryptographically secure pseudo-random number generator
- Avoid predictable values or custom algorithms
- Generate truly random keys
- Use at least 256 bits (32 bytes) for HMAC-SHA256
- Keys shorter than the hash output length reduce security
- Keys longer than the hash output don’t significantly improve security
- Refresh keys periodically to limit exposure damage
- Rotate keys as part of your security practices
- Store keys securely and never expose them in code or logs
Webhook Payload
When a payment status changes, Kashimi sends a webhook with the following JSON payload:Payload Fields
Field | Type | Required | Description |
|---|---|---|---|
eventName | string | ✓ | Always "PAYMENT_STATUS_UPDATED" for payment status webhooks |
eventId | string | ✓ | Unique identifier for this webhook event (UUID format) |
paymentId | string | ✓ | The Kashimi payment ID that this status update relates to (UUID format) |
status | string | ✓ | The new payment status: PENDING, COMPLETED, FAILED, or UNKNOWN |
timestamp | string | ✓ | ISO 8601 timestamp when the status change occurred |
The
eventId is unique for each webhook delivery attempt, while paymentId identifies the specific payment. Use paymentId to correlate webhook events with payments in your system.Webhook Security
To ensure webhook authenticity, Kashimi uses HMAC-SHA256 signatures. Each webhook payload is signed using your registered secret key.Why signatures are essential:
- Authentication - Verify the webhook actually came from Kashimi, not an attacker
- Integrity - Ensure the payment status data hasn’t been tampered with in transit
- Replay protection - Prevent malicious actors from resending old webhook payloads
- Trust - Safely process payment updates without risking fraudulent notifications
Signature Validation
When you receive a webhook, validate it following these steps:Generate expected signature
Generate an HMAC-SHA256 signature using your secret key and the request body
TypeScript example