Stripe is already integrated. Paddle (`088cc201`) and BACHs.io (`fdc5303c`) are now independent payment providers. Numberless has a shared provider-aware billing architecture with one active provider for new checkout.
Objective
Build a Numberless-owned coupon system that works independently of Stripe, Paddle, or BACHs and applies correctly to the currently active payment provider.
Create once. Publish everywhere.
Create, adapt, schedule, and publish your social media content across multiple platforms from one simple workspace
Audit First
Audit the existing billing, plans, checkout, subscription, payment-provider abstraction, and Revenue Tracker architecture before implementation. Reuse existing systems and identify provider-specific coupon limitations before deciding how each provider should be handled.
Requirements
1. Admin can create, edit, activate, deactivate, and expire coupons.
2. Coupon fields:
- Coupon code
- Discount type: Percentage or Fixed Amount
- Discount value
- Currency for fixed discounts
- Applicable plan(s), including all plans
- Start date
- Expiration date
- Maximum total redemptions
- Maximum redemptions per customer
- Active/inactive status
- Campaign/reason
- Optional seasonal designation
3. Support different use cases:
- General coupons
- Plan-specific coupons
- Seasonal coupons
- Campaign/reason-specific coupons
4. Define clearly whether a coupon applies:
- To the initial purchase only
- To recurring billing
- Or for a defined duration where supported
5. Customer checkout must provide:
“Have a coupon code?”
[Enter code] [Apply]
6. When applied, show:
- Original price
- Discount
- Final amount
- Recurring amount where applicable
7. Validate coupons server-side.
Never trust the frontend for discount calculation.
8. Prevent:
- Expired coupons
- Inactive coupons
- Invalid codes
- Exceeded usage limits
- Exceeded customer limits
- Incorrect plan usage
- Double redemption
9. Coupon ownership must remain with Numberless, not with Stripe/Paddle/BACHs.
10. The active payment provider receives the validated discount through its supported billing mechanism. Do not create fake provider capabilities.
11. If Stripe, Paddle, or BACHs handles a particular coupon behavior differently, preserve the Numberless coupon as the source of truth and implement the provider-specific translation safely.
12. Existing subscriptions must not be unexpectedly modified when a coupon is created, edited, deactivated, or expired.
13. Integrate coupon/discount information into the existing billing and Revenue Tracker architecture where appropriate. Do not fabricate revenue.
14. Admin UI should be compact, professional, searchable, and easy to manage.
15. Do not implement referral/affiliate functionality in this phase.
Acceptance Criteria
- Admin can create and manage real coupons.
- Percentage and fixed-amount discounts work.
- Coupons can be restricted to specific plans.
- Seasonal/campaign/reason metadata is supported.
- Start/expiry and redemption limits work.
- Customer checkout can apply a valid coupon.
- Pricing and discount are calculated server-side and displayed correctly.
- Coupons work with whichever payment provider is currently active.
- Existing subscriptions are not accidentally changed.
- Stripe, Paddle, and BACHs remain independent.
- Provider-specific limitations are handled honestly.
- No duplicate billing architecture is created.
- Backend/frontend typecheck passes.
- Production build passes.
- Relevant coupon/billing verification passes.
- No new circular dependencies.
Commit the completed implementation and push it to `main`.

