Skip to main content

Environments

Magnolia Financial provides two environments for building and testing your integration.

Available Environmentsโ€‹

EnvironmentBase URLPurpose
Productionhttps://api.magfi.netLive environment with real Bitcoin mainnet and fiat transactions
Sandboxhttps://api.sandbox.magfi.devTesting 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โ€‹

AspectSandboxProduction
NetworkBitcoin regtest (MagFi-controlled)Bitcoin mainnet
ConfirmationsFast (controlled by MagFi)Real blockchain timing (~10 min/block)
FundsTest Bitcoin (no real value)Real Bitcoin with monetary value

2. Fiat Transactionsโ€‹

AspectSandboxProduction
BankingMocked bank transfersReal bank integrations
ProcessingInstant (simulated)Real-world timing (hours to days)
FundsSimulated amountsReal 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:

EndpointDescription
POST /loan/__sandbox/triggerManually 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:

  1. Verify your base URL is correct for the intended environment
  2. Check your API key matches the environment
  3. Review sandbox limitations for mocked external services
  4. Check endpoint availability using the environment switcher in the docs