Webhooks
Receive real-time notifications when events occur in your store.
Overview
Webhooks allow your applications to receive automatic notifications when:
- Orders are created or completed
- Payments succeed or fail
- Subscriptions are created or cancelled
- And more...
Setting Up Webhooks
Step 1: Create a Webhook Endpoint
- Go to Settings > Webhooks
- Click Add Webhook
- Enter your endpoint URL (must be HTTPS)
- Select events to receive
- Click Create
Step 2: Save Your Secret
After creation, you'll receive a webhook secret. Save this securely - you'll need it to verify webhook signatures.
Available Events
| Event | Description |
|---|---|
order.created | New order placed |
order.paid | Payment received |
order.completed | Order fulfilled |
order.refunded | Order refunded |
subscription.created | New subscription |
subscription.cancelled | Subscription cancelled |
subscription.renewed | Subscription renewed |
customer.created | New customer registered |
Webhook Payload
All webhooks include:
json
{
"event": "order.paid",
"timestamp": "2025-01-20T12:00:00Z",
"data": {
// Event-specific data
}
}Verifying Webhooks
Always verify webhook signatures to ensure they're from Pixlpay:
- Get the
X-Pixlpay-Signatureheader - Compute HMAC-SHA256 of the raw body using your secret
- Compare the signatures
See the Developer Docs for code examples.
Testing Webhooks
Send a test webhook:
- Go to Settings > Webhooks
- Click Test next to your webhook
- Check your endpoint received the payload
Delivery & Retries
- Webhooks timeout after 30 seconds
- Failed deliveries retry 3 times
- Retry intervals: 1 min, 5 min, 30 min
- View delivery logs in webhook settings
Best Practices
- Always verify signatures
- Respond with 200 status quickly
- Process webhooks asynchronously
- Handle duplicate deliveries (use event ID)
- Log all received webhooks for debugging
