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:

  1. Dashboard → Your App → Settings
  2. Copy webhook secret (shown once)
  3. Add to RevenueCat webhook configuration
  4. 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

  1. Verify: Check webhook signature
  2. Parse: Extract event data
  3. Attribute: Find referral code in subscriber_attributes
  4. Match: Find campaign and influencer
  5. Calculate: Compute commission and platform fee
  6. Record: Create/update conversion
  7. Update: Affiliate and campaign stats
  8. Reserve: Funds from wallet
  9. Respond: 200 OK (prevents retries)

Processing Time

  • Average: 100-200ms
  • Timeout: 30 seconds
  • Async processing for complex calculations

Webhook Response Codes

CodeMeaningRetry?
200Processed successfullyNo
400Invalid payloadNo
401Invalid webhook secretNo
404App not foundNo
500Server errorYes

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 purchase

Affiliate not found

Error: "Affiliate not found for code: FITGURU30"
Cause: Code doesn't exist or campaign inactive
Fix: Check campaign status in dashboard

Insufficient wallet balance

Error: "Insufficient balance"
Cause: Wallet balance too low
Fix: Add funds to wallet

Webhook 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.

Next Steps

  1. Test your webhook integration
  2. Troubleshooting guide