COMING SOON
Developer API
We are building an API so that your apps can work with WiFiHapa: routers, WiFi sessions, payments and owner earnings.
The API is not open yet
The endpoints below are what we plan to offer. They do not answer yet, and there are no API keys yet. Tell us what you want to build and we will contact you when it opens.
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 }
Webhooks
POST
/webhooks/register
Register a webhook URL for events.
POST /v1/webhooks/register\n{ "url": "https://yourdomain.com/webhook", "events": ["payment.success", "session.expired"] }