Receive real-time notifications when events occur in your SyncBooks account.
What are Webhooks?
Webhooks are HTTP callbacks that notify your application when specific events happen:
- Invoice created, sent, or paid
- Payment received or failed
- Expense submitted or approved
- Payroll processed
- Customer created or updated
Setting Up Webhooks
- Go to Settings → Webhooks
- Click "Add Webhook Endpoint"
- Enter your endpoint URL
- Select events to subscribe to
- Choose API version
- Save webhook
- Test with sample event
Webhook Payload
{
"id": "evt_1234567890",
"type": "invoice.paid",
"created": 1234567890,
"data": {
"object": {
"id": "inv_abc123",
"amount": 1500.00,
"customer": "cus_xyz789",
"status": "paid"
}
}
}Verifying Webhooks
Verify webhook signatures to ensure authenticity:
- Extract signature from header:
X-SyncBooks-Signature - Compute HMAC with webhook secret
- Compare computed signature with received signature
- Process event only if signatures match
Retry Logic
- SyncBooks retries failed webhooks automatically
- Exponential backoff: 1min, 5min, 30min, 2hr, 6hr
- Maximum 5 retry attempts
- View delivery status in dashboard
Best Practices
- Return 200 status code quickly
- Process events asynchronously
- Handle duplicate events (idempotency)
- Log all webhook events
- Use HTTPS endpoints only
Testing: Use webhook.site or ngrok to test webhooks during development.