Onboarding uses saved payment methods and direct subscription creation. Stripe Checkout is not used for subscriptions.
Onboarding Subscription Flow
- The owner selects internal, external, or both channels.
- The billing-profile step saves invoice details such as company name, VAT number, fiscal code, SDI code, PEC email, contact details, and address.
- The payment step creates or reuses a Stripe customer through
/api/payment-methods. - Stripe SetupIntent collects a saved payment method. Card and SEPA Direct Debit are supported.
/api/organizations/{organizationId}/subscribecreates or extends the subscription.- The organization is linked to the subscription through
organization_subscription_links. - 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:
| Step | Behavior |
|---|---|
| Customer | Requires a billing profile with stripeCustomerId. |
| Payment method | Uses the latest saved payment method and sets it as default. |
| VAT | Applies a non-inclusive Italian VAT tax rate from STRIPE_VAT_TAX_RATE_ID or creates one matching VAT_RATE. |
| Trial | Starts with TRIAL_PERIOD_DAYS, currently 14 days. A valid discount code can override trial days. |
| Items | Adds one base item and one metered item per enabled channel. |
| Discount | Attaches the Stripe promotion code when the submitted discount validates. |
| Local record | Creates 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 state | Stripe behavior |
|---|---|
| Price not present yet | Adds a new subscription item. |
| Flat base price already present | Increments item quantity. |
| Metered price already present | Reuses 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.