Create a customer workspace the moment someone signs up
In a B2B product the unit of onboarding is a customer organization, not a user. Your backend creates it, starts it on a plan, and remembers how it maps to your own records.
5 min read · Last checked
In short
Key points
- Create one workspace per customer from your backend with an API key that has the tenants write scope.
- Use your own customer id as the workspace slug so mapping between systems is trivial.
- A new workspace has no plan until you give it one. A free offering can be set at creation; a paid plan always goes through checkout.
- Starter allows five customer workspaces, so plan for that when you test.
What a workspace is
A workspace, called a tenant in the API, is one customer of your application: its own members, roles, plan, and usage. Your product data stays in your database, keyed by the customer, and TenancyEngine holds the accounts, roles, plans and usage around it.
Create it from your signup handler
The slug is yours to choose, so pick something you can derive from your own record. The offering you name must be active, belong to the same application and environment, and cost nothing in every region. A paid offering is rejected with a 400 and no tenant is created.
using TenancyEngine.Sdk;
var app = await te.GetApplicationAsync("my-app", ct)
?? throw new InvalidOperationException("Application not found.");
var tenant = await te.CreateTenantAsync(
app.Id,
new CreateTenantRequest(companyName, customerId, Environment: "Production")
{
OfferingSlug = "free" // must be active, in this application and environment, and cost 0
},
ct);
// Store tenant.Id next to your own customer record.Why the free offering matters
Without an offering, billing-controlled features are off and metered calls fail with a message that there is no active entitlement for the feature. Starting on a free offering means your first metered call works immediately.
Moving to a paid plan
An API key can never start a paid plan by itself. Send the customer through checkout; when payment completes, billing activates the offering. You can also assign a plan by hand in the console, on the tenant’s Entitlements tab, if you have the billing-grant permission. Subscription billing starts on the Growth plan.
Connect people to the workspace
Creating a workspace gives you a shell without users. Invite the first administrator by email so they set up their own sign-in, then let them invite teammates. Match people by a stable identifier you control rather than by email address alone.
Honest limits
What to know before you rely on this
- Starter allows up to five customer workspaces and runs in Production only.
- A tenant is created without users; attaching people is a separate step.
- Billing on a paid offering needs Growth or above.
Questions people ask
Can I create workspaces from the browser?
No. Creating one needs a secret API key, which belongs only on your server.
What happens to the free workspace when the customer upgrades?
The workspace stays; the offering in force changes when checkout completes. Your app sees the change in the entitlement context and the entitlement.changed webhook.
Sources
Keep reading
Try it on the free plan
One app and five customers, no credit card required.