Skip to content

Sim-PesaStop fighting the Daraja sandbox. Run a complete, stateful M-Pesa STK Push simulator in 60 seconds -- locally, for free, forever.

M-Pesa on localhost. Finally.

Why Sim-Pesa exists

Every M-Pesa integration in East Africa flows through Safaricom's Daraja sandbox. And every developer building on Daraja has lost hours -- sometimes days -- to this:

{ "ResponseCode": "1", "ResponseDescription": "DS Timeout" }

Error 1037 (DS Timeout). Error 9999 (General Error). Error 1001 (Subscriber Locked). These aren't edge cases. They're the Daraja sandbox on a bad day.

Sim-Pesa is a local-first, containerized drop-in replacement for the Daraja sandbox. The same HTTP interface. Zero external dependencies. 100% deterministic.


60-second quickstart

The fastest way to trigger your first simulated STK Push is via the Dashboard:

  1. Open http://localhost:35173 and complete the 5-second setup wizard.
  2. In the Initiate STK Push panel, enter an amount and click Send Request.
  3. Watch the transaction appear in the live feed.
  4. Approve it on the Virtual Smartphone.

Using curl (Optional)

If you prefer using the command line, first copy your Bearer Token from the dashboard top bar, then run:

bash
curl -X POST http://localhost:33000/stkpush/v1/processrequest \
-H "Authorization: Bearer <your-token>" \
-H "Content-Type: application/json" \
-d '{
  "short_code": "174379",
  "phone_number": "254700000000",
  "amount": 10,
  "external_reference": "SIMPESA_TEST"
}'

What you're actually running

Sim-Pesa isn't a mock server with hardcoded responses. It's a full transactional state machine with five coordinated services:

ServiceStackWhat it does
Ingestion APINode.js + TypeScriptReceives STK Push requests, validates, enqueues
WorkerNode.js + TypeScriptProcesses jobs, locks rows, updates balances
DatabasePostgreSQL 16Source of truth -- merchants, users, transactions
QueueRedis + BullMQJob lifecycle, retry management, backpressure
DashboardReact + Vanilla CSSVirtual Smartphone, transaction monitor, wizard

Every balance update uses SELECT ... FOR UPDATE to prevent double-spending under concurrency. Every webhook uses exponential backoff. Every transaction is immutably logged with its full request/response payload.

Sim-Pesa is a high-fidelity simulation environment built for mission-critical developer workflows.


Designed for real workflows

Hackathons

Skip sandbox registration. Ship M-Pesa integrations in your first hour without waiting for credentials.

Integration Testing

Write deterministic test suites against stable, controlled state. No non-deterministic Daraja failures.

Onboarding

New engineers test the full payment flow safely without touching production or shared sandbox accounts.

Demos

Show a live STK Push flow that works every single time, even offline, for consistent sales or technical demos.


The error codes Sim-Pesa eliminates

Daraja ErrorWhat it meansSim-Pesa
1037DS Timeout -- PIN entry not submitted in timeConfigurable timeout path
1001Subscriber Locked -- concurrent USSD/STK sessionControlled via state machine
9999System Error -- Safaricom's catch-all failureDeterministic by design
2001Invalid PINTestable via Virtual Smartphone
1Insufficient FundsConfigurable via dashboard

Open source. No strings.

Sim-Pesa is MIT licensed. No API keys. No rate limits. No cloud account. Run it, fork it, extend it, ship it.

Read the architecture -> | API reference -> | GitHub ->

Released under the MIT License.