How webhooks work
1
Configure a webhook URL
Register your endpoint in the Crave Dashboard under Settings > Webhooks.
2
Crave sends a POST request
When an event occurs, Crave sends a JSON payload to your URL.
3
Your server processes the event
Parse the payload, verify the signature, and execute your business logic.
4
Return a 200 response
Acknowledge receipt within 10 seconds. Crave retries on failure.
Event types
Payload format
Every webhook delivery sends aPOST request with a JSON body:
Verify webhook signatures
Every webhook includes aX-Crave-Signature header containing an HMAC-SHA256 signature. Verify it to ensure the request came from Crave.
Retry policy
If your endpoint returns a non-2xx status or times out (10 seconds), Crave retries with exponential backoff:
After 5 failed attempts, the event is marked as failed. You can manually retry failed events from the Dashboard.
Idempotency
Webhook deliveries may arrive more than once. Use theid field to deduplicate:
Common use cases
Send an order confirmation email:Test webhooks locally
Use a tunnel service to expose your local server during development:Next steps
Testing
Test your webhook handlers with mock events.
Deployment
Deploy your storefront and configure production webhooks.