Environments (Live & Sandbox)
PortaAIM provides two isolated environments for every tenant: Live and Sandbox. This lets you test billing configurations safely before affecting real customers.
How Environments Work
| Aspect | Live | Sandbox |
|---|---|---|
| Purpose | Production billing | Testing & development |
| Data | Real customers & charges | Test data only |
| Payments | Real transactions | Simulated |
| Email to customers | Real | Also real |
| Visual indicator | Normal UI | Orange "Test Mode" bar |
Both environments are completely isolated — customers, plans, charges, invoices, and API keys are separate.
Switching Environments
Use the environment toggle in the top navigation bar to switch between Live and Sandbox. The switch is instant and your navigation state is preserved.
Your choice is remembered for your account rather than for the browser you made it in, so the next time you sign in — on any machine, and after clearing your browser data — PortaAIM opens in the mode you last selected. Until you select one, a company that hasn't finished setup opens in Sandbox, and a company that has opens in Live.
Sandbox Features
The sandbox includes special capabilities for testing:
- Test Charges: A button in the top bar lets you simulate usage events without connecting your application
- Same login: You log in with your regular credentials and toggle between environments — no separate accounts needed
- No real payments: All payment transactions are simulated
- Email is not simulated: the billing engine sends invoices from the sandbox exactly as it does from live, to whatever address the test customer carries. Give test customers addresses you own.
Environment-Specific API Keys
API keys are scoped to a single environment. When you create an API key, it's only valid for the environment you're currently in.
# Sandbox API call
curl -H "X-API-Key: sk_test_abc123" ...
# Live API call
curl -H "X-API-Key: sk_live_xyz789" ...
Your application should use sandbox keys during development and switch to live keys for production.
Cloning Between Environments
You can clone plans from one environment to the other:
- Navigate to the plan in the source environment
- Click Clone
- Select the target environment
- Review and confirm
This is the recommended workflow:
- Design and test your plan in Sandbox
- Clone it to Live when ready
- Start assigning real customers to the live plan
A price derived from vendor cost is copied as the rule, so the copy prices from the target environment's own cost. Record that cost there first (see Cloning Plans Between Environments).
Always test pricing changes in Sandbox first. Create test customers, submit charges, verify invoices, and confirm the numbers before deploying to Live.