openapi: 3.0.3
info:
  title: AKRSera MLM SaaS ERP API
  version: 1.0.0
  description: Full API documentation for all modules
servers:
  - url: https://yourdomain.com/api
paths:
  /user/profile:
    get:
      summary: Get authenticated user profile
      responses:
        '200':
          description: User profile
  /user/{id}:
    get:
      summary: Get user by ID
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: User details
  /wallets:
    get:
      summary: Get wallets for authenticated user
      responses:
        '200':
          description: List of wallets
  /ledger:
    get:
      summary: Get ledger entries for authenticated user
      responses:
        '200':
          description: List of ledger entries
  /franchise:
    get:
      summary: List franchises
      responses:
        '200':
          description: Franchise list
  /product:
    get:
      summary: List products
      responses:
        '200':
          description: Product list
  /cart:
    get:
      summary: List cart items
      responses:
        '200':
          description: Cart items
  /order:
    get:
      summary: List orders
      responses:
        '200':
          description: Order list
  /inventory:
    get:
      summary: List inventory
      responses:
        '200':
          description: Inventory list
  /epin:
    get:
      summary: List EPin
      responses:
        '200':
          description: EPin list
  /kyc:
    get:
      summary: List KYC documents
      responses:
        '200':
          description: KYC list
  /report/income:
    get:
      summary: Income report
      responses:
        '200':
          description: Income report
  /report/commission:
    get:
      summary: Commission report
      responses:
        '200':
          description: Commission report
  /report/payout:
    get:
      summary: Payout report
      responses:
        '200':
          description: Payout report
  /withdrawal:
    get:
      summary: List withdrawal requests
      responses:
        '200':
          description: Withdrawal list
  /admin/dashboard:
    get:
      summary: Admin dashboard stats
      responses:
        '200':
          description: Dashboard stats
  /admin/settings:
    get:
      summary: Get company settings
      responses:
        '200':
          description: Company settings
    post:
      summary: Update company settings
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                phone:
                  type: string
                address:
                  type: string
      responses:
        '200':
          description: Settings updated
  /user/profile/edit:
    get:
      summary: Edit user profile
      responses:
        '200':
          description: Edit form
  /user/profile/update:
    post:
      summary: Update user profile
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                phone:
                  type: string
                address:
                  type: string
      responses:
        '200':
          description: Profile updated
  /notification/send:
    post:
      summary: Send notification
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum: [email, sms, whatsapp]
                to:
                  type: string
                subject:
                  type: string
                message:
                  type: string
      responses:
        '200':
          description: Notification sent
