Environments
Magnolia Financial provides two environments for building and testing your integration.
Available Environmentsโ
| Environment | Base URL | Purpose |
|---|---|---|
| Production | https://api.magfi.net | Live environment with real Bitcoin mainnet and fiat transactions |
| Sandbox | https://api.sandbox.magfi.dev | Testing environment with Bitcoin testnet (regtest) |
Choosing an Environmentโ
Use Sandbox When:โ
- ๐งช Developing your integration - Test API calls without real money
- ๐ Testing edge cases - Use sandbox-only endpoints to simulate scenarios
- ๐ Learning the API - Experiment freely without consequences
- โ Running automated tests - Safe environment for CI/CD pipelines
Use Production When:โ
- ๐ฐ Processing real transactions - Live Bitcoin and fiat operations
- ๐ฅ Serving real users - Production-ready applications
- ๐ Operating at scale - Full performance and reliability
Sandbox Environment Detailsโ
The sandbox environment is designed to mirror production as closely as possible, with the following key differences:
1. Bitcoin Networkโ
| Aspect | Sandbox | Production |
|---|---|---|
| Network | Bitcoin regtest (MagFi-controlled) | Bitcoin mainnet |
| Confirmations | Fast (controlled by MagFi) | Real blockchain timing (~10 min/block) |
| Funds | Test Bitcoin (no real value) | Real Bitcoin with monetary value |
2. Fiat Transactionsโ
| Aspect | Sandbox | Production |
|---|---|---|
| Banking | Mocked bank transfers | Real bank integrations |
| Processing | Instant (simulated) | Real-world timing (hours to days) |
| Funds | Simulated amounts | Real fiat currency |
3. External Servicesโ
Nearly all external service integrations are mocked in sandbox:
- Bank transfers
- Identity verification
- Compliance checks
- Price oracles (can be controlled via sandbox endpoints)
4. Sandbox-Only Endpointsโ
Special endpoints are available in sandbox for testing scenarios:
Trigger Oracle Eventsโ
Simulate price oracle events for loan DLCs:
POST https://api.sandbox.magfi.dev/loan/__sandbox/trigger
See the full documentation: Trigger Oracle Loan Sandbox Event
Example Use Case: Test how your application handles liquidation events by simulating Bitcoin price changes.
Sandbox-Only Endpointsโ
Some endpoints are only available in sandbox for testing purposes:
| Endpoint | Description |
|---|---|
POST /loan/__sandbox/trigger | Manually trigger oracle events to test liquidation scenarios |
See Trigger Oracle Loan Sandbox Event for details.
The documentation shows warnings when viewing sandbox-only endpoints.
Data Isolationโ
Data in sandbox and production environments is completely isolated:
- Accounts created in sandbox are not visible in production
- API keys are environment-specific
- No data is shared between environments
This ensures safe testing without affecting production data.
Rate Limitsโ
Both environments have the same rate limits:
- 1000 requests per minute (default)
See the Rate Limits page for details.
Support and Troubleshootingโ
If you encounter environment-specific issues:
- Verify your base URL is correct for the intended environment
- Check your API key matches the environment
- Review sandbox limitations for mocked external services
- Check endpoint availability using the environment switcher in the docs