Loading...
Loading...
Loading...
This document provides an overview of all available API endpoints in the Brill backend, grouped by category. Use this as a reference for frontend integration and development.
# Brill Backend API Documentation This document provides an overview of all available API endpoints in the Brill backend, grouped by category. Use this as a reference for frontend integration and development. --- ## Root & Health - `GET /` — API status - `GET /health` — Enhanced health check - `GET /api/health` — Basic health check - `GET /api/health/detailed` — Detailed health check --- ## Authentication & User Management - `POST /api/auth/register` — Register a new user - `POST /api/auth/login` — User login - `POST /api/auth/social-login` — Social login - `GET /api/auth/profile` — Get user profile - `PUT /api/auth/profile` — Update user profile - `PUT /api/auth/deactivate` — Deactivate user - `POST /api/password-reset/request` — Request password reset - `POST /api/password-reset/verify-code` — Verify reset code - `POST /api/password-reset/complete` — Complete password reset - `POST /api/mfa-tokens` — Create MFA token - `POST /api/mfa-tokens/verify` — Verify MFA token - `GET /api/mfa-tokens/history` — Get MFA history - `DELETE /api/mfa-tokens/cleanup` — Cleanup MFA tokens - `POST /api/jwt-tokens/refresh` — Refresh JWT - `POST /api/jwt-tokens/verify` — Verify JWT - `POST /api/jwt-tokens/logout` — Logout - `GET /api/users` — List users - `POST /api/users` — Create user - `GET /api/users/:id` — Get user by ID - `PUT /api/users/:id` — Update user - `DELETE /api/users/:id` — Delete user - `POST /api/users/:id/verify` — Verify user - `POST /api/users/:id/lock` — Lock user - `POST /api/users/:id/unlock` — Unlock user - `POST /api/users/:id/mfa/enable` — Enable MFA - `POST /api/users/:id/mfa/disable` — Disable MFA - `GET /api/users/:id/mfa` — Get MFA status - `GET /api/users/:id/ratings` — Get user ratings --- ## Product & Category Management - `GET /api/categories` — List categories - `POST /api/categories` — Create category - `GET /api/categories/:id` — Get category - `PUT /api/categories/:id` — Update category - `DELETE /api/categories/:id` — Delete category - `GET /api/products` — List products - `POST /api/products` — Create product - `GET /api/products/:id` — Get product - `PUT /api/products/:id` — Update product - `DELETE /api/products/:id` — Delete product - `POST /api/commodities` — Create a new commodity - `GET /api/commodities` — Get all commodities - `GET /api/commodities/:id` — Get a single commodity by ID - `PUT /api/commodities/:id` — Update a commodity by ID - `DELETE /api/commodities/:id` — Delete a commodity by ID --- ## Orders & Transactions - `GET /api/orders` — List orders - `POST /api/orders` — Create order - `GET /api/orders/:id` — Get order - `PUT /api/orders/:id` — Update order - `DELETE /api/orders/:id` — Delete order - `POST /api/orders/:id/accept` — Accept order - `POST /api/orders/:id/reject` — Reject order - `POST /api/orders/:id/cancel` — Cancel order - `POST /api/orders/:id/pickup` — Pickup order - `POST /api/orders/:id/deliver` — Deliver order - `POST /api/orders/:id/assign-driver` — Assign driver - `POST /api/orders/:id/mark-ready` — Mark order ready - `POST /api/orders/:id/confirm-delivery` — Confirm delivery - `POST /api/orders/:id/complete` — Complete order - `POST /api/orders/:id/pay` — Pay for order - `POST /api/orders/:id/release-payment` — Release payment - `POST /api/orders/:id/dispute` — Dispute order - `POST /api/orders/:id/refund` — Refund order - `GET /api/orders/:id/tracking` — Get order tracking - `POST /api/orders/:id/notify` — Notify about order - `GET /api/orders/active` — Get active orders - `POST /api/orders/auto-assign` — Auto-assign order - `GET /api/transactions` — List transactions - `POST /api/transactions` — Create transaction - `GET /api/transactions/:id` — Get transaction - `PUT /api/transactions/:id` — Update transaction - `POST /api/transactions/:id/confirm` — Confirm transaction - `POST /api/transactions/:id/refund` — Refund transaction - `GET /api/escrows` — List escrows - `POST /api/escrows` — Create escrow - `POST /api/escrows/delivery/complete` — Complete delivery - `POST /api/escrows/delivery/confirm` — Confirm delivery - `GET /api/escrow-status/:orderId` — Get escrow status --- ## Drivers & Merchants - `GET /api/drivers` — List drivers - `POST /api/drivers` — Create driver - `GET /api/drivers/:id` — Get driver - `PUT /api/drivers/:id` — Update driver - `POST /api/drivers/:id/verify` — Verify driver - `POST /api/drivers/:id/location` — Update driver location - `GET /api/driver/orders` — Get driver orders - `POST /api/driver/orders/:id/accept` — Accept driver order - `POST /api/driver/orders/:id/reject` — Reject driver order - `POST /api/driver/orders/:id/update-location` — Update order location - `POST /api/driver/orders/:id/mark-delivered` — Mark order delivered - `GET /api/merchants` — List merchants - `POST /api/merchants` — Create merchant - `GET /api/merchants/:id` — Get merchant - `PUT /api/merchants/:id` — Update merchant - `POST /api/merchants/:id/verify` — Verify merchant --- ## Delivery, Tracking & Feedback - `GET /api/fuel-orders` — List fuel orders - `POST /api/fuel-orders` — Create fuel order - `GET /api/fuel-orders/:id` — Get fuel order - `PUT /api/fuel-orders/:id` — Update fuel order - `POST /api/fuel-orders/:id/accept` — Accept fuel order - `POST /api/fuel-orders/:id/cancel` — Cancel fuel order - `DELETE /api/fuel-orders/:id` — Delete fuel order - `GET /api/delivery-feedback` — List delivery feedback - `POST /api/delivery-feedback` — Create delivery feedback - `GET /api/delivery-feedback/:id` — Get delivery feedback - `GET /api/delivery-feedback/order/:id` — Get feedback for order - `PUT /api/delivery-feedback/:id` — Update feedback - `DELETE /api/delivery-feedback/:id` — Delete feedback - `GET /api/tracking` — List tracking info - `POST /api/tracking` — Create tracking info - `GET /api/tracking/order/:orderId` — Get tracking for order - `GET /api/tracking/driver/:driverId` — Get tracking for driver - `GET /api/tracking/:id` — Get tracking by ID - `PUT /api/tracking/:id` — Update tracking - `DELETE /api/tracking/:id` — Delete tracking --- ## Ratings, Reports & Analytics - `GET /api/ratings` — List ratings - `POST /api/ratings` — Create rating - `GET /api/ratings/:id` — Get rating - `PUT /api/ratings/:id` — Update rating - `DELETE /api/ratings/:id` — Delete rating - `GET /api/ratings/user/:userId` — Get ratings for user - `GET /api/analytics/dashboard` — Analytics dashboard - `GET /api/analytics/orders` — Analytics for orders - `GET /api/content-reports` — List content reports - `POST /api/content-reports` — Create content report - `GET /api/content-reports/:id` — Get content report - `PUT /api/content-reports/:id` — Update content report --- ## Support, Messaging & Notifications - `GET /api/support-tickets` — List support tickets - `POST /api/support-tickets` — Create support ticket - `GET /api/support-tickets/:id` — Get support ticket - `PUT /api/support-tickets/:id` — Update support ticket - `DELETE /api/support-tickets/:id` — Delete support ticket - `GET /api/support-ticket-messages/:ticketId/messages` — Get messages for ticket - `POST /api/support-ticket-messages/:ticketId/messages` — Add message to ticket - `PUT /api/support-ticket-messages/:ticketId/messages/:messageId/read` — Mark message as read - `GET /api/support-ticket-messages/messages/unread-count` — Get unread message count - `GET /api/messages` — List messages - `POST /api/messages` — Create message - `GET /api/notifications` — List notifications - `POST /api/notifications` — Create notification --- ## Security, Logs & Admin - `GET /api/audit-logs` — List audit logs - `GET /api/error-logs` — List error logs - `GET /api/security-logs` — List security logs - `GET /api/suspicious-activities` — List suspicious activities - `GET /api/admin-users` — List admin users - `POST /api/admin-users` — Create admin user - `GET /api/admin-dashboard/overview` — Admin dashboard overview - `GET /api/admin-dashboard/alerts` — Admin alerts - `GET /api/admin/reports` — Admin reports - `GET /api/admin/system-metrics` — System metrics --- ## Payments, Webhooks & Integrations - `POST /api/payments/initialize` — Initialize payment - `GET /api/payments/verify/:reference` — Verify payment - `GET /api/payments/history` — Payment history - `GET /api/payments/status/:reference` — Payment status - `POST /api/payments/refund` — Refund payment - `POST /api/webhooks/paystack` — Paystack webhook - `GET /api/webhooks/health` — Webhook health - `POST /api/bank-accounts` — Add bank account - `GET /api/bank-accounts` — List bank accounts --- ## Toll Gates - `POST /api/toll-gates` - Create a new toll gate (Admin only) - `GET /api/toll-gates` - List all toll gates - `GET /api/toll-gates/:id` - Get toll gate details - `PUT /api/toll-gates/:id` - Update toll gate details (Admin only) --- ## Configuration - `GET /api/config/app` - Get app configuration - `GET /api/config/payment` - Get payment configuration - `GET /api/config/delivery` - Get delivery configuration - `PUT /api/config/app` - Update app configuration (admin only) --- ## Miscellaneous - `GET /api/cart` — Get user's cart - `POST /api/cart` — Add item to cart - `PUT /api/cart/:id` — Update cart item quantity - `DELETE /api/cart/:id` — Remove item from cart - `DELETE /api/cart` — Clear entire cart - `GET /api/checkout/preview` — Preview checkout summary - `POST /api/checkout` — Place order - `/api/firebase/*` — Firebase endpoints - `/api/geolocation/*` — Geolocation endpoints - `/api/identity-verifications/*` — Identity verification endpoints - `/api/push-notifications/*` — Push notification endpoints - `/api/realtime/*` — Real-time communication endpoints - `/api/realtime-examples/*` — Real-time example endpoints - `/api/search/*` — Search endpoints - `/api/upload/*` — File upload endpoints - `/api/verification-documents/*` — Verification document endpoints - `/api/web/*` — Web-specific endpoints --- > **Note:** > - All endpoints are prefixed with `/api` unless otherwise stated. > - Most endpoints require authentication (see backend code for middleware details). > - For detailed request/response formats, see the backend route files or ask for specific endpoint details.
**GitHub**:<https://github.com/HammerLynch/MSDS6306_Case_Study_2>
*Company Name : SK C&C*
Reference for building PL/SQL or Scala ETL pipelines. Types use PostgreSQL names as emitted by Diesel.
This document describes how to use the analytics system in the application.