📋 API Overview

The SACCO Multibranch Banking SaaS API provides a complete solution for managing Savings and Credit Cooperative Organizations (SACCOs) with multi-branch support. The system follows a hierarchical structure: Super Admin → Company/Tenant → Branch → Members.

Base URL: https://saccoapi.weafcompany.com/api
Authentication: Bearer Token (JWT via Laravel Sanctum)
Response Format: JSON
API Version: 1.0

✅ Implementation Status

Phase 1: Foundation Implemented

  • Authentication & Authorization
  • Super Admin APIs
  • Tenant/Branch Management
  • Subscription Management
  • Staff & Roles
  • Payment & Billing

Phase 2: Core Banking Planned

  • Member Management
  • Savings & Deposits
  • Loans & Credit
  • Payment Processing

Phase 3: Advanced Features Planned

  • HRM Management
  • Accounting System
  • Reporting & Analytics
  • Mobile & Integration

🔌 API Modules

🔐 Authentication & Authorization

POST /api/auth/register POST /api/auth/login POST /api/auth/logout POST /api/auth/refresh POST /api/auth/forgot-password POST /api/auth/reset-password GET /api/auth/profile

👨‍💼 Super Admin APIs

GET /api/superadmin/dashboard GET /api/superadmin/tenants POST /api/superadmin/tenants GET /api/superadmin/subscriptions GET /api/superadmin/staff GET /api/superadmin/roles

🏢 Tenant/Branch Management

GET /api/tenant/dashboard GET /api/tenant/branches POST /api/tenant/branches GET /api/tenant/staff POST /api/tenant/staff

💳 Subscription Management

GET /api/subscriptions/plans POST /api/subscriptions/subscribe GET /api/subscriptions/status POST /api/subscriptions/renew POST /api/subscriptions/cancel

💰 Payment & Billing

GET /api/superadmin/payments POST /api/superadmin/payments/approve/{id} POST /api/superadmin/payments/{id}/refund GET /api/superadmin/payments/flagged POST /api/superadmin/payments/reconcile

👥 Staff & Roles

GET /api/superadmin/staff POST /api/superadmin/staff PUT /api/superadmin/staff/{id} DELETE /api/superadmin/staff/{id} GET /api/superadmin/roles POST /api/superadmin/roles

📤 Response Format

All API responses follow a standardized format:

Success Response

{ "status": { "returnCode": "00", "returnMessage": "SUCCESS" }, "data": { // Response data here } }

Error Response

{ "status": { "returnCode": "01", "returnMessage": "Validation failed" }, "data": "Error message or details" }

🔑 Authentication

Most endpoints require authentication using Bearer tokens. Include the token in the Authorization header:

Authorization: Bearer {your_access_token}

Getting an Access Token

  1. Register a tenant: POST /api/auth/register
  2. Login: POST /api/auth/login
  3. Use the returned accessToken in subsequent requests
  4. Refresh expired tokens: POST /api/auth/refresh

🚀 Quick Start

1. Register a Tenant

POST /api/auth/register { "companyInfo": { "tenantName": "My SACCO", "legalName": "My SACCO Limited", "email": "info@mysacco.test" }, "adminUser": { "firstName": "John", "lastName": "Doe", "email": "admin@mysacco.test", "password": "SecurePass123!" } }

2. Login

POST /api/auth/login { "email": "admin@mysacco.test", "password": "SecurePass123!" }

3. Access Protected Endpoints

GET /api/tenant/dashboard Headers: Authorization: Bearer {access_token}

📚 Documentation

API Documentation

  • Postman Collection
  • Error Codes Reference
  • Response Format Guide

Resources

  • README.md - Full API Guide
  • API_ERROR_CODES.md
  • API_RESPONSE_FORMAT.md