Skip to main content
FlexPrice uses a multi-tenant architecture where each tenant represents an organization or company, and within each tenant, you can have multiple environments.

Tenants

A tenant is the top-level isolation boundary in FlexPrice. Each tenant has:
  • Complete data isolation from other tenants
  • Separate billing configuration
  • Independent user management
  • Own integration settings
In a self-hosted deployment, you control your tenant data. In the cloud version, each customer account is a separate tenant.

Environments

Within each tenant, you can create multiple environments:
  • Production - Live customer data and billing
  • Staging - Pre-production testing
  • Development - Local development and testing

Complete Isolation

Each environment has its own customers, meters, plans, and invoices

Same Configuration

Share plan templates and pricing models across environments

How It Works

Every API request must specify both tenant and environment:
curl https://api.flexprice.io/v1/customers \
  -H "X-API-Key: your-api-key" \
  -H "X-Tenant-Id: tenant_123" \
  -H "X-Environment: production"
API keys are scoped to a specific tenant and environment combination.

Environment Workflow

1

Develop locally

Build and test your pricing model in the development environment
2

Test in staging

Validate end-to-end workflows with staging data
3

Deploy to production

Roll out verified pricing changes to live customers

Data Scope

All entities in FlexPrice are scoped to a tenant + environment:
  • Customers
  • Plans and prices
  • Meters and events
  • Subscriptions
  • Invoices
  • Wallets and credit grants
Moving data between environments requires export and import. There is no automatic sync.

Best Practices

  1. Use development for experiments - Test new pricing models without affecting production
  2. Stage before production - Always validate in staging before deploying pricing changes
  3. Separate API keys - Use different keys for each environment
  4. Monitor all environments - Set up alerts for all environments, not just production

Authentication

Learn about API keys and environment scoping

Self-Hosting

Deploy FlexPrice with multi-tenant support