{"message":"Payment Gateway API","version":"1.0.0","endpoints":{"Authentication":{"POST /api/login":"Admin login (email + password)","POST /api/register":"Self-service email signup","POST /api/logout":"Admin logout","GET /api/check-auth":"Check authentication status (returns id, email, name, role, avatar_url)"},"Profile":{"GET /api/profile":"Get own profile","PUT /api/profile":"Update own name/phone","POST /api/profile/password":"Change own password","POST /api/profile/avatar":"Upload own avatar (multipart, image/*, 5MB)","GET /api/profile/activity":"Recent activity log for current user"},"Payment":{"POST /api/initiate-payment":"Initiate PesaPal payment","GET /api/check-status/:orderTrackingId":"Check payment status and get voucher","POST /api/pesapal/submit-order":"Submit PesaPal order","GET /api/pesapal/status/:orderTrackingId":"Check PesaPal transaction status","GET /api/pesapal/history":"Get PesaPal transaction history","GET /api/pesapal/token":"Get PesaPal access token"},"Vouchers":{"GET /vouchers":"List vouchers (with pagination)","GET /vouchers/:id":"Get single voucher","POST /vouchers":"Create voucher","PUT /vouchers/:id":"Update voucher","DELETE /vouchers/:id":"Delete voucher","POST /vouchers/bulk":"Bulk create vouchers","POST /vouchers/bulk-delete":"Bulk delete vouchers","POST /vouchers/upload":"Upload CSV","GET /vouchers/export":"Export to CSV","GET /vouchers/stats":"Get statistics"},"Controllers":{"GET /api/controllers":"List controllers","GET /api/controllers/:id":"Get controller","POST /api/controllers":"Create controller","PUT /api/controllers/:id":"Update controller","DELETE /api/controllers/:id":"Delete controller","GET /api/controllers/:id/vouchers":"Get controller vouchers","GET /api/controllers/:id/stats":"Get controller stats"},"ioTec":{"POST /api/iotec/collect":"Initiate ioTec collection","GET /api/iotec/status/:requestId":"Check transaction status","GET /api/iotec/status/external/:externalId":"Check status by external ID","GET /api/iotec/history":"Get transaction history","GET /api/iotec/token":"Get ioTec access token"},"Users":{"GET /api/users":"List users (admin; ?search=&limit=&offset=)","GET /api/users/:id":"Get user by ID","POST /api/users":"Create user (admin)","PUT /api/users/:id":"Update user (admin)","POST /api/users/:id/password":"Reset user password (admin)","DELETE /api/users/:id":"Delete user (admin; refuses last admin)"},"Expenses":{"GET /api/expenses":"List expenses (with pagination + search)","GET /api/expenses/stats":"Get weekly/monthly/yearly totals","GET /api/expenses/:id":"Get single expense","POST /api/expenses":"Create expense","PUT /api/expenses/:id":"Update expense","DELETE /api/expenses/:id":"Delete expense"},"Debug":{"GET /api/debug/time":"Time observability: host + DB (+ optional ioTec probe via ?iotec=1)"},"Portal":{"POST /portal/getPortalPageSetting":"Get portal configuration","POST /portal/auth":"Authenticate to portal"},"System":{"GET /health":"Health check","GET /api/health":"Health check (alternative)","GET /api/status":"Get API status"}}}