Webhooks
Webhooks allow KryptaPay to notify your application in real time when events occur on your account. Instead of continuously polling the API for transaction updates, you can register a webhook endpoint and receive notifications automatically when deposits, payouts, and other payment events change status.How Webhooks Work
Webhook endpoints are configured from the KryptaPay Dashboard. When creating a webhook endpoint, you provide:- The HTTPS URL where KryptaPay will send events.
- A webhook secret used to authenticate requests.
Creating a Webhook Endpoint
To create a webhook endpoint:- Open the KryptaPay Dashboard.
- Navigate to Developers → Webhooks.
- Click Create Endpoint.
- Enter your HTTPS endpoint URL.
- Select the events you want to receive.
- Generate or provide a webhook secret.
- Save the endpoint.
Webhook endpoints must use HTTPS in production environments.
Webhook Request
KryptaPay sends events using HTTP POST requests. Example:Authenticating Webhooks
Every webhook request contains a signature in the:- Algorithm: HMAC SHA-256
- Secret: The webhook secret configured when the endpoint was created.
- Payload: The raw HTTP request body.
Verifying the Signature
Your application must verify the signature before processing the event.Example (Node.js)
Supported Events
Handling Webhook Events
After verifying the signature:- Validate the event type.
- Retrieve the transaction if necessary.
- Update your internal records.
- Return a successful response.
Response Requirements
Your webhook endpoint must respond quickly. Successful response:Retry Policy
If your endpoint returns:- A timeout.
- A network error.
- A
5xxHTTP status code.
- Idempotent.
- Fast.
- Safe to execute multiple times.
Best Practices
- Always verify
X-KryptaPay-Signature. - Store processed event IDs to prevent duplicates.
- Return
200 OKafter successful processing. - Process heavy tasks asynchronously.
- Use HTTPS endpoints only.
- Log webhook event IDs for debugging.
- Do not expose your webhook secret.
Next Steps
Verification and Compliance
Learn how KryptaPay uses KYB and KYC verification to provide secure, transparent, and trusted payment services.
