Webhooks
Webhooks allow external systems to receive real-time notifications when events occur in LawnLedger. When an event is triggered, LawnLedger sends an HTTP POST request to your configured endpoint URL.
Setting Up Webhooks
Via the API
curl -X POST https://api.lawnledgercrm.com/api/webhooks \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"url": "https://your-server.com/webhooks/lawnledger",
"events": ["invoice.paid", "estimate.approved", "contract.signed"]
}'Via the App
- Navigate to Settings > Integrations > Webhooks
- Click Add Webhook
- Enter your endpoint URL
- Select the events you want to subscribe to
- Click Save
Available Events
| Event | Description |
|---|---|
customer.created | A new customer was created |
customer.updated | A customer record was updated |
customer.deleted | A customer was deleted |
invoice.created | A new invoice was created |
invoice.sent | An invoice was emailed to the customer |
invoice.paid | An invoice was paid in full |
invoice.overdue | An invoice has become overdue |
estimate.created | A new estimate was created |
estimate.sent | An estimate was sent to the customer |
estimate.approved | A customer approved an estimate |
estimate.declined | A customer declined an estimate |
contract.created | A new contract was created |
contract.sent | A contract was sent for signature |
contract.signed | A customer signed a contract |
job.created | A new job was scheduled |
job.completed | A job was marked complete |
payment.received | A payment was recorded |
Webhook Payload
Each webhook request includes a JSON payload with the event type and relevant data:
{
"event": "invoice.paid",
"timestamp": "2025-06-15T14:30:00Z",
"data": {
"id": "inv_xyz789",
"invoiceNumber": "INV-0042",
"customerId": "cust_abc123",
"total": 378.00,
"amountPaid": 378.00,
"status": "paid",
"paidAt": "2025-06-15T14:30:00Z"
}
}Request Headers
Each webhook request includes these headers:
| Header | Description |
|---|---|
Content-Type | application/json |
X-LawnLedger-Event | The event type (e.g., invoice.paid) |
X-LawnLedger-Timestamp | ISO 8601 timestamp of the event |
X-LawnLedger-Signature | HMAC-SHA256 signature for verification |
Verifying Webhook Signatures
To verify that a webhook came from LawnLedger, compute an HMAC-SHA256 hash of the request body using your webhook secret and compare it to the X-LawnLedger-Signature header.
Always verify webhook signatures in production to prevent spoofed requests. Your webhook secret is available in Settings > Integrations > Webhooks.
Retry Policy
If your endpoint returns a non-2xx status code, LawnLedger retries the webhook:
- Retry 1 — After 1 minute
- Retry 2 — After 5 minutes
- Retry 3 — After 30 minutes
After 3 failed retries, the webhook delivery is marked as failed. You can view failed deliveries and manually retry them from the webhooks settings page.
Managing Webhooks
List Webhooks
curl https://api.lawnledgercrm.com/api/webhooks \
-b cookies.txtDelete a Webhook
curl -X DELETE https://api.lawnledgercrm.com/api/webhooks/wh_abc123 \
-b cookies.txt