What are Webhooks?
Webhooks are HTTP callbacks that notify your server when events happen in Shoppex. Instead of polling the API, your server receives events automatically.Setting Up Webhooks
Configure webhook endpoints in the Dashboard:- Go to Settings → Webhooks
- Click Add Endpoint
- Enter your endpoint URL
- Select which events to receive
Webhook Payload
All webhooks follow this structure:Timestamps are Unix timestamps (seconds since epoch), not ISO strings.
Headers
Each webhook request includes these headers:| Header | Description |
|---|---|
Content-Type | application/json |
User-Agent | Shoppex-Webhook/1.0 |
X-Shoppex-Event | Event type (e.g., order:paid) |
X-Shoppex-Signature | HMAC-SHA512 signature |
X-Shoppex-Delivery | Unique delivery ID for deduplication |
Signature Verification
Always verify webhook signatures to ensure authenticity. Shoppex uses HMAC-SHA512:Testing Webhooks
Use the dashboard to send test events:- Go to Settings → Webhooks
- Click on your endpoint
- Click Send Test Event
- Select an event type
Best Practices
Return 200 quickly
Return 200 quickly
Process webhooks asynchronously. Return
200 OK immediately and handle the event in a background job.Handle duplicates
Handle duplicates
Webhooks may be delivered more than once. Use the
X-Shoppex-Delivery header to deduplicate.Verify signatures
Verify signatures
Always verify webhook signatures in production to prevent spoofing.
Use HTTPS
Use HTTPS
Always use HTTPS endpoints in production for security.