How Webhooks Work
When an event occurs (like an invoice being paid), Alguna sends a notification to a URL you specify. Your application can then take action based on that event.Setting Up Webhooks
Step 1: Add a Webhook Endpoint
- Navigate to Settings → Webhooks
- Click Add Endpoint
- Enter your webhook URL (provided by your development team)
- Click Save
Step 2: Select Events
Choose which events you want to receive:- Click on your endpoint
- Select the events you want to subscribe to
- Click Save
Step 3: Copy the Webhook Secret
- After saving, copy the Webhook Secret
- Share this with your development team for signature verification
Available Events
Subscription Events
| Event | When It’s Sent |
|---|---|
subscription.activated | A subscription becomes active |
subscription.started | A subscription reaches its start date |
subscription.cancelation_scheduled | A cancellation is scheduled |
subscription.canceled | A subscription is canceled |
Invoice Events
| Event | When It’s Sent |
|---|---|
invoice.issued | An invoice is sent to a customer |
invoice.paid | An invoice is fully paid |
Payment Events
| Event | When It’s Sent |
|---|---|
payment.created | A payment is initiated |
payment.updated | A payment status changes |
Credit Events
| Event | When It’s Sent |
|---|---|
account.credits.granted | Credits are added to a customer |
account.credits.balance_depleted | A customer’s credit balance reaches zero |
Other Events
| Event | When It’s Sent |
|---|---|
checkout.session.completed | A checkout is completed |
refund.updated | A refund status changes |
Testing Webhooks
Send test events to verify your setup:- Go to Settings → Webhooks
- Select your endpoint
- Click Send Test Event
- Choose an event type
- Verify the event was received
Viewing Webhook History
Track webhook deliveries:- Go to Settings → Webhooks
- Select your endpoint
- Click Message Logs
- View delivery status, timestamps, and responses
Retry Policy
If delivery fails, Alguna retries automatically:| Attempt | Wait Time |
|---|---|
| 1 | Immediate |
| 2 | 5 seconds |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
| 6 | 5 hours |
| 7 | 10 hours |
Troubleshooting
Webhook Not Received
- Check the endpoint URL is correct
- Verify the endpoint is publicly accessible
- Review Message Logs for error details
- Ensure your server responds within 15 seconds
Endpoint Disabled
- Check Message Logs for failure reasons
- Fix any issues with your endpoint
- Click Enable to reactivate
Best Practices
Test First
Use test events before going live.
Monitor Logs
Regularly check webhook logs for failures.
Secure Secrets
Never expose your webhook secret publicly.
Quick Response
Ensure your endpoint responds within 15 seconds.
Next Steps
Event Reference
See all webhook events and payloads.
Automations
Automate workflows based on events.