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}/seedGET 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
| Scenario | Tenant state | What you should see |
|---|---|---|
trial-ending | Entry offering, trial closing in 2 days, about 40% of each limit used | Entitlement status Trial with an end date 2 days out; nothing blocked |
over-limit | Entry offering, active, every metered limit exceeded by about 10% | Status Active; usage above limit; consume calls refused |
past-due | Entry offering, suspended for non-payment, about 60% used | Status Suspended; show your billing prompt |
enterprise-sso | Top offering, active, every gated feature granted, about 25% used | Status Active on the highest-priced offering; gated features enabled |
empty | New tenant, no subscription, no usage | No 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}-devorseed-{scenario}-staging. Running it again resets that tenant to the scenario state instead of creating another. - Flagged. Seeded tenants carry a
SeedScenariomarker. Seed and purge only ever change flagged tenants; if a tenant you created already uses a seed slug, the call returns 409slug_taken_by_real_tenant. - Production returns 409
production_refused. - Entitlement changes go through the normal assignment path, so your
entitlement.changedwebhooks 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.