Environments
Understanding and using Straddle’s sandbox and production environments
Straddle provides two distinct environments for developers: a sandbox environment for testing and a production environment for live transactions. This guide will help you understand the differences between these environments and how to use them effectively in your development process.
Overview
Straddle offers two environments:
- Sandbox Environment:
https://sandbox.straddle.io
- Production Environment:
https://production.straddle.io
Each environment serves a specific purpose in your development lifecycle.
Sandbox Environment
The sandbox environment (https://sandbox.straddle.io
) is designed for testing and development purposes. It allows you to integrate and experiment with Straddle’s API without affecting real data or triggering actual financial transactions.
Key Features of the Sandbox Environment
- Simulates the behavior of the production environment
- Uses sandbox API keys
- Does not process real financial transactions
- Provides pre-defined test data and scenarios
- No rate limits or usage restrictions
When to Use the Sandbox Environment
Use the sandbox environment when:
- Developing and testing your integration
- Experimenting with new features
- Running automated tests
- Demonstrating your application without using real data
Accessing the Sandbox Environment
To use the sandbox environment, make API requests to https://sandbox.straddle.io
and use your test API key for authentication.
Example API request to the sandbox environment:
Production Environment
The production environment (https://production.straddle.io
) is used for live, real-world transactions. This is where your application will interact with actual customer data and process real financial transactions.
Key Features of the Production Environment
- Processes real financial transactions
- Uses live API keys
- Interacts with real customer data
- Subject to rate limits and usage restrictions
- Monitored for performance and reliability
When to Use the Production Environment
Use the production environment when:
- Your application is ready for real-world use
- Processing actual financial transactions
- Working with real customer data
Accessing the Production Environment
To use the production environment, make API requests to https://production.straddle.io
and use your live API key for authentication.
Example API request to the production environment:
Best Practices
To ensure a smooth transition from development to production, follow these best practices:
-
Use environment variables: Store your API keys and environment URLs as environment variables to easily switch between sandbox and production.
-
Thoroughly test in sandbox: Extensively test your integration in the sandbox environment before moving to production.
-
Gradual rollout: When moving to production, consider a phased rollout to minimize potential issues.
-
Monitor closely: Keep a close eye on your production transactions and be prepared to switch back to sandbox if issues arise.
-
Keep environments separate: Never mix sandbox and production data or API keys.
Transitioning from Sandbox to Production
When you’re ready to go live with your Straddle integration, follow these steps:
- Review and test all features in the sandbox environment.
- Update your API key to the live production key.
- Change your API endpoint from
https://sandbox.straddle.io
tohttps://production.straddle.io
. - Update any environment-specific configurations or settings.
- Perform final testing in production with real data (start with small, controlled transactions).
- Monitor your production transactions closely for any issues.
Always double-check that you’re using the correct environment and API key before processing real transactions. Using sandbox credentials in production can lead to failed transactions and poor user experience.
Conclusion
Understanding and properly utilizing Straddle’s sandbox and production environments is crucial for successful integration and deployment. By following the guidelines and best practices outlined in this guide, you can ensure a smooth development process and transition to production.
For more detailed information on specific API endpoints and how they behave in different environments, refer to our API Reference documentation.