Overview
Webhooks allow your Spree store to send real-time HTTP POST notifications to external services when events occur. When an order is completed, a product is updated, or inventory changes, Spree can automatically notify your CRM, fulfillment service, analytics platform, or any other system. Webhooks are built on top of Spree’s event system, providing:- Multi-store support - Each store has its own webhook endpoints
- Event filtering - Subscribe to specific events or patterns with wildcards
- Secure delivery - HMAC-SHA256 signatures for payload verification
- Failure handling - Failed deliveries are retried automatically and can be re-sent by hand, and an endpoint that keeps failing is disabled
- Full audit trail - Track every delivery attempt with response codes and timing
How Webhooks Work
- An event is published (e.g.,
order.placed) - The
WebhookEventSubscriberreceives all events - It finds active webhook endpoints subscribed to that event
- For each endpoint, it creates a
WebhookDeliveryrecord and queues a job - The job sends an HTTP POST request with the event payload and HMAC signature
Creating Webhook Endpoints
Via Admin Panel
Navigate to Settings → Developer → Webhooks in the admin panel to create and manage webhook endpoints.Via the Admin API
Endpoint Attributes
Endpoints always belong to the current store — the association is set automatically from the request scope, so you never pass it when creating or updating an endpoint.
Event Subscriptions
Thesubscriptions attribute controls which events trigger webhooks to this endpoint. Set it when creating the endpoint, or change it later:
subscriptions array accepts exact event names and wildcard patterns:
Webhook Payload
Each webhook delivery sends a JSON payload with the following structure. Thedata object uses the same Store API V3 serializers as the REST API, so webhook payloads and API responses share the same schema:
Payload
For complete payload schemas for each event type, see Webhook Events & Payloads.
HTTP Request Details
Headers
Each webhook request includes these headers:Verifying Webhook Signatures
To ensure webhooks are genuinely from your Spree store, verify the signature.Next.js
The Spree Storefront includes a ready-made webhook route handler with signature verification and event routing. See the storefront email docs for details.Any JavaScript/TypeScript framework
Use@spree/sdk/webhooks for framework-agnostic verification:
Store SDK
Ruby
server/app/controllers/webhooks_controller.rb
Delivery Status
Failed Deliveries
Any response other than 2xx — including a timeout or a connection error — marks the delivery as failed. Spree then sends it again, waiting longer before each try, up to 5 attempts in total over about six minutes. The delivery log shows the outcome of the latest attempt. Retries stop as soon as the endpoint is turned off. Every attempt carries the same eventid, so use it to ignore an event your receiver has already processed. To send a delivery again after the retries run out, re-send it from the delivery log (see below).
If an endpoint fails 15 deliveries in a row, Spree disables it and emails the store staff. Fix the endpoint, then turn it back on by marking it active again.
Checking Delivery Status
Inspect an endpoint’s delivery log, and re-send a failed delivery, via the Admin API:Delivery Attributes
Configuration
Webhooks are on by default and can be switched off installation-wide. SSL certificates are verified in production, and not in development — so you can point an endpoint at a local tunnel with a self-signed certificate while building. Both are configurable if your environment needs something different.Available Events
Webhooks can subscribe to any event in Spree’s event system. See Webhook Events & Payloads for the complete list. Common webhook events include:Testing Webhooks
In Development
Use tools like ngrok or webhook.site to test webhooks locally. Create a test endpoint pointed at the tunnel:send_test delivers a synthetic webhook.test event so you can verify the endpoint is reachable and your signature-verification code works, without having to trigger a real order.
Best Practices
Respond quickly
Return a 2xx response as fast as possible. Process webhook data asynchronously in a background job.
Verify signatures
Always verify the
X-Spree-Webhook-Signature header to ensure the webhook is authentic.Handle duplicates
Use the event
id to detect and handle duplicate deliveries. A delivery that is re-sent carries the same event id.Subscribe selectively
Only subscribe to events you need. Use specific patterns rather than
* when possible.Troubleshooting
Webhooks Not Delivering
- Check that webhooks are enabled installation-wide
- Verify the endpoint is marked active
- Confirm the endpoint actually subscribes to the event you expect
- Check the event belongs to the same store as the endpoint
Signature Verification Failing
- Ensure you’re using the raw request body (not parsed JSON)
- Verify you’re using the correct
secret_keyfor this endpoint - Check that no middleware is modifying the request body
Deliveries Failing
Check the delivery records for details — each carrieserror_type, request_errors, response_code, and response_body. Filter the log with Ransack predicates such as success_eq=false or event_name_eq:
Related Documentation
- Events - Understanding Spree’s event system
- Admin SDK - Setting up the
@spree/admin-sdkclient used in the management examples above - Customization Quickstart - Overview of all customization options
- Dependencies - Customizing Spree services

