Stripe Webhook Issues
Stripe webhooks notify AffiliateBase about payment events. If webhooks aren’t working, conversions won’t track. This guide helps diagnose and fix webhook issues.
How Webhooks Work
Customer pays → Stripe processes → Webhook fires →
AffiliateBase receives → Conversion created
Key affiliate-attribution events:
payment_intent.succeededinvoice.paid/invoice.payment_succeededcheckout.session.completed/checkout.session.async_payment_succeededrefund.updated/charge.refundedcharge.dispute.created,charge.dispute.updated, andcharge.dispute.closed
Checking Webhook Status
In Stripe Dashboard
- Go to Stripe Dashboard
- Navigate to Developers → Webhooks
- Find the AffiliateBase endpoint
- Check status and recent deliveries
Webhook Health Indicators
| Status | Meaning |
|---|---|
| Enabled | Webhook is active |
| Disabled | Webhook turned off |
| Failing | Recent delivery failures |
Recent Attempts
Click on the endpoint to see:
- Recent delivery attempts
- Success/failure status
- Response codes
- Payload details
Common Issues & Solutions
Issue: Webhook Endpoint Not Found
Symptom: No AffiliateBase webhook in Stripe.
Cause: Stripe connection incomplete or disconnected.
Solution:
- Go to AffiliateBase Settings → General
- Check Stripe connection status
- Click Reconnect Stripe if needed
- Complete the authorization flow
- Webhook should be auto-created
Issue: Webhook Deliveries Failing (4xx/5xx)
Symptom: Webhook attempts show error codes.
Error codes:
| Code | Meaning | Solution |
|---|---|---|
| 400 | Bad request | Contact support - may be payload issue |
| 401 | Unauthorized | Reconnect Stripe to refresh auth |
| 404 | Not found | Endpoint URL changed - reconnect Stripe |
| 500 | Server error | Temporary issue - will retry automatically |
| 502/503 | Service unavailable | AffiliateBase may be down - check status |
General solution:
- Check AffiliateBase service status
- Try reconnecting Stripe
- Resend failed webhooks
- Contact support if persists
Issue: Webhooks Not Firing
Symptom: No webhook attempts in Stripe for purchases.
Causes:
- Wrong events configured
- Test mode vs live mode mismatch
- Webhook disabled
Solutions:
-
Check event types:
- Click webhook endpoint
- Verify the affiliate-attribution events above are included
- Reconnect Stripe in AffiliateBase if the managed endpoint is missing required events
-
Check mode:
- Ensure webhook matches your mode (test/live)
- Test mode purchases → test webhook
- Live mode purchases → live webhook
-
Verify webhook is enabled:
- Endpoint should show “Enabled”
- Re-enable if disabled
Issue: Webhook Signature Verification Failed
Symptom: 401 errors mentioning signature.
Cause: Signing secret mismatch.
Solution:
- Reconnect Stripe in AffiliateBase
- This refreshes the signing secret
- Webhook signature should verify again
Issue: Events Received but Conversions Not Created
Symptom: Webhooks show 200 success but no conversions appear.
Causes:
client_reference_idmissing from checkoutclient_reference_idcontains a public?vialink token instead of the generated referral ID- Referral not found
- Attribution window expired
Solutions:
-
Check the webhook payload:
- Click on a delivered event
- Look at the payload
- Find
client_reference_idfield
-
If
client_reference_idis empty:- Review your checkout code
- Ensure referral passed to Stripe
-
If
client_reference_idstarts withref_orsetup_:- Your checkout is sending the public affiliate link token from
?via - Stripe needs the generated AffiliateBase referral ID created by the tracking script
- For Payment Links, remove custom code that copies
?viainto Stripe and let the AffiliateBase script update the link - For backend-created Checkout Sessions, submit the generated
referral_idfrom the browser to your server, then set Stripeclient_reference_id
- Your checkout is sending the public affiliate link token from
-
If
client_reference_idexists and does not start withref_orsetup_:- Check if that referral exists in AffiliateBase
- Verify attribution window hasn’t expired
Webhook Endpoint Details
Expected Endpoint Format
https://app.affiliatebase.io/api/stripe/webhook
Required Events
AffiliateBase needs these events:
payment_intent.succeededinvoice.paidinvoice.payment_succeededcheckout.session.completedcheckout.session.async_payment_succeededrefund.updatedcharge.refundedcharge.dispute.createdcharge.dispute.updatedcharge.dispute.closed
AffiliateBase also uses separate billing and Stripe app lifecycle webhook endpoints for plan billing and Stripe app authorization events. Do not mix those with the merchant affiliate-events endpoint.
Testing Webhooks
Send Test Event
In Stripe Dashboard:
- Go to webhook endpoint
- Click Send test webhook
- Select event type (e.g.,
invoice.paid) - Click Send test event
- Check response
Test with Real Payment
- Use Stripe test mode
- Make a test purchase
- Verify webhook fires
- Check AffiliateBase for conversion
Webhook Logs
View detailed logs:
- Click on a webhook attempt
- See request/response details
- View full payload
- Check timing information
Resending Failed Webhooks
Individual Event
- Find the failed event
- Click Resend
- Monitor for success
Bulk Resend
For multiple failures:
- Use Stripe CLI:
stripe events resend - Or contact Stripe support for bulk replay
Webhook Security
Signature Verification
All webhooks are verified:
- Stripe signs each event
- AffiliateBase verifies signature
- Prevents forged events
Endpoint Security
- HTTPS only
- No authentication required (signature verifies)
- Rate limiting in place
Monitoring & Alerts
Stripe Alerts
Set up Stripe webhook alerts:
- Go to Developers → Webhooks
- Enable email notifications
- Get alerted on failures
Recommended Monitoring
- Check daily: Review webhook delivery status
- Alert on failures: Set up notifications
- Test regularly: Run test conversions weekly
Advanced Troubleshooting
Using Stripe CLI
Install Stripe CLI for local testing:
# Install
brew install stripe/stripe-cli/stripe
# Login
stripe login
# Forward webhooks to local
stripe listen --forward-to localhost:3000/api/stripe/webhook
# Trigger test events
stripe trigger checkout.session.completed
Viewing Raw Events
In Stripe Dashboard:
- Go to Developers → Events
- Find the event
- View full payload
- Check
data.objectfor details
Checking Event Processing
Look for in the event:
{
"data": {
"object": {
"client_reference_id": "your-referral-id",
"customer": "cus_xxxxx",
"amount_total": 9900
}
}
}
The value should be the generated AffiliateBase referral ID for that visitor. If it begins with ref_ or setup_, Stripe received the public affiliate link token instead, and AffiliateBase will not create an attributed conversion from that webhook.
When to Contact Support
Contact AffiliateBase support if:
- Webhooks consistently failing with 500 errors
- Conversions not creating despite successful webhooks
- Need webhook endpoint changed
- Signature verification issues persist
Contact Stripe support if:
- Can’t access webhook settings
- Events not appearing at all
- Need historical event replay
- API/dashboard issues
Prevention
Best Practices
- Don’t modify webhook URL manually - use reconnect flow
- Monitor regularly - check webhook health weekly
- Keep Stripe connected - reconnect if token expires
- Test after changes - verify webhooks work
Maintenance
- Reconnect Stripe periodically if issues arise
- Review webhook configuration after Stripe updates
- Reconnect Stripe from AffiliateBase if endpoint configuration drifts