Using the Sandbox Environment
The sandbox environment lets you build and test your Metro 2® integration without affecting real credit data. Every feature available in production works identically in sandbox.
1. Overview
The Metro 2® API provides two completely separate environments:
Sandbox (Test)
- • API keys prefixed with
test_ - • Full validation against Metro 2® rules
- • Records never reach credit bureaus
- • Simulated SFTP delivery endpoints
- • No charge for API calls
Production (Live)
- • API keys prefixed with
live_ - • Same validation rules as sandbox
- • Files delivered to Equifax, Experian, TransUnion
- • Real SFTP delivery to bureau endpoints
- • Billed per record submitted
Warning
Never use production API keys for testing. Production submissions are delivered to credit bureaus and will affect real consumer credit reports.
2. Getting Your Test API Key
A sandbox API key is automatically created when you sign up. To find it:
- 1.Log in to your dashboard at metro2.switchlabs.dev
- 2.Navigate to Settings → API Keys
- 3.Toggle the environment switch to Test
- 4.Copy your key (starts with
test_sk_)
// Use your test key for all sandbox requests
curl -X GET https://api.metro2.switchlabs.dev/v1/records \
-H "Authorization: Bearer test_sk_abc123def456"
// The API automatically routes to the sandbox environment
// based on your key prefix3. Environment Isolation
Sandbox and production are completely isolated. Records, files, and configurations in one environment are invisible to the other.
What Happens in Sandbox
- • Records are tagged as
testand stored separately - • Generated files pass all format validation but are never transmitted
- • Webhooks fire to your configured endpoints with test payloads
- • SFTP credentials connect to a simulated server (data is discarded)
- • All test data is automatically purged after 90 days of inactivity
// Test records include a "test" flag in the response
{
"recordId": "rec_test_abc123",
"environment": "sandbox",
"accountNumber": "ACCT-10042",
"status": "valid",
...
}
// Production records omit the test flag
{
"recordId": "rec_abc123",
"environment": "production",
"accountNumber": "ACCT-10042",
"status": "valid",
...
}4. Simulated SFTP Delivery
The sandbox provides simulated SFTP endpoints that mirror production bureau connections. Files are accepted, validated, and logged — but never forwarded to any bureau.
// Sandbox SFTP configuration
Host: sftp-sandbox.metro2.switchlabs.dev
Port: 22
Username: (from your dashboard)
Password: (from your dashboard)
// Upload your generated file
sftp> put metro2_202501_test.dat /incoming/
// The server accepts the file and returns a delivery receipt
// but does not forward to any bureauDelivery receipts in sandbox have the same structure as production receipts. Use them to test your receipt parsing and error handling logic.
5. Testing Webhooks in Sandbox
Sandbox webhooks behave identically to production. Configure your webhook URL in the dashboard and the sandbox will send real HTTP POST requests to your endpoint.
// Example webhook payload (file.completed event)
POST https://your-app.com/webhooks/metro2
Content-Type: application/json
X-Metro2-Signature: sha256=abc123...
{
"event": "file.completed",
"environment": "sandbox",
"data": {
"fileId": "file_test_xyz789",
"status": "completed",
"recordCount": 150,
"errorCount": 0,
"completedAt": "2025-01-15T10:30:12Z"
}
}Available Webhook Events
file.completed— File generation finished successfullyfile.failed— File generation encountered errorsdelivery.confirmed— Bureau confirmed receipt of filedispute.received— New consumer dispute received
6. Go-Live Checklist
Before switching to production, verify each of the following: