RevKeen Docs
Developers

Mock Server

Schema-validated mock API responses for development and testing without credentials

The RevKeen mock server returns realistic, schema-validated responses generated from the OpenAPI specification. No API key required, no data persisted, no side effects.

Hosted Mock Server

RevKeen hosts a public mock server -- no setup required:

Base URLhttps://mock-api.revkeen.com/v2
AuthNone required
CORSAll origins allowed
Rate limit30 requests/second per IP

Try it now:

# No API key needed
curl https://mock-api.revkeen.com/v2/customers
curl https://mock-api.revkeen.com/v2/products
curl https://mock-api.revkeen.com/v2/invoices

How It Works

The mock server is powered by the Scalar CLI and uses the OpenAPI specification to generate responses:

  1. Request validation -- Incoming requests are validated against the spec (correct path, method, required parameters)
  2. Response generation -- A response is generated from the schema definition, using example values where available
  3. Status codes -- The mock server returns the appropriate status code for each endpoint
  4. No persistence -- Nothing is stored. Each request returns a fresh response from the schema

Mock responses are deterministic and generated from the schema. They will not reflect data you have created or modified -- for that, use the Sandbox environment at sandbox-api.revkeen.com.

When to Use Mock vs Sandbox

ScenarioMock ServerSandbox
Prototype a UI without signing upYesNo
Validate request/response shapesYesNo
Integration tests with realistic flowsNoYes
CI pipeline shape validationYesNo
End-to-end payment testingNoYes
Test webhook deliveryNoYes
Client demosEitherEither
SDK developmentYesYes
Load testingNoNo

Rule of thumb: Use the mock server for shape validation and UI prototyping. Use Sandbox when you need data persistence, state changes, or realistic payment flows.

Using With SDKs

Point any SDK at the mock server by overriding the base URL:

import RevKeen from '@revkeen/sdk';

const client = new RevKeen({
  apiKey: 'mock_key', // Any value works
  baseUrl: 'https://mock-api.revkeen.com',
});

const customers = await client.customers.list();
from revkeen import RevKeen

client = RevKeen(
    api_key="mock_key",
    base_url="https://mock-api.revkeen.com"
)

customers = client.customers.list()
use RevKeen\Client;

$client = new Client('mock_key', [
    'base_url' => 'https://mock-api.revkeen.com'
]);

$customers = $client->customers->list();

Local Mock Server

For offline development or when you need the mock server locally:

# Install and run (one command)
npx @scalar/cli mock https://api.revkeen.com/v2/openapi.json --port 4010
# Available at http://localhost:4010/v2

If you have the repo cloned:

# From the packages/openapi directory
pnpm mock
# Starts on http://localhost:4010

Limitations

The mock server does not support:

  • Data persistence -- POST requests return mock responses but do not store anything
  • Stateful flows -- Creating a customer and then listing it will not show the created customer
  • Payment processing -- No gateway interaction occurs
  • Webhook delivery -- No events are fired
  • Authentication -- API keys are not validated (any value works)
  • Rate limiting -- No rate limits are enforced (hosted mock has per-IP limits only)

For any of these, use the Sandbox environment.

On this page