Webhook
Use webhooks to receive real-time notifications from AlphaX
Webhooks are a powerful way to receive real-time notifications from AlphaX.
They allow you to set up a callback URL that AlphaX will send HTTP POST requests to whenever certain events occur in your company.
How to Set Up a Webhook?
- Log in to your AlphaX account (Director, HR, or Developer role).
- Navigate to the “Developer” menu in the dashboard.
- Click on “Webhooks” and then “Create new Webhook”.
- Fill in the required fields:
- Name: A descriptive name for your webhook.
- Destination URL: The callback URL where you want to receive the notifications.
- Events: Select the events you want to subscribe to.
- Click “Submit” to save your settings.
Payload Structure
When an event occurs, AlphaX will send a POST request to your specified destination URL with a JSON payload containing the event details. The payload will have the following structure:
Verifying Webhook Signatures
To ensure that the webhook requests you receive are genuinely from AlphaX, you can verify the signatures included in the request headers. Each webhook request will include a signature in the X-Signature header, which you can use to validate the authenticity of the request.
Use the raw request body and the secret key you set up when creating the webhook, and apply the HMAC SHA256 algorithm to generate a hash. Compare this hash with the signature provided in the X-Signature header to confirm that the request is legitimate.
Examples:
Node.js
PHP
Go
Java Spring Boot
Retry Mechanism
If your server fails to respond with a 2xx status code, AlphaX will automatically retry sending the webhook notification. The retry attempts will follow an exponential backoff strategy, with a maximum of 5 retries. This ensures that you have multiple chances to receive the notification in case of temporary issues with your server.
- First attempt: 10s after the initial failure
- Second attempt: 30s after the first retry
- Third attempt: 1 minute after the second retry
- Fourth attempt: 2 minutes after the third retry
- Fifth attempt: 5 minutes after the fourth retry
Available Events
checkout_payment.succeededcheckout_payment.failed
checkout_payment.succeeded
This event is triggered when a payment for a checkout is successfully processed (for both SDK and Payment Link).
checkout_payment.failed
This event is triggered when a payment for a checkout is failed to process (for both SDK and Payment Link).

