API Reference
Complete reference for all RohoPay REST API endpoints.
Base URL
output.txtText
https://api.rohopay.com
Authentication
| Endpoint Group | Auth Method |
|---|---|
/api/v1/* | Authorization: Bearer {api_key} |
/api/v1/checkout | api_key in request body |
/dashboard/* | Session cookie rohopay_token |
/api/v2/digital/* | Session cookie rohopay_token |
/api/v2/plugins/* | Session cookie rohopay_token |
/api/v2/reports/* | Session cookie rohopay_token |
/api/v2/public/* | No auth required |
/webhooks/* | HMAC or token verification |
Security Model & Hardening
RohoPay's API enforces the following security invariants — integrate with them in mind:
- API keys are server-side only. All
/api/v1/*calls authenticate withAuthorization: Bearer {api_key}. Never embed alive_key in client-side code, mobile apps, or public repos. The card/api/v1/checkoutendpoint takesapi_keyin the request body instead of the header. - Dashboard sessions use a Secure cookie, not a JS token. Authenticated app calls (
/dashboard/*,/api/v2/digital/*,/api/v2/plugins/*,/api/v2/reports/*) are authenticated by the httpOnly,Secure,SameSite=Nonerohopay_tokencookie. The token is never returned in JSON responses, URLs, orlocalStorage. - CORS is allowlist-only. The API reflects
Access-Control-Allow-Originsolely for configured origins and sendsAccess-Control-Allow-Credentials: truefor them. Unknown origins receive no CORS headers and are blocked by the browser. - Currency is required and validated. Collection/checkout requests must supply a valid ISO-4217
currency. There is no silent default — an invalid or missing currency returnsINVALID_CURRENCY. - Refunds are strictly scoped. A refund must belong to the project and user on the API key; anything else is rejected with
FORBIDDEN. Refund amounts are capped to the remaining refundable balance (computed inside the wallet lock). - Withdrawals/disbursements are guarded. They enforce a per-day ceiling and a short in-flight window, computed under the wallet lock, to prevent double-spend.
- Idempotency is enforced on mutations. Send an
Idempotency-Keyheader on create/pay/withdraw requests; duplicate keys are deduplicated rather than double-charged. - Webhooks are the source of truth. Payment status from redirect query params is a UX hint only — always confirm final status via the webhook (HMAC-SHA256 in
X-RohoPay-Signature) or a status poll. Provider webhooks are verified (x-webhook-secretfor Iotec, HMAC for Relworx).
Response Envelope
All responses follow the same JSON structure:
response.jsonJSON
{
"success": true | false,
"data": { ... }, // present when success: true
"message": "...", // optional human-readable message
"error": { // present when success: false
"code": "ERROR_CODE",
"message": "Human description",
"reference": "RHP-..." // optional transaction reference
}
}
Complete Endpoint Index
Health
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /health | None | API health check |
Authentication (User)
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /auth/user/login | None | Email/password login |
| POST | /auth/user/signup | None | Create account |
| POST | /auth/user/verify-email | None | Verify email with code |
| POST | /auth/user/resend-verification | None | Resend verification email |
| GET | /auth/google/login | None | Google OAuth redirect |
| GET | /auth/me | Session | Get current user |
| POST | /auth/logout | Session | Invalidate session |
Payments API (v1)
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/v1/collect | API Key | Collect mobile money |
| POST | /api/v1/disburse | API Key | Send mobile money (live only) |
| GET | /api/v1/transactions | API Key | List transactions |
| GET | /api/v1/transactions/:ref | API Key | Get transaction by reference |
| GET | /api/v1/wallet/balance | API Key | Get wallet balances |
| POST | /api/v1/checkout | Body (api_key) | Initiate card payment |
| POST | /api/v1/checkout/:reference/verify-card-otp | None (reference is the trust token) | Submit card OTP to complete a payment |
💡
RohoPay also receives internal, server-to-server status callbacks on its own payment rails. Those routes aren't meant to be called by your app and aren't part of the public API surface — see Webhooks Reference for the webhooks you receive from RohoPay.
Dashboard API (Session Auth)
| Method | Path | Description |
|---|---|---|
| GET | /dashboard/me | Current user profile |
| GET | /dashboard/wallet | Wallet details + balances |
| POST | /dashboard/wallet/topup | Top up via mobile money |
| POST | /dashboard/wallet/card-topup | Top up via card |
| POST | /dashboard/wallet/withdraw | Withdraw to mobile money |
| GET | /dashboard/stats | Dashboard statistics |
| GET | /dashboard/projects | List projects |
| POST | /dashboard/projects | Create project |
| PUT | /dashboard/projects/:id | Update project |
| DELETE | /dashboard/projects/:id | Delete project |
| GET | /dashboard/projects/:id/api-keys | List API keys |
| POST | /dashboard/projects/:id/api-keys | Create API key |
| DELETE | /dashboard/projects/:id/api-keys/:keyID | Revoke API key |
| POST | /dashboard/projects/:id/api-keys/:keyID/rotate | Rotate API key |
| GET | /dashboard/transactions | List all transactions |
| POST | /dashboard/transactions/:ref/sync | Force-sync transaction status |
| GET | /dashboard/webhook-config | Get webhook configuration |
| GET | /dashboard/wallets/lookup | Look up wallet by email |
| POST | /dashboard/transfers | Create P2P transfer |
| GET | /dashboard/transfers | List transfers |
Digital Products API (v2, Session Auth)
| Method | Path | Description |
|---|---|---|
| GET/POST | /api/v2/digital/products | List / create products |
| GET/PUT/DELETE | /api/v2/digital/products/:id | Get / update / delete product |
| GET/POST | /api/v2/digital/links | List / create payment links |
| GET/PUT/DELETE | /api/v2/digital/links/:id | Get / update / delete link |
| GET | /api/v2/digital/links/:id/revenue | Revenue for a link |
| GET | /api/v2/digital/orders | List orders |
| GET | /api/v2/digital/orders/:id | Get order |
| PUT | /api/v2/digital/orders/:id/status | Update order status |
| PUT | /api/v2/digital/orders/:id/delivery | Update delivery content |
| GET | /api/v2/digital/orders/:id/resource | Get order resource (buyer) |
| GET/PUT | /api/v2/digital/settings | Digital product settings |
| POST | /api/v2/digital/upload | Upload product file |
Public Checkout API (v2, No Auth)
| Method | Path | Description |
|---|---|---|
| GET | /api/v2/public/checkout/:slug | Get checkout page details |
| POST | /api/v2/public/checkout/:slug/pay | Process payment on checkout page |
| GET | /api/v2/public/checkout/:slug/order/:id | Poll order status |
WordPress Plugin API (v2, Session Auth)
| Method | Path | Description |
|---|---|---|
| GET/POST | /api/v2/plugins/connections | List / create connections |
| GET/DELETE | /api/v2/plugins/connections/:id | Get / delete connection |
| PUT | /api/v2/plugins/connections/:id/settings | Update settings |
| POST | /api/v2/plugins/connections/:id/regenerate-token | New site token |
| GET | /api/v2/plugins/transactions | List plugin transactions |
| GET/PUT | /api/v2/plugins/routing | Get / update routing rules |
Reporting API (v2, Session Auth)
| Method | Path | Description |
|---|---|---|
| GET | /api/v2/reports/transactions | Transactions with filters |
| GET | /api/v2/reports/analytics | Analytics & volume breakdown |
| GET | /api/v2/reports/settlements | Settlement records |
| GET/POST | /api/v2/reports/exports | List / create data exports |
| GET | /api/v2/reports/reconciliation | Reconciliation items |
| PUT | /api/v2/reports/reconciliation/:id | Mark item reconciled |
Pagination
Endpoints that return lists accept optional query parameters:
| Parameter | Default | Description |
|---|---|---|
limit | 20 | Max items per page (max 100) |
offset | 0 | Number of items to skip |
from | — | ISO 8601 date filter (start) |
to | — | ISO 8601 date filter (end) |
status | — | Filter by transaction status |
type | — | Filter by transaction type |
environment | — | Filter by test or live |
