What are Webhooks?
Webhooks are HTTP callbacks that Zupy sends to your server when specific events occur in the loyalty program. Instead of continuously polling our API for changes, webhooks deliver real-time notifications about customer activities, point transactions, coupon usage, and tier changes directly to your application.How Webhooks Work
1
Event Occurs
A customer action triggers an event (e.g., customer registers, earns points, redeems coupon)
2
Webhook Triggered
Zupy prepares the event payload with relevant customer and transaction data
3
HTTP Request Sent
Zupy sends a POST request to your configured webhook URL
4
Response Expected
Your endpoint should respond with HTTP 200 to confirm receipt
5
Retry Logic
Failed deliveries are retried with exponential backoff up to 5 times
Available Webhook Events
Zupy supports the following webhook events that you can configure in your company admin panel:Customer Events
customer.registered
Triggered when a new customer joins the loyalty program
- Use cases: Welcome email sequences, onboarding automation, CRM integration
- Payload includes: Customer profile, tier assignment, welcome reward details
tier.upgraded
Triggered when a customer advances to a higher loyalty tier
- Use cases: Congratulatory messages, tier benefit notifications, VIP treatment
- Payload includes: Previous tier, new tier, qualification metrics
Transaction Events
points.earned
Triggered when a customer earns points from a transaction
- Use cases: Transaction confirmations, progress notifications, gamification
- Payload includes: Points earned, new balance, transaction details, next tier progress
Coupon Events
coupon.redeemed
Triggered when a customer converts points into a coupon
- Use cases: Coupon delivery, inventory management, redemption analytics
- Payload includes: Coupon code, reward details, points spent, expiration date
coupon.used
Triggered when a customer actually uses a coupon at your business
- Use cases: Inventory updates, sales analytics, customer behavior tracking
- Payload includes: Usage location, staff member, order details, discount applied
Webhook Configuration
Setting up Webhook URLs
Configure your webhook endpoints in the Zupy admin panel:- Navigate to Settings > Webhooks
- Enter your endpoint URL (must be HTTPS)
- Select which events you want to receive
- Configure authentication (optional but recommended)
- Test the connection with a sample payload
Endpoint Requirements
Your webhook endpoint must meet these requirements:Security Best Practices
Signature Verification
Always verify webhook signatures to ensure requests are from Zupy:1
Get Signature
Extract the
X-Zupy-Signature header from the request2
Compute HMAC
Create HMAC-SHA256 hash of the payload using your webhook secret
3
Compare
Use constant-time comparison to match signatures
4
Reject Invalid
Return 401 for requests with invalid signatures
Additional Security Measures
HTTPS Only
HTTPS Only
Configure webhook URLs with HTTPS to encrypt data in transit. Zupy rejects HTTP webhook URLs in production.
IP Allowlist
IP Allowlist
Restrict webhook endpoint access to Zupy’s IP ranges:
52.44.102.0/24(Primary)18.208.0.0/16(Backup)
Idempotency
Idempotency
Handle duplicate webhooks gracefully by implementing idempotency keys based on event ID and timestamp.
Timeout Handling
Timeout Handling
Respond to webhooks within 10 seconds to avoid timeouts and retries.
Webhook Delivery and Retries
Delivery Guarantees
- At-least-once delivery: You may receive duplicate webhooks
- Best-effort ordering: Events are delivered in approximate order
- 5 retry attempts: Failed deliveries are retried with exponential backoff
- 10-second timeout: Your endpoint must respond within 10 seconds
Retry Schedule
| Attempt | Delay | Total Time |
|---|---|---|
| 1st | Immediate | 0s |
| 2nd | 1 minute | 1m |
| 3rd | 5 minutes | 6m |
| 4th | 15 minutes | 21m |
| 5th | 1 hour | 1h 21m |
Response Codes
| Code | Behavior |
|---|---|
200-299 | Success - no retry |
300-399 | Redirect - follow once, then retry |
400-499 | Client error - no retry (except 408, 429) |
500-599 | Server error - retry with backoff |
Timeout | No response - retry with backoff |
Testing Webhooks
Using Webhook Testing Tools
- ngrok (Local Development)
- RequestBin (Quick Testing)
- Webhook.site (Simple Testing)
Manual Testing in Admin Panel
- Go to Settings > Webhooks
- Click Test Webhook next to your configured endpoint
- Select an event type to simulate
- Review the response and timing
- Check your server logs for received payload
Common Integration Patterns
Customer Relationship Management (CRM)
Marketing Automation
Inventory Management
Troubleshooting
Common Issues
Webhooks Not Received
Webhooks Not Received
Possible Causes:
- Endpoint not reachable (check firewall, DNS)
- HTTPS certificate issues
- Server returning non-200 status codes
- Request timeout (response takes > 10s)
- Test endpoint with curl or Postman
- Check server logs for webhook requests
- Verify SSL certificate validity
- Optimize endpoint response time
Duplicate Webhooks
Duplicate Webhooks
Cause: Network issues or server errors can trigger retriesSolution: Implement idempotency using event ID + timestamp
Signature Verification Fails
Signature Verification Fails
Possible Causes:
- Wrong webhook secret
- Payload modification (proxies, middleware)
- Character encoding issues
- Verify webhook secret in admin panel
- Check raw payload before JSON parsing
- Ensure UTF-8 encoding
Debug Mode
Enable debug mode in webhook settings to receive detailed delivery logs:- Request/response headers
- Payload content
- Response time and status
- Retry attempts and outcomes
- Error messages and stack traces
Rate Limits and Monitoring
Webhook Limits
- Maximum endpoints per company: 10
- Maximum events per endpoint: All available events
- Delivery rate: Up to 100 webhooks/minute per endpoint
- Payload size: Maximum 1MB per webhook
Monitoring Webhook Health
Track these metrics to ensure reliable webhook processing:Success Rate
Monitor the percentage of successful deliveries (HTTP 200 responses)
Response Time
Track average response time to optimize performance
Error Rate
Monitor failed deliveries and common error patterns
Retry Frequency
Track how often webhooks require retries