READ-ONLY API OPEN

Developer API

Router owners on the Enterprise plan can read their routers, customers, sales and earnings, and get webhooks, from their own systems. More is coming: starting WiFi sessions and payments.

Open now: the read-only owner API

For router owners on a plan with API access (Enterprise). Make a key on your Profile page in the owner dashboard and send it with every call. Answers are JSON: {"ok": true, "data": ...}.

curl -H "Authorization: Bearer wh_live_..." https://www.wifihapa.com/api/v1/routers
GET /api/v1/me

Your name, plan, your part of each sale and your balance.

GET /api/v1/routers

Your routers: online or not, selling now, users now and the most allowed.

GET /api/v1/routers/{id}

One of your routers, by the id from the list.

GET /api/v1/sessions?router={id}

Customers connected now, on all your routers or one: package, time left, data used. Phones are partly hidden.

GET /api/v1/payments?limit=50

Your latest payments (up to 200). Phones are partly hidden.

GET /api/v1/earnings?days=30

Sales and your part per day, for 1 to 90 days.

Only reads, only your own routers and sales. At most 60 calls a minute for each key. Keep keys secret; revoke one on your Profile page if it leaks.

Webhooks

Add your HTTPS address on your Profile page and WiFiHapa calls it when something happens, within 5 minutes, trying again if your server does not answer 2xx. Check each message: the HMAC-SHA256 of the body with your secret must equal X-WiFiHapa-Signature.

POST https://your-server/... X-WiFiHapa-Event: payment.completed X-WiFiHapa-Signature: sha256=<HMAC-SHA256 of the body with your secret> {"id": 42, "event": "payment.completed", "created": "2026-12-03T10:15:00+03:00", "data": {"ref": "TXN...", "router": "...", "amount_tzs": 500, "phone": "0712 *** 678", "paid_at": "..."}}

Events: payment.completed (a package paid on one of your routers), router.offline (silent for 15 minutes), router.online (back).

Coming later

The endpoints below are what we plan to add. They do not answer yet. Tell us what you want to build and we will tell you when they open.

Planned endpoints

Routers

GET /routers

List all available routers near a location.

GET /v1/routers?lat=-6.7924&lon=39.2083&radius=100
GET /routers/{id}

Get details of a specific router.

GET /v1/routers/123

Sessions

POST /sessions

Create a new WiFi session (purchase time).

POST /v1/sessions\n{\n "router_id": 123,\n "duration": "1h",\n "payment_method": "vodacom",\n "phone": "0712345678"\n}
GET /sessions/{id}

Get session status and password.

GET /v1/sessions/456
DELETE /sessions/{id}

End an active session.

DELETE /v1/sessions/456

Payments

POST /payments

Start a mobile money payment.

POST /v1/payments\n{\n "amount": 500,\n "phone": "0712345678",\n "session_id": 456\n}
GET /payments/{id}/status

Check payment status.

GET /v1/payments/789/status

Router Owner

GET /owner/earnings

Get daily, weekly or monthly earnings summary.

GET /v1/owner/earnings?period=weekly
GET /owner/users

List active and expired sessions on owned routers.

GET /v1/owner/users
PUT /owner/routers/{id}/price

Update router hourly price.

PUT /v1/owner/routers/123/price\n{ "price": 550 }