Onboarding uses saved payment methods and direct subscription creation. Stripe Checkout is not used for subscriptions.

Onboarding Subscription Flow

  1. The owner selects internal, external, or both channels.
  2. The billing-profile step saves invoice details such as company name, VAT number, fiscal code, SDI code, PEC email, contact details, and address.
  3. The payment step creates or reuses a Stripe customer through /api/payment-methods.
  4. Stripe SetupIntent collects a saved payment method. Card and SEPA Direct Debit are supported.
  5. /api/organizations/{organizationId}/subscribe creates or extends the subscription.
  6. The organization is linked to the subscription through organization_subscription_links.
  7. Stripe item IDs are stored on the organization so message usage can be reported against the correct channel items.

Stripe Lifecycle

The canonical billing lifecycle is checkout, subscription creation, successful invoice payment, portal update, and cancellation. Checkout means the saved-payment onboarding flow; it converges through Stripe webhooks before local subscription state is trusted.

New Subscription

For a first Pro subscription, the app:

StepBehavior
CustomerRequires a billing profile with stripeCustomerId.
Payment methodUses the latest saved payment method and sets it as default.
VATApplies a non-inclusive Italian VAT tax rate from STRIPE_VAT_TAX_RATE_ID or creates one matching VAT_RATE.
TrialStarts with TRIAL_PERIOD_DAYS, currently 14 days. A valid discount code can override trial days.
ItemsAdds one base item and one metered item per enabled channel.
DiscountAttaches the Stripe promotion code when the submitted discount validates.
Local recordCreates a subscriptions document with plan pro, monthly billing, amount in cents, period dates, trial dates, and the Stripe subscription snapshot.

Existing Subscription

When the owner already has an active, trialing, or past-due subscription, adding another assistant extends the same Stripe subscription:

Channel stateStripe behavior
Price not present yetAdds a new subscription item.
Flat base price already presentIncrements item quantity.
Metered price already presentReuses the existing metered item.

Stripe handles proration for newly added or changed items. The app records discount-code redemption after Stripe accepts the update.

Enterprise Accounts

Enterprise customers are billed outside Stripe channel items. Adding an assistant links it to the existing enterprise subscription record and skips payment-method checks, channel item creation, and per-assistant proration.