Billing with TenaBill

Charge for your plans without building a billing system

TenaBill is the billing service behind TenancyEngine. The plans you sell can be linked to billing, so what a customer pays for and what your app lets them use stay in step.

Growth and above. Starter cannot charge customers.

What you get

Plans that bill

A plan you create in TenancyEngine can be linked to a billing product. Assign it to a customer and their features and limits follow.

Checkout, invoices, and receipts

Hosted checkout, PDF invoices, and receipts. Billing emails go out under your sender name, and you can add your own sending domain.

Reminders for overdue invoices

Customers get payment reminder emails when an invoice is overdue, so you do not chase them by hand.

A portal for your customers

Customers manage their subscription and invoices in a billing portal. They sign in with an emailed link, so there is no password to reset.

Flat, usage-based, or both

Combine a flat subscription with metered usage, and give customers account credits.

Events for your backend

TenancyEngine sends entitlement.changed and subscription.synced webhooks, so your app can react when a customer’s plan or subscription changes.

How it works

1

Define the plans you sell and the features each one includes.

2

Turn on billing for your app in the console.

3

Check the customer’s plan in your backend and react to plan changes by webhook.

In your code

These calls come from the TenancyEngine.Sdk package on NuGet. Every capability is also a REST API, so any language that can make an HTTPS request can use it.

List the plans you sell
// The plans you sell, with their prices and features.
var offerings = await te.GetOfferingsAsync("my-app", "Production", ct: ct);

foreach (var offering in offerings)
{
    Console.WriteLine(
        $"{offering.Name}: {offering.MonthlyPriceUsd:C} a month, {offering.Features.Count} features");
}
React when a customer’s plan changes
// A customer's plan changed: verify the call, then refresh what you know about them.
app.MapPost("/webhooks/tenancyengine", async (HttpRequest req) =>
{
    using var reader = new StreamReader(req.Body);
    var rawBody = await reader.ReadToEndAsync();
    var signature = req.Headers["X-TE-Signature"].ToString();

    if (!WebhookSignatureVerifier.Verify(rawBody, signature, webhookSecret))
        return Results.BadRequest();

    if (req.Headers["X-TE-Event"] == "entitlement.changed")
    {
        // Fetch the customer's runtime context again before the next gated request.
    }

    return Results.Ok();
});

What to know before you build on it

  • Billing starts on Growth. Starter covers sign-in and up to five customer workspaces but does not charge customers.
  • Checkout sessions and invoices are created with the TenaBill API or console, not with the TenancyEngine SDK. The SDK reads your plans and a customer’s entitlement.
  • Card payments are processed by Stripe.

Questions developers ask

Which plans include billing?

Growth, Scale, and Enterprise. Starter does not.

Does billing change what a customer can use?

Yes. The plan a customer is on decides their features and limits. TenancyEngine sends an entitlement.changed webhook when it changes.

Can I use TenaBill without TenancyEngine?

Yes. TenaBill also runs on its own as a billing service, with its own API and console.

Try it on the free Starter plan

One app and up to five customer workspaces. Upgrade when you need more.

Request access