Coupon and Promotion Codes
Apply discounts predictably instead of turning checkout into a loophole.
What it adds
Redeemable codes with eligibility rules, redemption limits, expiry, defined stacking behaviour, and an accurate discounted total before purchase.
What your agent is told to do
5
What your agent is told to do
5-
1
Validate every code on the server at redemption time against plan, customer, region, currency and remaining redemptions. A code checked only when it was typed can be redeemed after it expires.
-
2
Decide and enforce one stacking policy: codes combine, or the best one wins, or only one applies. Ambiguity here is how a plan ends up free.
-
3
Normalise codes on entry — trim and case-fold — so that a code copied out of an email works.
-
4
Show the actual discounted amount, the discount duration, and what the price becomes afterwards, before the user confirms. A percentage with no end date is not a price.
-
5
Do NOT enumerate valid codes through the validation endpoint. Rate-limit redemption attempts and keep the failure message the same shape for invalid and ineligible codes.
Edge cases it handles
6
Edge cases it handles
6- A first-time-customer code applied by a returning customer must be refused, including when they return under a second account with the same payment method.
- Two concurrent redemptions of a single-use code must not both succeed. Claim the redemption atomically.
- A percentage discount on one currency's plan is not the same as a fixed-amount discount converted between currencies. Refuse currency mismatches rather than converting.
- A code applied to a subscription that later changes plan may no longer be eligible. Define whether it survives the change and apply that consistently.
- Expiry means expiry of eligibility to redeem, not of the discount already granted. Keep those two clocks separate.
- Discounts interact with tax and proration. The displayed total must come from the same source that produces the invoice, not a local subtraction.
Definition of done
8
Definition of done
8- Every code is validated server-side at the moment of redemption.
- The stacking policy is defined in one place and cannot be bypassed by applying codes in a different order.
- Codes are matched case-insensitively with surrounding whitespace ignored.
- Single-use and limited-redemption codes cannot be over-redeemed under concurrent requests.
- The discounted total, discount duration, and post-discount price are shown before purchase.
- Invalid and ineligible codes produce indistinguishable responses and are rate-limited.
- The feature matches the existing design system.
- No existing functionality is broken.
Related features
Usage Limits
Usage Limits
Cap what free accounts can do — visibly and fairly.
What it does
Per-plan usage limits, enforced server-side, with the user always able to see where they stand.
How it works
- 1 Define limits per plan in one place. Do not scatter magic numbers through the codebase.
- 2 Enforce on the server at the point of creation. A client-side check is decoration.
- 3 Show current usage BEFORE the user hits the wall — surprise limits feel like a bug.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/usage-limits
Upgrade Modal
Upgrade Modal
Sell the upgrade at the exact moment someone wants it.
What it does
A focused upsell that appears when a free user reaches for a paid capability.
How it works
- 1 Trigger it at the point of intent — when they click the locked thing — not on a timer or on page load.
- 2 Name the specific feature they just tried to use. A generic pricing modal converts far worse.
- 3 State the price plainly and give one button to upgrade.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/upgrade-modal
Billing Portal
Billing Portal
Let people manage their own subscription.
What it does
A billing area where users can see their plan, change payment method, get invoices, and cancel.
How it works
- 1 Use the payment provider's hosted billing portal if it has one. Do not rebuild card management — it's a PCI liability you don't need.
- 2 Show the current plan, renewal date, and payment method on your own account page.
- 3 Make cancelling possible without emailing support. Dark patterns here generate chargebacks.
Copy the prompt
No account needed
Add this feature to my app:
https://addthisfeature.com/x/billing-portal
How it works
-
1
Copy the link
Grab the Markdown instruction URL for this feature.
-
2
Give it to your AI
Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.
-
3
It inspects, then implements
Your agent reads your existing app first, then adds the feature to fit it.
Works with your stack
These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.
Need it tighter than that? Customize the feature and tell it exactly what you're running.