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": ...}.
Your name, plan, your part of each sale and your balance.
Your routers: online or not, selling now, users now and the most allowed.
One of your routers, by the id from the list.
Customers connected now, on all your routers or one: package, time left, data used. Phones are partly hidden.
Your latest payments (up to 200). Phones are partly hidden.
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.
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
List all available routers near a location.
Get details of a specific router.
Sessions
Create a new WiFi session (purchase time).
Get session status and password.
End an active session.
Payments
Start a mobile money payment.
Check payment status.
Router Owner
Get daily, weekly or monthly earnings summary.
List active and expired sessions on owned routers.
Update router hourly price.