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 | sandbox.cdp.coinbase.com | 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 | Supported | Supported |
Getting Started
1. Create Sandbox API Credentials
To access the sandbox environment, you’ll need to create sandbox-specific API credentials:Access CDP Portal
Navigate to the CDP Portal
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
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
Test data for transfers
When testing email-based transfers in the sandbox environment, only specific whitelisted email addresses will return successful validation responses. This approach prevents privacy concerns while providing predictable test behavior.Whitelisted email addresses
The following email addresses are whitelisted for sandbox testing and will return a2xx success response when used as transfer targets:
| Test Email | Description |
|---|---|
testuser1@domain.com | Returns successful validation |
testuser2@domain.com | Returns successful validation |
Use
validateOnly: true to test email validation without initiating a transfer.Non-whitelisted emails
Any email address not in the whitelist will return a4xx validation error indicating the user was not found.
Reserved onchain addresses for simulated outcomes
When testing onchain transfers in the sandbox environment, you can use reserved onchain addresses to simulate deterministic success or failure outcomes. Each address returns a predictable response based on the address used.| Reserved Address | Simulated Outcome |
|---|---|
0x1111111111111111111111111111111111111111 | Success |
0x2222222222222222222222222222222222222222 | Transfer invalid target |
0x3333333333333333333333333333333333333333 | Invalid address |
0x4444444444444444444444444444444444444444 | Unsupported network |
Sample request and response payloads
- Success
- Transfer invalid target
- Invalid address
- Unsupported network
Request payload:Expected response: HTTP
2xx with a normal transfer response.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:Complete Integration Testing
Ensure all features work correctly in sandbox with comprehensive test coverage
Review Security Practices
- Ensure API keys are stored securely
- Review access control and permissions
- Implement proper error handling
Create Production API Keys
Generate production credentials in the CDP Portal with appropriate permissions
Start with Small Transactions
Begin with small test transactions to verify everything works as expected