Skip to main content

Flow

1

Validate

Verify plan and interval exist and are ACTIVE. Check no existing active subscription.
2

Create in Stripe

Create Stripe subscription with plan price. Create separate fee subscription if usage fees exist.
3

Apply Coupon

If coupon provided, validate availability and apply as SubscriptionCoupon synced with Stripe.
4

Create Locally

Save subscription with status ACTIVE, link to organization, plan, and interval.

Coupon Application

Coupons can be applied at creation time. The coupon is validated for:
  • Code existence and ACTIVE status
  • Not past redeemBy date
  • Not exceeding maxRedemptions
  • Matching currency