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.

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.

  1. In your Stripe Dashboard, go to DevelopersAPI keys
  2. Click Create restricted key
  3. 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)
  4. Click Create key and copy the generated key
  5. Back in SeggWat, open the Stripe integration modal and scroll to Discount API Key
  6. Paste the key and click Save API Key — SeggWat validates it immediately

Polar

  1. In your Polar Dashboard, go to SettingsAccess Tokens
  2. Click Create Token, give it a name such as "SeggWat Discounts", and set these scopes:
    • discounts:write
    • subscriptions:write (required for auto-applying discounts)
  3. Click Create and copy the generated token
  4. In SeggWat, open the Polar integration modal and scroll to Access Token
  5. 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:

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

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

  1. Open Project Settings in the SeggWat dashboard
  2. Find the End-User Authentication section
  3. Select HMAC Signed or JWT (HS256)
  4. Click Generate Secret and copy the signing secret immediately

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

javascript
// 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

  1. Open any feedback item or feature idea in the SeggWat dashboard
  2. Scroll to the Reward with Discount section
  1. 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
  1. 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.


Troubleshooting


Next Steps

Navigation