Overview
When an event occurs (e.g., invoice paid), Bousol sends an HTTP POST request to your configured endpoint with event details.Setting Up Webhooks
Via Dashboard
- Go to Developers → Webhooks
- Click Add Endpoint
- Configure the endpoint:
| Field | Description |
|---|---|
| URL | Your server endpoint (must be HTTPS) |
| Events | Which events to receive |
| Description | Optional description |
- Click Create
- Copy the Webhook Secret for signature verification
Via API
Event Types
Invoice Events
| Event | Description |
|---|---|
invoice.created | Invoice was created |
invoice.sent | Invoice was sent to customer |
invoice.viewed | Customer viewed the invoice |
invoice.paid | Invoice was paid |
invoice.overdue | Invoice passed due date |
invoice.voided | Invoice was voided |
Payment Link Events
| Event | Description |
|---|---|
payment_link.created | Payment link was created |
payment_link.paid | Payment was made via link |
Payout Events
| Event | Description |
|---|---|
payout.created | Payout was created |
payout.approved | Payout was approved |
payout.rejected | Payout was rejected |
payout.completed | Payout was sent successfully |
payout.failed | Payout execution failed |
Disbursement Events
| Event | Description |
|---|---|
disbursement.created | Disbursement was created |
disbursement.submitted | Submitted for approval |
disbursement.approved | Approved for execution |
disbursement.rejected | Rejected |
disbursement.completed | All payments sent |
disbursement.failed | Execution failed |
Client Events
| Event | Description |
|---|---|
client.created | Client was created |
client.updated | Client was updated |
client.deleted | Client was deleted |
Webhook Payload
Structure
Fields
| Field | Description |
|---|---|
id | Unique event ID |
type | Event type |
created | Event timestamp (ISO 8601) |
data | Event-specific data |
Verifying Webhooks
Verify webhook signatures to ensure requests come from Bousol.Signature Header
Each webhook includes a signature header:Verification Steps
- Extract timestamp (
t) and signature (v1) from header - Construct the signed payload:
{timestamp}.{request_body} - Compute HMAC-SHA256 with your webhook secret
- Compare computed signature with
v1
Node.js Example
Python Example
Responding to Webhooks
Success Response
Return a2xx status code to acknowledge receipt:
Failure Handling
If your endpoint returns a non-2xx status or times out, Bousol retries:| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 5 minutes |
| 3 | 30 minutes |
| 4 | 2 hours |
| 5 | 24 hours |
Timeouts
Your endpoint must respond within 30 seconds. For long-running tasks:- Acknowledge the webhook immediately (return 200)
- Process the event asynchronously
Managing Webhooks
Viewing Endpoints
Go to Developers → Webhooks to see all endpoints:| Column | Description |
|---|---|
| URL | Endpoint URL |
| Events | Subscribed events |
| Status | Active, Paused, or Failing |
| Last Delivery | Most recent attempt |
Viewing Deliveries
Click on an endpoint to see delivery history:| Column | Description |
|---|---|
| Event | Event type and ID |
| Status | Success, Failed, Pending |
| Response | HTTP status code |
| Time | Delivery timestamp |
Resending Events
To resend a failed event:- Go to the endpoint’s delivery history
- Find the failed delivery
- Click Resend
Disabling Endpoints
To temporarily disable an endpoint:- Go to Developers → Webhooks
- Click on the endpoint
- Click Pause
Testing Webhooks
Test Events
Send test events to your endpoint:- Go to Developers → Webhooks
- Click on the endpoint
- Click Send Test Event
- Select an event type
- Click Send
Local Development
For local development, use a tunnel service:- Install ngrok or similar
- Run
ngrok http 3000 - Use the ngrok URL as your webhook endpoint
- Test with real or simulated events
Best Practices
Idempotency
Events may be delivered more than once. Make your handler idempotent:Event Ordering
Events may arrive out of order. Use timestamps and status checks rather than assuming order.Security
- Always verify signatures
- Use HTTPS endpoints only
- Validate event data before processing
- Keep webhook secrets secure
Monitoring
- Log all received webhooks
- Alert on repeated failures
- Monitor endpoint health
- Review delivery history regularly
Next Steps
- API Overview — API basics
- Authentication — Set up API keys
- Invoices API — Invoice endpoints