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
This page covers normal Shoppex event webhooks like
order:paid and subscription:created.
If you are implementing a DYNAMIC product with dynamic_webhook, use Dynamic Product Delivery.You can register webhooks through the dashboard or manage webhook subscriptions through the Developer API.
The event payload is the same either way.
Setting Up Webhooks
Webhook Payload
All webhooks follow this structure:Dashboard test deliveries use the same top-level envelope as live deliveries:
event, data, and created_at.
The values inside data are synthetic, but the signature covers the full raw JSON body exactly the same way as a real webhook.Top-level webhook
created_at is a Unix timestamp.
Nested timestamps inside data can be ISO 8601 strings.One invoice can produce more than one payment attempt over time.
For example, a customer can retry a payment or switch gateways.
Treat the Shoppex invoice ID and event type as the durable business signal, not a single provider session.
Order webhooks can also include payment-context fields like
exchange_rate, crypto_exchange_rate, crypto_gateway, and apm_method.
These help with reconciliation and analytics without requiring a follow-up invoice fetch in common cases.Available Events
Common 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) |
Common Subscription Events
| Event | Description |
|---|---|
subscription:created | New subscription started |
subscription:cancelled | Subscription cancelled |
Shoppex supports more event names than the short guide tables above.
Examples:
order:created, order:updated, order:partial, order:disputed, subscription:trial:started, subscription:updated, subscription:renewed, subscription:upcoming, plus product/query/feedback/affiliate events.
Use Webhook Events Reference or GET /dev/v1/webhooks/events for the full current list.Verifying Webhooks
Always verify webhook signatures to ensure authenticity. Shoppex signs webhooks using HMAC-SHA512:{"event":"order:paid","data":{...},"created_at":1775764170}, not just the inner data object.
Use the per-webhook secret from Settings -> Webhooks for that endpoint.
Do not verify JSON.stringify(req.body) after parsing.
Verify the raw body bytes from the incoming HTTP request instead.
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:| Delivery | Delay |
|---|---|
| Initial attempt | Immediate |
| Retry 1 | 2 minutes |
| Retry 2 | 4 minutes |
| Retry 3 | 8 minutes |
| Retry 4 | 16 minutes |
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 delivery ID to deduplicate, and make your fulfillment logic idempotent.
Trust final Shoppex state
Trust final Shoppex state
A provider can have retries, delayed confirmations, or multiple attempts for one invoice.
Good example: mark an order fulfilled when Shoppex tells you the invoice is paid, not when you first see a provider-specific session ID.
Verify signatures
Verify signatures
Always verify webhook signatures in production to prevent spoofing.
Simple example: use the raw request body, not a parsed and re-serialized object.
Test with realistic payloads
Test with realistic payloads
Dashboard test deliveries now use the same webhook envelope and core order fields as live deliveries.
Simple example: a test
order:paid webhook includes fields like gateway, currency, total_display, and apm_method, not just a minimal placeholder object.Next Steps
Webhook Events Reference
Full list of all event types and payload schemas
Dynamic Delivery
Real-time product delivery via webhook response