Webhook Configuration
Secure webhook setup and verification
Webhook Overview
InfluTo receives subscription events via RevenueCat webhooks. This enables automatic commission calculation without any manual tracking.
Webhook URL
Your webhook endpoint:
https://influ.to/api/webhooks/revenuecat
# Or app-specific:
https://influ.to/api/webhooks/revenuecat/{app_id}Authentication
Webhook Secret
Each app has a unique webhook secret for security:
- Dashboard → Your App → Settings
- Copy webhook secret (shown once)
- Add to RevenueCat webhook configuration
- Format:
Bearer rc_webhook_abc123...
Security
- Webhook secret validates requests are from RevenueCat
- HTTPS required (all requests encrypted)
- IP whitelist (optional, for enterprise)
⚠️ Keep Secret Secure
Never commit webhook secrets to Git. If compromised, regenerate in dashboard and update RevenueCat immediately.
Supported Events
INITIAL_PURCHASE
First subscription purchase
- Creates new conversion
- Calculates initial commission
- Links to influencer via referral_code
RENEWAL
Recurring subscription payment
- Adds to existing conversion
- Calculates recurring commission
- Increments billing cycles
CANCELLATION
User cancels subscription
- Updates conversion status
- Stops future recurring commissions
- Doesn't affect already-earned commissions
PRODUCT_CHANGE
User upgrades/downgrades
- Updates conversion price
- Adjusts future commission amounts
- Maintains attribution
EXPIRATION
Subscription expires (non-payment)
- Marks conversion as churned
- Stops commission tracking
Webhook Processing
What InfluTo Does
- Verify: Check webhook signature
- Parse: Extract event data
- Attribute: Find referral code in subscriber_attributes
- Match: Find campaign and influencer
- Calculate: Compute commission and platform fee
- Record: Create/update conversion
- Update: Affiliate and campaign stats
- Reserve: Funds from wallet
- Respond: 200 OK (prevents retries)
Processing Time
- Average: 100-200ms
- Timeout: 30 seconds
- Async processing for complex calculations
Webhook Response Codes
| Code | Meaning | Retry? |
|---|---|---|
| 200 | Processed successfully | No |
| 400 | Invalid payload | No |
| 401 | Invalid webhook secret | No |
| 404 | App not found | No |
| 500 | Server error | Yes |
Idempotency
Duplicate Prevention
InfluTo handles duplicate webhooks safely:
- Each event has unique
event_timestamp_ms - Duplicate events return 200 OK but don't reprocess
- Prevents double-charging commissions
- Safe for RevenueCat's retry logic
Monitoring Webhooks
Dashboard Logs
Dashboard → Analytics → Webhook Logs shows:
- All received webhooks
- Processing status
- Error messages
- Response times
Common Errors
No referral code found
Error: "No referral code - organic purchase"
Cause: subscriber_attributes missing or empty
Fix: Verify SDK sets attributes before purchaseAffiliate not found
Error: "Affiliate not found for code: FITGURU30"
Cause: Code doesn't exist or campaign inactive
Fix: Check campaign status in dashboardInsufficient wallet balance
Error: "Insufficient balance"
Cause: Wallet balance too low
Fix: Add funds to walletWebhook Retries
RevenueCat Retry Schedule
- Immediate failure: Retry after 1 minute
- 2nd failure: Retry after 5 minutes
- 3rd failure: Retry after 30 minutes
- 4th failure: Retry after 2 hours
- 5th failure: Retry after 8 hours
- Final: Give up after 24 hours
InfluTo Handling
- Idempotent processing (safe to retry)
- Transient errors return 500 (triggers retry)
- Permanent errors return 400 (no retry)
Advanced: Custom Webhooks
Direct Webhook (No RevenueCat)
For advanced users not using RevenueCat:
POST https://influ.to/api/webhooks/purchase
Authorization: Bearer it_live_...
Content-Type: application/json
{
"transaction_id": "txn_123",
"app_user_id": "user_123",
"product_id": "premium_monthly",
"price": 9.99,
"currency": "USD",
"referral_code": "FITGURU30",
"platform": "ios"
}Contact hello@influ.to for custom webhook integration.