Mocking Legacy & Third-Party APIs
The Problem: Your startup is building a new integration with a legacy banking API (or a rate-limited third-party service like Stripe). The sandbox environment is incredibly slow, frequently goes down, and has strict rate limits that block your CI pipeline.
The Mock-First Solution: Capture the real responses once, and serve them locally at 0ms latency for the entire team using Mockzilla.
1. The Capture Phase
Instead of reading a 400-page manual for the legacy API, make a real request using your browser with the Mockzilla Chrome Extension active.
- Open the Legacy Dashboard: Go to the third-party sandbox.
- Trigger the Request: Click around to trigger the API calls (e.g., "Fetch Account Details").
- Capture & Sync: Open the Mockzilla Chrome Extension, find that exact request, and click "Sync to Dashboard."
Mockzilla automatically creates a new folder and a new mock with the exact headers, status code, and JSON payload the real API returned.
2. The Refinement Phase: Snapshot to Living Mock
The captured data is static. To make it useful for testing multiple scenarios, transform it into a Dynamic Mock.
- Go to the Mockzilla Dashboard.
- Edit the newly captured mock. Change the path to a wildcard (e.g.,
GET /v1/accounts/:id). - Switch to the JSON Schema tab. Mockzilla can convert that static payload into a dynamic blueprint:
{
"type": "object",
"properties": {
"account_id": { "type": "string", "faker": "string.uuid" },
"status": { "type": "string", "enum": ["ACTIVE", "FROZEN", "PENDING"] },
"balance": { "type": "number", "minimum": 0, "maximum": 10000 },
"currency": { "type": "string", "const": "USD" }
},
"required": ["account_id", "status", "balance"]
}
3. The Result: A Local Playground for the Team
Now, point your app to http://localhost:36666/api/mock/legacy-api/....
- Speed: 3-second legacy calls now take 5ms locally.
- Reliability: CI/CD pipelines never fail because the sandbox is down.
- Cost: Avoid hitting rate limits or usage charges for third-party sandboxes.
- Team Portability: Since Mockzilla runs in Docker, you can commit the
data/folder to Git. Your entire team gets the exact same mocked environment instantly.
🤖 Do it with AI
"Take this legacy JSON snapshot and create a Mockzilla endpoint. Convert it into a dynamic schema using Faker for the account IDs and balances, ensuring the currency remains USD."
