Overview
Webhooks notify your server when events happen in Shoppex. Use them to:- Fulfill orders automatically
- Update your database
- Send custom notifications
- Integrate with external services
Setting Up Webhooks
Webhook Payload
All webhooks follow this structure:Timestamps are Unix timestamps (seconds since epoch), not ISO strings.
Available Events
Order Events
| Event | Description |
|---|---|
order:paid | Order/invoice paid successfully |
order:cancelled | Order cancelled or expired |
order:paid:product | Order paid (includes full product data) |
order:cancelled:product | Order cancelled (includes full product data) |
Subscription Events
| Event | Description |
|---|---|
subscription:created | New subscription started |
subscription:cancelled | Subscription cancelled |
Verifying Webhooks
Always verify webhook signatures to ensure authenticity. Shoppex signs webhooks using HMAC-SHA512:Webhook Headers
| Header | Description |
|---|---|
X-Shoppex-Event | The event type (e.g., order:paid) |
X-Shoppex-Signature | HMAC-SHA512 signature |
X-Shoppex-Delivery | Unique delivery ID for deduplication |
Retry Policy
If your endpoint returns an error (non-2xx status), we retry:| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 5 minutes |
| 3 | 30 minutes |
| 4 | 2 hours |
| 5 | 24 hours |
Best Practices
Return 200 quickly
Return 200 quickly
Process webhooks asynchronously. Return 200 immediately and handle the event in a background job.
Handle duplicates
Handle duplicates
Webhooks may be delivered more than once. Use the
id field to deduplicate.Verify signatures
Verify signatures
Always verify webhook signatures in production to prevent spoofing.