Most self-hosters can skip this page. Billing is off by default, and a private instance never talks to Stripe.
Turn billing on if you run Dispatch as a hosted service for other companies, like Dispatch Cloud does. Each workspace then pays a flat subscription (Dispatch Cloud: $50/month per workspace, unlimited users) through Stripe Checkout, and workspaces without an active subscription become read-only.
sequenceDiagram
participant O as Workspace owner
participant D as Dispatch
participant S as Stripe
O->>D: Settings → Billing → Subscribe
D->>S: Create Checkout Session (price, trial)
S-->>O: Hosted checkout page
O->>S: Pays
S->>D: Webhook /api/stripe/webhook (signed)
D->>S: Retrieve subscription
D->>D: Update workspace status (active, trialing, past_due, ...)
O->>D: Manage billing → Stripe Customer Portal
- Instance mode: billing only applies when Admin → Settings → General → Mode is SaaS and billing is enabled in Admin → Settings → Billing.
- Plans: every workspace has a plan.
cloudis paid, and only this plan is subject to billing.freeandcompedare free forever, set by a super admin.self_hostedis the default on private instances.
- Trial: new workspaces get the configured trial (default 14 days). A trial that's still running carries over into Stripe when the owner subscribes early, so subscribing never shortens it.
- Enforcement: with Lock workspaces without an active subscription on, a
cloudworkspace becomes read-only when its trial has ended or the subscription is canceled or unpaid. Data is never deleted.past_duestays writable while Stripe retries the payment. - Owners (and roles with Manage billing) subscribe, update payment methods and download invoices in the Stripe Customer Portal.
- Create or open your Stripe account and complete activation for live payments.
- Settings → Billing → Customer portal: activate the portal. Allow customers to update payment methods, view invoices and cancel subscriptions.
- Optional: configure Stripe Tax and your invoice template, logo and brand color under Settings → Business.
Start in test mode with test keys, then repeat the steps with live keys.
In Developers → API keys, copy the Publishable key (pk_…) and create a Secret key (sk_…). A restricted key works too if it has write access to Customers, Checkout Sessions, Customer portal, Products, Prices and Subscriptions.
In Developers → Webhooks → Add endpoint (Workbench: Webhooks → Create an event destination):
- Endpoint URL:
https://<DOMAIN>/api/stripe/webhook - Events:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.paidinvoice.payment_failed
Copy the endpoint's Signing secret (whsec_…).
Dispatch verifies every webhook signature, ignores duplicate deliveries, and re-fetches the subscription from Stripe on each event, so retries and out-of-order events are safe.
- Admin → Settings → General: set Mode to SaaS. This also enables the public marketing site and self-service sign-up, depending on your authentication settings.
- Admin → Settings → Billing: enable billing and enter:
| Field | Example | Notes |
|---|---|---|
| Secret key | sk_live_… |
Stored encrypted |
| Publishable key | pk_live_… |
|
| Webhook signing secret | whsec_… |
Stored encrypted |
| Amount | 5000 |
In the smallest currency unit (cents): 5000 = $50.00 |
| Currency | usd |
Any Stripe currency code |
| Interval | month |
month or year |
| Trial days | 14 |
0 disables trials |
| Lock unpaid workspaces | on | Read-only mode for cloud workspaces without an active subscription |
You don't need to create a product or price in Stripe. On the first checkout, or when you click Create/refresh product & price, Dispatch creates the product "<Product name> Cloud" and a recurring price matching your amount, currency and interval, and stores their IDs. If you change the amount later, Dispatch creates a new price, makes it the default and archives the old one. Existing subscriptions keep their price until you migrate them in Stripe.
With test keys:
- Create a workspace, then open Settings → Billing → Subscribe.
- Pay with card
4242 4242 4242 4242, any future date and any CVC. - The workspace shows as active within a few seconds. Check Developers → Webhooks → (endpoint) for successful deliveries.
- Try
4000 0000 0000 0341(attaches, then fails to charge) to testinvoice.payment_failed.
To test webhooks against a local instance, use the Stripe CLI:
stripe listen --forward-to localhost:3000/api/stripe/webhookThen paste the whsec_… it prints into Admin → Settings → Billing.
In Admin → Workspaces, a super admin can set a workspace's plan to comped (e.g. friends, open-source projects, your own team) or free. These workspaces are never locked and can't start a checkout. Switching back to cloud makes billing apply again.
- Live keys and a live webhook endpoint with the six events
- Customer portal activated in live mode
- Legal pages (imprint, privacy policy, terms) filled in under Admin → Settings → Legal
- System email delivery configured (Email delivery), because receipts come from Stripe but invitations and sign-in links come from Dispatch
- Admin → Settings → Security → Block private networks enabled, so customers can't make your server connect to internal addresses