Developer CenterGuidesSandbox Environment

    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. 1.Log in to your dashboard at metro2.switchlabs.dev
    2. 2.Navigate to Settings → API Keys
    3. 3.Toggle the environment switch to Test
    4. 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 prefix

    3. 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 test and 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 bureau

    Delivery 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 successfully
    • file.failed — File generation encountered errors
    • delivery.confirmed — Bureau confirmed receipt of file
    • dispute.received — New consumer dispute received

    6. Go-Live Checklist

    Before switching to production, verify each of the following:

    All records pass validation with zero errors in sandbox
    File generation completes successfully with your full record set
    SFTP delivery tested and receipt parsing verified
    Webhook endpoints configured and responding correctly
    Error handling covers all API error codes (400, 401, 422, 429, 500)
    Production API key is stored securely (environment variable, not in code)
    Data furnisher information matches your bureau registration
    Dispute handling workflow is implemented and tested

    Related Resources