Reward Discounts: End-to-End Setup
Step-by-step guide to reward subscribers with billing discounts for feedback and feature ideas
Reward discounts close the feedback loop by giving subscribers a discount when they provide valuable feedback or ideas. This guide walks through the complete setup — from connecting your billing provider to the moment a subscriber sees a discount on their next invoice.
You need at least one billing provider connected to your project (Stripe or Polar) and subscribers with active subscriptions before discounts can be created or applied.
Prerequisites
- A SeggWat project with feedback collection enabled
- A Stripe or Polar account with active subscriber subscriptions
- Access to your application's backend (for portal auth, Path B only)
Step 1: Connect Your Billing Provider
Navigate to your project, open Integrations in the sidebar, and click the card for your billing provider.
Stripe
You need a restricted API key so SeggWat can create coupons and apply them to subscriptions. A full secret key works too, but a restricted key limits SeggWat's access to only the operations it needs.
- In your Stripe Dashboard, go to Developers → API keys
- Click Create restricted key
- Give it a name such as "SeggWat Discount API Key" and set these permissions:
- Coupons → Write
- Promotion codes → Write
- Subscriptions → Write (required for auto-applying discounts)
- Click Create key and copy the generated key
- Back in SeggWat, open the Stripe integration modal and scroll to Discount API Key
- Paste the key and click Save API Key — SeggWat validates it immediately
Always use a restricted key rather than your full secret key. SeggWat only needs the three permissions listed above and will never read your billing or customer data.
Polar
- In your Polar Dashboard, go to Settings → Access Tokens
- Click Create Token, give it a name such as "SeggWat Discounts", and set these scopes:
discounts:writesubscriptions:write(required for auto-applying discounts)
- Click Create and copy the generated token
- In SeggWat, open the Polar integration modal and scroll to Access Token
- Paste the token and click Save Token
For full webhook setup instructions (churn tracking, signing secrets), see the dedicated provider guides:
Step 2: Pass the Subscription ID
SeggWat needs to know a subscriber's billing subscription ID before a discount can be applied to their account. There are two paths depending on where feedback is collected.
Path A: Feedback Widget
Add the seggwat-feedback.js widget to your page, then call setSubscriptionId() once the user is authenticated in your app:
<script src="https://seggwat.com/static/widgets/v1/seggwat-feedback.js"
data-project-key="your-project-key"></script>
<script>
// Call after authentication — pass the subscriber's Stripe or Polar subscription ID
SeggwatFeedback.setSubscriptionId('sub_1abc...');
</script>When a subscription ID is set, the feedback modal shows a "Get a discount on future bills" consent checkbox. If the user checks it and submits, SeggWat stores the subscription ID and consent timestamp alongside the feedback item.
The consent checkbox only appears when a subscription ID is set. Visitors who are not subscribers see the standard feedback form.
Path B: Ideas Portal with Auth Token
The feature portal can carry the subscription ID automatically through the authentication token — no extra call required from the subscriber.
1. Enable end-user authentication on your project
- Open Project Settings in the SeggWat dashboard
- Find the End-User Authentication section
- Select HMAC Signed or JWT (HS256)
- Click Generate Secret and copy the signing secret immediately
The signing secret is only shown once. Store it in your backend environment variables right away. End-user authentication must be set to HMAC or JWT — if it is set to None, tokens are ignored entirely and the subscription ID will not be captured with portal submissions.
2. Include subscription_id in the token payload
Generate tokens server-side when a subscriber visits your portal page:
const crypto = require('crypto');
function generateSeggwatToken(userId, userEmail, projectKey, signingSecret, subscriptionId = null) {
const payload = JSON.stringify({
sub: userId,
email: userEmail,
...(subscriptionId && { subscription_id: subscriptionId }),
exp: Math.floor(Date.now() / 1000) + 3600, // 1 hour expiry
iat: Math.floor(Date.now() / 1000),
project_key: projectKey
});
const signature = crypto
.createHmac('sha256', signingSecret)
.update(payload)
.digest('base64url');
const encodedPayload = Buffer.from(payload).toString('base64url');
return `${encodedPayload}.${signature}`;
}
// Usage — subscription_id is the key ingredient
const token = generateSeggwatToken(
user.id,
user.email,
process.env.SEGGWAT_PROJECT_KEY,
process.env.SEGGWAT_SIGNING_SECRET,
user.subscriptionId // Stripe: 'sub_1abc...' — Polar: 'pol_sub_1abc...'
);3. Pass the token to the portal URL
// Server-side: generate a fresh token for each page load
app.get('/features', (req, res) => {
const token = generateSeggwatToken(
req.user.id,
req.user.email,
process.env.SEGGWAT_PROJECT_KEY,
process.env.SEGGWAT_SIGNING_SECRET,
req.user.subscriptionId
);
res.render('features', {
portalUrl: `https://seggwat.com/p/${process.env.SEGGWAT_PROJECT_KEY}?token=${token}&embed=true`
});
});When the subscription ID is present in a valid token, consent is implied — the ID is stored automatically with any idea the subscriber suggests through the portal.
Step 3: Subscriber Submits Feedback or an Idea
Once the integration is in place, collection happens automatically.
Widget path: The subscriber fills in the feedback form, checks the discount consent checkbox, and clicks Submit. SeggWat stores the message, subscription ID, and consent timestamp together.
Portal path: The subscriber suggests an idea through the portal. The subscription ID is extracted from the signed token — no separate opt-in is needed.
In both cases, the feedback or idea item in your dashboard will show the subscriber's subscription ID, making it eligible for a discount.
Step 4: Review and Create the Discount
- Open any feedback item or feature idea in the SeggWat dashboard
- Scroll to the Reward with Discount section
The Reward with Discount section only appears when a billing provider is configured on the project and a subscription ID is present on the item. If you do not see it, check the troubleshooting section below.
- Configure the discount:
| Field | Description |
|---|---|
| Name | Internal label for the coupon — not shown to the subscriber |
| Percentage Off | Discount amount from 1% to 100% |
| Duration | Once, Forever, or Repeating (set number of months for repeating) |
| Custom Code | Optional promo code string; auto-generated if left empty |
| Max Redemptions | Limit how many times the code can be redeemed |
- Choose how to issue the discount:
- Create & Apply Discount — automatically applies the coupon to the subscriber's billing account. The discount takes effect on their next billing cycle. Requires a subscription ID on the item.
- Create Discount — generates a redeemable promo code that you can share with the subscriber manually. Works even without a subscription ID.
Step 5: Subscriber Receives the Reward
If auto-applied: The discount appears on the subscriber's next invoice automatically. No action is needed from them — they will see the reduced amount at their next billing date.
If promo code: Share the generated code with the subscriber (via email, in-app message, or your support tool). They redeem it at checkout or in their billing portal.
The auto-apply path (Create & Apply Discount) provides the best experience because the subscriber receives the reward with no friction. Use the promo code path when you prefer to communicate the reward personally or when the subscription ID was not captured.
Troubleshooting
Next Steps
Stripe Integration
Full Stripe setup — restricted keys, coupons, promo codes, and webhook configuration
Polar Integration
Full Polar setup — access tokens, scopes, and discount auto-apply
Portal Authentication
Complete guide to signed tokens, HMAC vs JWT, and secure portal embedding
Reward Discounts Overview
Conceptual overview and flow diagram for the reward discounts feature
