Skip to content

Scenario seeds ​

Put a Development or Staging environment into a known state so you can test paywalls, limits and billing screens without hand-creating tenants or burning usage. Production environments are refused.

Open the application in the console, find the environment card and use Test scenarios, or call the admin API with a key that can write tenants for the application.

GET    /api/v1/admin/applications/{applicationId}/environments/{environmentId}/seed
POST   /api/v1/admin/applications/{applicationId}/environments/{environmentId}/seed   { "scenario": "over-limit" }
DELETE /api/v1/admin/applications/{applicationId}/environments/{environmentId}/seed

GET lists the scenarios and the tenants already seeded. POST creates or resets the scenario tenant. DELETE removes every seeded tenant in that environment, with its subscription, usage and grants. It never touches a tenant you created yourself.

Scenarios ​

ScenarioTenant stateWhat you should see
trial-endingEntry offering, trial closing in 2 days, about 40% of each limit usedEntitlement status Trial with an end date 2 days out; nothing blocked
over-limitEntry offering, active, every metered limit exceeded by about 10%Status Active; usage above limit; consume calls refused
past-dueEntry offering, suspended for non-payment, about 60% usedStatus Suspended; show your billing prompt
enterprise-ssoTop offering, active, every gated feature granted, about 25% usedStatus Active on the highest-priced offering; gated features enabled
emptyNew tenant, no subscription, no usageNo active entitlement; all meters at zero

The entry offering is the cheapest active offering in the environment and the top offering is the most expensive. Usage is seeded for metered features that have a limit on that offering. If the environment has no offerings, or a feature has no limit, the call succeeds and the response lists what was skipped in warnings.

Behaviour ​

  • Idempotent. Each scenario has one tenant per environment, with slug seed-{scenario}-dev or seed-{scenario}-staging. Running it again resets that tenant to the scenario state instead of creating another.
  • Flagged. Seeded tenants carry a SeedScenario marker. Seed and purge only ever change flagged tenants; if a tenant you created already uses a seed slug, the call returns 409 slug_taken_by_real_tenant.
  • Production returns 409 production_refused.
  • Entitlement changes go through the normal assignment path, so your entitlement.changed webhooks fire for the seeded tenant.

Not included yet ​

Seeded tenants have no member users and no SSO connection (SSO connections belong to the organization, not the tenant). Create test users by invitation with a test-*@tenancyengine.com address.

TenancyEngine platform documentation