Setup Your Sandbox Environment

You’ve successfully made your first request to Busha! Now, it’s time to unleash your development creativity in the Busha Sandbox environment fully. This dedicated testing ground allows you to build, test, and iterate on your integrations without affecting live data or incurring real costs.

What You’ll Achieve:

  1. Understand the purpose and benefits of the Sandbox.

  2. Learn how to configure your requests for the Sandbox.

  3. Explore and test various Busha API endpoints in a safe space.

Why Use the Sandbox?Copied!

The Sandbox environment is your essential playground for:

  • Risk-Free Testing: Experiment with different API calls, edge cases, and error handling without impacting real users or funds.

  • Rapid Iteration: Develop and debug your application’s integration quickly and efficiently.

  • Feature Exploration: Develop and debug your application’s integration quickly and efficiently.

  • Simulated Scenarios: Mimic various user flows and transaction outcomes (e.g., successful deposits, failed payouts, specific error codes).

Read First: Create Your Sandbox Account

If you don’t have a sandbox account, you can create one from the Sandbox business registration page using the same steps from the Quick Start guide. Sandbox personal accounts require 2FA, and businesses are automatically verified.

Step 1: Connect to the Sandbox EnvironmentCopied!

The primary difference between the Sandbox and the Production environment is the base URL used for API requests.

To connect to the Sandbox: Ensure your API calls target the following base URL:

https://api.sandbox.busha.so

Example: If your first request to production was https://api.busha.co/v1/accounts, the equivalent Sandbox request would be https://api.sandbox.busha.so/v1/accounts.

Step 2: Generate Your API KeysCopied!

The API key you generated in the Quick Start Guide is valid for the Sandbox environment.

To use your API keys in the Sandbox environment, continue to use your Authorization: Bearer {your_secret_api_key} header with the Secret API Key you obtained previously for all Sandbox requests.

Step 3: Explore and Test EndpointsCopied!

With your environment configured, you can now start sending various requests to the Sandbox API. Think about the features you want to integrate into your application and try making the corresponding API calls.

Let’s retrieve our Sandbox account balances:

$ curl -X GET "https://api.sandbox.busha.so/v1/balances" \
  -H "Authorization: Bearer {YOUR_SECRET_API_KEY}" \
  -H "Content-Type: application/json"

Expected Response: A JSON array of your test wallet balances in the Sandbox.

Important Sandbox Notes & LimitationsCopied!

  • No Real Funds: All transactions performed in the Sandbox are simulated. No actual money will move, and your real balances remain unaffected.

  • Test Data: The Sandbox may contain predefined test accounts or mock data. Do not expect it to reflect your live production balances.

  • Rate Limits: While generally more lenient than production, observe fair usage. Excessive requests might still be rate-limited.

  • Feature Parity: The Sandbox aims for high feature parity with production, but some advanced or newly released features might not be immediately available or behave slightly differently. Always check the API reference for specific endpoint statuses.

  • Error Simulation: The Sandbox is excellent for testing error handling. You can often trigger specific error responses by using certain invalid inputs. Consult the Error Handling Reference for details on how to simulate common errors for robust error handling in your application.

What’s Next?Copied!

Once you’re confident with your integration in the sandbox and your application is performing as expected, you’ll be ready to transition to the live Production Environment.