Redemption Webhook
PromoStack automatically processes RevenueCat webhooks to confirm when referees redeem codes and subscribe.Webhook URL
Configure this URL in your RevenueCat dashboard:How It Works
1
Referee Subscribes
User redeems promo code in App Store/Play Store and subscribes
2
RevenueCat Sends Webhook
RevenueCat fires webhook with subscription event
3
PromoStack Matches User
PromoStack finds code by
app_user_id (matches redeemed_by_uid)4
Confirm Redemption
Updates code status to
redeemed_confirmed and referral event to redeemed5
Check Threshold
Checks if referrer reached reward threshold and creates reward if needed
Expected Payload
PromoStack expects the following fields from RevenueCat:Required Fields
| Field | Description |
|---|---|
app_user_id | Must match the referee_uid used in /referee-redeem |
event.type | Subscription event type (e.g., INITIAL_PURCHASE) |
Matching Logic
Primary Match (Metacode Flow)
PromoStack matches byapp_user_id:
/referee-redeem sets redeemed_by_uid when the metacode is redeemed.
Fallback Match (Legacy)
If primary match fails, PromoStack tries matching by code value (for backward compatibility).RevenueCat Configuration
1. Add Webhook URL
1. Add Webhook URL
In RevenueCat dashboard:
- Go to Project Settings → Integrations
- Add webhook URL:
https://api.promostack.app/webhooks-redeem - Add custom header:
- Key:
x-api-key - Value:
YOUR_API_KEY
- Key:
- Select events:
INITIAL_PURCHASE,RENEWAL,CANCELLATION
2. Configure App User ID
2. Configure App User ID
Ensure your app sets the same user ID in both PromoStack and RevenueCat:
3. Test Webhook
3. Test Webhook
Use RevenueCat’s webhook testing tool to send a test event and verify PromoStack receives it.
Webhook Response
PromoStack returns a success response:Error Handling
Code Not Found
If no matching code is found:- User didn’t redeem metacode via
/referee-redeemfirst app_user_iddoesn’t matchreferee_uid- Code was already confirmed
Idempotency
PromoStack handles duplicate webhooks gracefully. If a webhook is sent multiple times, only the first one updates the code. Subsequent calls return the same success response.Monitoring
Track webhook processing in the PromoStack dashboard:- Webhook Logs: View all received webhooks
- Failed Webhooks: See webhooks that couldn’t be processed
- Attribution Rate: Monitor
code_assigned→redeemedconversion
Best Practices
Use the same user ID in PromoStack and RevenueCat (e.g., your app’s internal user ID)
Test webhook integration before going live
Monitor webhook logs for failed matches
Troubleshooting
Webhook Not Received
Webhook Not Received
- Check RevenueCat webhook configuration
- Verify webhook URL is correct
- Check RevenueCat webhook logs for delivery failures
Code Not Found Error
Code Not Found Error
- Verify user redeemed metacode via
/referee-redeemfirst - Check that
app_user_idmatchesreferee_uid - Ensure code hasn’t already been confirmed
Rewards Not Created
Rewards Not Created
- Check if referrer reached threshold (view in dashboard)
- Verify reward pool has available codes
- Check PromoStack logs for
check_and_create_rewarderrors
Security
RevenueCat webhooks should be verified using webhook signatures (coming soon). For now, PromoStack validates:- Request comes from RevenueCat IP ranges
- Payload structure matches expected format
- Code exists and belongs to your app
Webhook signature verification is available on Pro and Enterprise plans.

