Add Stripe Coupon
Learn how to create discount codes and promotional coupons in Stripe for Plainform
Learn how to create discount codes and promotional coupons in Stripe for Plainform.
Goal
By the end of this recipe, you'll have created discount coupons that customers can use at checkout.
Prerequisites
- Stripe account set up
- At least one active product in Stripe
- Access to Stripe Dashboard
Steps
Create Coupon in Stripe Dashboard
Navigate to Stripe Dashboard:
https://dashboard.stripe.com/couponsClick "Create coupon" and configure:
Coupon Details:
- Name: Internal name (e.g., "Launch Week Discount")
- ID: Coupon code customers will use (e.g.,
LAUNCH50) - Type: Percentage off or Fixed amount
Discount Amount:
- Percentage: 10%, 25%, 50%, etc.
- Fixed amount: $10, $20, etc. (specify currency)
Use memorable, easy-to-type coupon codes. Avoid special characters and keep them short (e.g., SAVE20, WELCOME, EARLYBIRD).
Set Coupon Duration
Choose how long the discount applies:
Once:
- Applies to first payment only
- Good for: One-time purchases, first month discounts
Forever:
- Applies to all future payments
- Good for: Lifetime discounts, special partnerships
Repeating:
- Applies for a specific number of months
- Good for: Limited-time subscription discounts
- Example: 3 months, 6 months, 12 months
Configure Coupon Restrictions (Optional)
Redemption Limits:
- Max redemptions: Total times coupon can be used
- First-time customers only: Restrict to new customers
Expiration:
- Set expiration date for time-limited promotions
- Leave blank for coupons that don't expire
Product Restrictions:
- Apply to specific products only
- Or allow for all products
Feature Coupon on Pricing Page
To display a coupon on your pricing page, add metadata:
- In Stripe Dashboard, edit your coupon
- Scroll to "Metadata" section
- Add this key-value pair:
isFeatured: trueThe app will automatically fetch and display featured coupons on the pricing page.
Important: When a featured coupon is active, customers cannot enter additional promotion codes at checkout. Only one discount can be applied per transaction.
Test Coupon
Start your development server:
npm run devTest the coupon:
- Navigate to pricing page
- Click "Get Started" on a product
- Enter coupon code at checkout
- Verify discount is applied correctly
Use Stripe test mode for development. Test coupons work the same as live coupons.
Coupon Display
The app fetches featured coupons from:
GET /api/stripe/couponsFeatured coupons appear on the pricing page with:
- Discount amount
- Coupon code
- Expiration date (if set)
Common Issues
Coupon Not Showing on Pricing Page
- Verify
isFeatured: trueis set in coupon metadata - Check that the coupon is active (not expired or redeemed)
- Ensure the coupon hasn't reached max redemptions
- Restart your dev server after creating coupons
Coupon Code Not Working at Checkout
- Confirm the coupon ID matches exactly (case-sensitive)
- Check that the coupon hasn't expired
- Verify the coupon applies to the selected product
- Ensure max redemptions hasn't been reached
Discount Amount Incorrect
- Verify the discount type (percentage vs. fixed amount)
- Check currency for fixed amount coupons
- Confirm duration settings (once, forever, repeating)
Best Practices
Coupon Strategy:
- Use percentage discounts for flexibility across products
- Limit redemptions for exclusive offers
- Track coupon performance in Stripe Dashboard
Naming Conventions:
- Use clear, memorable codes
- Avoid ambiguous characters (0 vs O, 1 vs I)
- Keep codes short (6-10 characters)
- Use uppercase for consistency
Next Steps
- Add Product - Create products to apply coupons to
- Create Subscription - Set up recurring billing with coupons
- Test Payments Locally - Test coupon redemption
How is this guide ?
Last updated on