Configure webhooks to receive real-time notifications about orders, subscriptions, payments, and other critical events in your store.Overview#
Webhooks allow Techrar to push event notifications to your server in real-time. Instead of polling our APIs for status changes, we'll send HTTP POST requests to your configured endpoint whenever important events occur.Setup Methods#
You can register webhooks in two ways:1.
Via Portal (Recommended for quick setup)
Register Webhook via Portal#
1.
Log in to your Techrar merchant portal
2.
Navigate to Settings → Webhooks
4.
URL: Your endpoint that will receive webhook notifications
Events: Select which events to subscribe to
Custom Headers: Add optional headers (e.g., authentication tokens)
Active Status: Enable or disable the webhook
5.
Save and copy your Secret Key (used for signature verification)
List of techrar Meals Events#
Webhook Payload Structure#
All webhook requests include:{
"app_id": 123,
"timestamp": 1640000000,
"event": "subscription.created",
"data": {
}
}
Signature Verification#
Every webhook request includes an X-Signature header for security verification.Verify Signature#
Always verify signatures before processing webhook data to ensure the request is from Techrar.
Handling Webhooks#
Best Practices#
1.
Respond Quickly: Return 200 OK immediately, then process asynchronously
2.
Verify Signatures: Always validate the X-Signature header
3.
Handle Idempotency: Use event IDs to prevent duplicate processing
4.
Implement Retry Logic: We retry failed webhooks with exponential backoff
5.
Log Everything: Keep webhook logs for debugging and auditing
Retry Policy (Coming Soon)#
If your endpoint returns a non-2xx status or times out:Attempt 1: Immediate retry
Attempt 2: 1 minute later
Attempt 3: 5 minutes later
After 3 failed attempts, the webhook is marked as failed and will not be retried automatically.We currently send a webhook notification only once. We are working on a retry logic.
Monitoring & Logs#
View Webhook Logs#
Access webhook delivery logs via Portal -> Settings → Webhooks → View LogsDelivery status (success/failed/pending)
Duplicate Events#
Use event timestamps and IDs to detect duplicates
Implement idempotency keys in your processing logic
Store processed event IDs to skip duplicates