Skip to main content

Webhooks

StorePilot can send an HTTP POST request to any URL when a new error is captured or a new lead is submitted. This allows you to integrate with any external system.

Configuration

Configure webhook URLs per-site in Dashboard → Sites → [Site] → Settings:

Setting KeyTrigger
n8n_webhookNew error (first occurrence or re-open)
n8n_leads_webhookNew lead capture

Although the setting keys reference n8n, you can point them to any webhook receiver — Zapier, Make, your own server, etc.


Payload: Error Webhook

Sent to n8n_webhook URL when a new error fires.

{
"event": "new_error",
"siteId": 1,
"siteDomain": "mystore.com",
"error": {
"id": 42,
"message": "Uncaught TypeError: Cannot read properties of null",
"source": "https://mystore.com/wp-content/themes/my-theme/js/app.js",
"lineno": 42,
"colno": 18,
"stack": "TypeError: ...",
"status": "new",
"occurrenceCount": 1,
"firstSeenAt": "2024-01-15T10:00:00.000Z",
"lastSeenAt": "2024-01-15T10:00:00.000Z",
"context": {
"url": "https://mystore.com/shop/",
"userAgent": "Mozilla/5.0 ...",
"referrer": ""
}
}
}

Payload: Lead Webhook

Sent to n8n_leads_webhook URL when a new lead is captured.

{
"event": "new_lead",
"siteId": 1,
"siteDomain": "mystore.com",
"lead": {
"id": 17,
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "+380501234567",
"wpUserId": 5,
"cartItems": [
{
"product_id": 123,
"name": "Premium Widget",
"qty": 2,
"line_total": 49.98
}
],
"cartTotal": "$49.98",
"pageUrl": "https://mystore.com/checkout/",
"capturedAt": "2024-01-15T10:05:00.000Z"
}
}

n8n Integration Example

  1. In n8n, create a new workflow
  2. Add a Webhook trigger node
  3. Copy the webhook URL from n8n
  4. Paste it into the Platform settings (n8n_webhook or n8n_leads_webhook)
  5. Connect downstream nodes to:
    • Send a Slack message
    • Create a Jira ticket
    • Add a row to Google Sheets
    • Send a WhatsApp message
    • Create a CRM contact

Webhook Security

Webhook payloads are sent without a signature by default. If you need to verify that a webhook comes from your Platform:

  1. Add a secret token to your webhook URL as a query parameter: ?secret=your-secret
  2. Validate it in your receiver

A future version may add HMAC-SHA256 header signatures.


Retry Behaviour

Webhook delivery is fire and forget — if the target URL is unavailable, the notification is not retried. For reliable delivery, use n8n's built-in retry mechanism or point the webhook to a queue.