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

  1. Navigate to Settings > Integrations > Webhooks
  2. Click Add Webhook
  3. Enter your endpoint URL
  4. Select the events you want to subscribe to
  5. Click Save

Available Events

EventDescription
customer.createdA new customer was created
customer.updatedA customer record was updated
customer.deletedA customer was deleted
invoice.createdA new invoice was created
invoice.sentAn invoice was emailed to the customer
invoice.paidAn invoice was paid in full
invoice.overdueAn invoice has become overdue
estimate.createdA new estimate was created
estimate.sentAn estimate was sent to the customer
estimate.approvedA customer approved an estimate
estimate.declinedA customer declined an estimate
contract.createdA new contract was created
contract.sentA contract was sent for signature
contract.signedA customer signed a contract
job.createdA new job was scheduled
job.completedA job was marked complete
payment.receivedA 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:

HeaderDescription
Content-Typeapplication/json
X-LawnLedger-EventThe event type (e.g., invoice.paid)
X-LawnLedger-TimestampISO 8601 timestamp of the event
X-LawnLedger-SignatureHMAC-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.txt

Delete a Webhook

curl -X DELETE https://api.lawnledgercrm.com/api/webhooks/wh_abc123 \
  -b cookies.txt