Overview
The CDP Payments API sandbox environment provides a safe, isolated testing space where you can develop and test your payment integrations without affecting production data or processing real transactions. The sandbox mirrors production functionality while using test data and simulated payment flows.All API endpoints, authentication methods, and response formats in sandbox are identical to production, making it easy to transition your code when ready.
Key Differences: Sandbox vs Production
| Feature | Sandbox | Production |
|---|---|---|
| API Endpoint | api.cdp.coinbase.com/sandbox | api.cdp.coinbase.com |
| API Keys | Sandbox-specific credentials | Production credentials |
| Transactions | Simulated (no real value) | Real payment processing |
| Test Accounts | Unlimited test accounts | Real user accounts |
| Rate Limits | Same as production | Standard production limits |
| Data Persistence | Permanent | Permanent |
| Webhooks | Not Available | Production webhook URLs |
Getting Started
1. Create Sandbox API Credentials
To access the sandbox environment, you’ll need to create sandbox-specific API credentials:1
Access CDP Portal
Navigate to the CDP Portal
2
Select Your Project
Choose the project you want to create sandbox credentials for
3
Create Sandbox API Key
- Go to API Keys section
- Click Create API Key
- Select Sandbox as the environment
- Choose appropriate permissions (Accounts, Transfers, Payment Methods, etc.)
- Save your API key name and private key securely
4
Configure Your Application
Update your application to use the sandbox endpoint and credentials
2. Testing Workflows
Use following Postman Collection and Environment with the key created in previous step to test CDP Sandbox.Best Practices
Isolate Sandbox Configuration
Isolate Sandbox Configuration
Keep sandbox configuration completely separate from production:
Test Error Handling
Test Error Handling
Use sandbox to thoroughly test error scenarios:
- Invalid authentication
- Malformed requests
- Rate limiting
- Network timeouts
- Insufficient funds
- Invalid account details
Automate Integration Tests
Automate Integration Tests
Create automated test suites that run against sandbox:
Monitor API Usage
Monitor API Usage
Track your API usage patterns in sandbox to understand production requirements:
- Request volumes
- Response times
- Error rates
- Rate limit consumption
Limitations & Considerations
- Performance: Response times may vary from production
- Third-Party Services: Some third-party integrations use mocked responses
- Rate Limits: Same rate limits as production apply to prevent abuse
- Compliance Checks: Simplified compliance flows (no real KYC/AML)
Transitioning to Production
When you’re ready to move from sandbox to production:1
Complete Integration Testing
Ensure all features work correctly in sandbox with comprehensive test coverage
2
Review Security Practices
- Ensure API keys are stored securely
- Review access control and permissions
- Implement proper error handling
3
Create Production API Keys
Generate production credentials in the CDP Portal with appropriate permissions
4
Update Configuration
Switch from sandbox to production endpoints:
5
Start with Small Transactions
Begin with small test transactions to verify everything works as expected
6
Monitor Closely
Set up monitoring and alerting for:
- Failed transactions
- API errors
- Unusual activity
7
Have a Rollback Plan
Be prepared to quickly revert to previous code if issues arise
Troubleshooting
401 Unauthorized Errors
401 Unauthorized Errors
Rate Limiting
Rate Limiting
Problem: Hitting rate limits during testingSolutions:
- Implement exponential backoff in your code
- Add delays between rapid consecutive requests
- Cache responses when appropriate
- Contact support if you need higher limits for testing
Transfers Stuck in Pending
Transfers Stuck in Pending
Problem: Test transfers not completingSolutions:
- Check the transfer amount (some amounts trigger delays)
- Verify account IDs are valid sandbox accounts
- Ensure you’ve called the execute endpoint
- Review transfer status for error messages
Environment Mismatch
Environment Mismatch
Problem: Code works in sandbox but fails in productionSolutions:
- Verify all configuration uses environment variables
- Check for hardcoded sandbox-specific values
- Ensure production API keys have correct permissions
- Review any differences in account setup
Additional Resources
API Reference
Complete API documentation for all Payments API endpoints
Authentication Guide
Learn how to authenticate your API requests
CDP Portal
Manage your API keys and view analytics
Need Help?
If you encounter issues with the sandbox environment:- Join the Discord community for developer discussions
- Review the API Reference for detailed endpoint documentation
- Check the Service Status page
- Contact the CDP team for sandbox-specific questions