Plans and billing
What each Closeline plan includes, how a workspace pays per user, how the built-in test checkout works, and how to connect Stripe for real payments.
For the Full Stack package
The plans
Each workspace pays per user, its active members, on one of three plans, billed monthly or yearly. These are the template's sample prices, which you set yourself:
| Plan | Monthly, per user | Yearly, per user |
|---|---|---|
| Starter | $19 a month | $180 a year ($15 a month) |
| Team | $39 a month | $372 a year ($31 a month) |
| Scale | $69 a month | $660 a year ($55 a month) |
Every plan has the pipeline board with your own stages, contacts and companies, activities, projects, CSV import and export, the reports and invoices. The plans differ in four features, and the API enforces them:
| Feature | Starter | Team | Scale |
|---|---|---|---|
| The weighted forecast in the reports, the overview and the report's CSV | No | Yes | Yes |
| The AI assistant | No | Yes | Yes |
| Editing a role's permissions | No | Yes | Yes |
| Custom roles beyond Admin, Manager and Member | No | No | Yes |
A new workspace starts on a trial of the plan chosen on the website's pricing page (Starter when none was chosen), 14 days by default. The trial length is the API's platform setting trial_days.
A workspace has the features of its plan in every billing state: a trial has those of the plan it chose, and a past-due or canceled workspace keeps them. A move to a smaller plan deletes nothing: custom roles and their permissions keep working, and only creating and editing them is refused. The sample workspace, Studio Sales, is on Team, and so is the workspace yarn admin:create makes for your first account.
When the plan lacks a feature
The dashboard says so before anyone tries: where the plan lacks a feature, a notice names the plan that has it, such as "Custom roles are on the Scale plan.", with See plans in Billing for a role that sees billing and "An Admin can change the plan." for anyone else.
- On Starter, the AI assistant page shows the notice instead of the chat, and the overview's Forecast figure, the reports' Weighted forecast tile and a member's forecast show it in place of the figure.
- On Starter, the role permission matrix is read-only under the notice; on Starter and Team, the notice takes the place of New role.
- The API refuses the same requests with
403and the codeplan_upgrade_required, so a request sent another way meets the same limit.
The Billing tab
Billing is a tab of the dashboard's Settings: the plan and its status, the trial days left, the users, the next charge, what the plan includes and what the next plan adds, and the invoices, each a PDF. The Admin manages it, the Manager reads it, and the Member has no Billing tab.
| Status | Meaning |
|---|---|
| Trialing | On the free trial. |
| Active | Paid for the current period. |
| Canceling | Canceled, running until the end of the period it paid for, then Canceled. Resume takes it back. |
| Past due | The trial ended unpaid, or a renewal failed. Everything keeps working; after the grace days the workspace cannot invite people. |
| Canceled | Ended. Choose a plan to pay again. |
- Choose a plan pays for the first time, during or after the trial, or after a cancellation, for every user.
- Change plan previews the move first. A larger plan, or monthly to yearly on the same plan, is charged now for the difference over what is left of the period (Pay and change with Stripe). A smaller plan, or yearly to monthly, waits for the renewal (Change at renewal), and Keep <plan> takes it back.
- People who join part-way through a period are charged for the rest of it; people who leave lower the next renewal and credit nothing.
- A past-due or ended trial mails the workspace's Admins. Nothing is ever deleted for an unpaid plan.
The built-in test checkout
With no payment account, every plan is paid for in the test checkout: a page of the dashboard, /dashboard/settings/checkout/<session>, with Complete test payment and Cancel and no card fields. It charges nobody, and each payment issues an invoice that downloads as a PDF. Renewals in the test checkout are settled by the API on its own, hourly and whenever the workspace is read.
It is what runs until you add a Stripe key, and BILLING_PROVIDER=simulator keeps it even with one.
Connect Stripe
Add your secret key
From the Stripe dashboard's API keys page, put the secret key in the API's
.env. Use a test key (sk_test_...) until you are ready to take real money: it moves none. Each plan's Stripe price is created the first time it is needed, so nothing is set up in Stripe first.The API's .envSTRIPE_SECRET_KEY=sk_test_...Subscribe the webhook
In Stripe, add a webhook endpoint at your API's address followed by
/api/billing/webhooks/stripe, with the eventscheckout.session.completed,invoice.paid,invoice.payment_failedandcustomer.subscription.deleted. Copy its signing secret into the API's.env.The API's .envSTRIPE_WEBHOOK_SECRET=whsec_...Restart the API
Expected result: Choose a plan on the Billing tab opens Stripe's hosted checkout, and returns to the Billing tab, which confirms the payment before it shows the new plan.
- On Stripe's test page, pay with the card
4242 4242 4242 4242, any future date and any CVC. - On your own computer Stripe cannot reach the webhook. The Billing tab asks Stripe about the payment when the buyer comes back, so a test payment still completes; renewals and failed payments need the webhook, on a server.
- With Stripe, a move to a larger plan is charged to the card on file at once, a smaller one is scheduled for the renewal, and Manage payment method opens Stripe's customer portal.
- Stripe's events are applied once each, and a signed request that fails the check is refused.
- The Stripe product of each plan is named after the
site_nameplatform setting, such asCloseline Team (monthly, per user). One made before a rename keeps its old name until you rename it in Stripe.
An unpaid workspace
A workspace whose trial ended unpaid, or whose renewal failed, becomes past due, and its Admins are mailed. Reads and writes keep working. After BILLING_GRACE_DAYS (7 by default) it cannot invite people until a plan is paid; the Billing tab says until when people can still be invited.
Change the prices
The prices live in two places, kept equal. back-end/src/modules/billing/constants/plans.constants.ts is what the API charges, in cents per user (monthlyCents for a month, yearlyCents for a year); the dashboard reads them from the API. website/src/config/plans.ts is what the website shows, in whole dollars per user per month. Change both together.
The plans' names and feature lines on the website are messages in website/messages/pricing/. The comparison on the pricing page, COMPARISON_ROWS in website/src/config/plans.ts, opens with each plan's price per user, then shows each feature against the plans that include it.
The trial length, trial_days, has no dashboard page: a Platform admin changes it through the API. The dashboard's sign-up page reads it from the API, so it follows the setting. The website states it from TRIAL_DAYS in website/src/config/plans.ts: change that with it.
Change what each plan includes
What each plan includes is code, not a setting: PLAN_FEATURE_MAP, beside PLANS in back-end/src/modules/billing/constants/plans.constants.ts, lists the features of each plan (forecast, assistant, rolePermissions, customRoles). The API checks it and the dashboard reads it from the API, so a change there reaches both.
- The checks are in the services that do the work, so the dashboard, the assistant and the MCP tools meet the same one:
PlanGateService(back-end/src/modules/workspaces/services/plan-gate.service.ts) is asked when a role is created or its permissions change, before the assistant reads a model or a record, and when the reports work out the forecast. - The website states the same on its own:
COMPARISON_ROWSinwebsite/src/config/plans.ts, the plan cards' lines and the lead under the pricing headline inwebsite/messages/pricing/, and the home page's questions inwebsite/messages/home/. Change them with the map: a dash or a check the API does not enforce promises what the product does not do. - The dashboard's sample data keeps its own copy of the map in
dashboard/src/lib/mock/billing/planFeatures.ts, so it answers as the API does with no API; change it too.
The website's plans
- The pricing page and the home page's pricing section show the plans from
src/config/plans.ts, with a monthly and yearly switch. Each plan's monthly price and its yearly price per month are whole dollars per user;TRIAL_DAYS(14) is the trial the copy states. - Each plan card lists what it holds: Starter the pipeline board, contacts, companies, activities, projects, CSV import and export, basic reports and invoices; Team everything in Starter with reports with forecasts, the AI assistant and editing role permissions; Scale everything in Team with custom roles. The comparison under the cards starts with each plan's price per user, which follows the switch, then shows each feature against the plans that include it, as the API enforces them.
- A plan's Choose button opens the dashboard's sign-up with
planandbillingin the address, such as/auth/signup?plan=team&billing=yearly, and the new workspace starts its trial on that plan. - What a workspace is charged comes from the API's own copy of the prices, so a price changed on the website is changed there too.