Sandbox Testing
The MLM Platform provides sandbox environments for safe testing without affecting production data.Overview
Sandbox environments allow you to:- Test API integrations without real transactions
- Simulate purchases and commission flows
- Create test users and hierarchies
- Reset data for clean test runs
Creating a Sandbox
- Navigate to Settings > Environments in the Admin Dashboard
- Click Create Sandbox
- Enter a label (e.g., “Development”, “QA”)
- Optionally connect Stripe test mode
- Click Create
You can create up to 3 sandbox environments per tenant.
Sandbox API Keys
Each sandbox has its own API keys:- Go to Settings > API Keys
- Click Create API Key
- Select your sandbox environment
- Copy the key (prefix:
mlm_sandbox_)
Simulating Purchases
Use your sandbox API key to record purchase events safely:Creating Test Users
Create test users for building hierarchies:Resetting Sandbox Data
To reset your sandbox, use the Admin Dashboard to reset or recreate your sandbox environment.Cloning Configuration
Copy your production commission rules to sandbox:- Commission rules and rates
- Tier configurations
- Payout settings
- User data
- Commission history
- API keys or credentials
Testing Stripe Integration
Connect Stripe Test Mode
- Go to Settings > Environments
- Select your sandbox
- Click Connect Stripe
- Use Stripe test mode credentials
Test payout paths (sandbox only)
On Tenant Admin → Payouts (/tenant-admin/payouts):
- Configure Stripe → Wise auto top-up (Stripe external account ID + Wise balance ID)
- Ensure sandbox Stripe keys, Wise sandbox profile, and test members with payout accounts exist
- Use Test Wise payout path or Test Stripe Connect payout path to exercise the full automated pipeline
sandbox-payout-e2e-test edge function and record step-by-step results.
Commission clearing in sandbox
Commissions clear fromPENDING → CLEARED when:
- Purchase metadata has no
stripe_payment_intent_id(clears on next sync), or - Stripe reports the linked PaymentIntent’s balance transaction as available
sync-stripe-commission-clearing (daily cron). Manual payout runs on Payouts invoke ensure-wise-balance then resolve-payouts.
Calls8 integrations should pass stripe_payment_intent_id in purchase metadata so card-funded commissions wait for Stripe settlement.
Test Card Numbers
Test Webhooks
Use Stripe CLI to forward test webhooks:Environment Detection
Verify you’re in sandbox mode:Best Practices
Separate Test Data
- Use distinct email patterns:
test-*@example.com - Use recognizable product names:
[TEST] Product Name - Add metadata:
{ "test": true, "scenario": "happy-path" }