Skip to main content

Business features


1. Hierarchy management

Super Agent manages the Agents → Shops → Players tree:

flowchart TB
SA[Super Agent] --> A1[Agent 1]
SA --> A2[Agent 2]
A1 --> S1[Shop A]
A1 --> S2[Shop B]
S1 --> P1[Player]
ActionAPI
Move shop to another agentPATCH /super-agent/shops/:id/move
Move player to another shopPATCH /super-agent/players/:id/move
Suspend/unsuspend agentPATCH .../agents/:id/suspend|unsuspend

2. Create & configure Agent

Create new agent at /agents/new:

  • Username, email, password, cost rate
  • Popup permissions
  • Game mappings

Agent detail (/agents/:agentId):

  • Update rate, password, name
  • Distribute/withdraw credits
  • Enable/disable game providers

3. Wallet & Credits

Buy credits

  • Crypto (Zerox static wallets) or USD → credits
  • Payment return: /payment/return

Credit distribution

FlowAPI
Super Agent → Managed AgentPOST /super-agent/agents/:id/credits/distribute
Super Agent → ShopPOST /agent/credits/distribute
Withdraw from agentPOST /super-agent/agents/:id/credits/withdraw

4. Shop governance

  • Create shop (POST /agent/shops)
  • Suspend/unsuspend, change password, popup permission
  • View separate CDN wallet + USD wallet ledger
  • Update cost rate (PATCH /super-agent/shops/:id/rates)

5. USD crypto withdrawal

Flow similar to Agent Portal:

  1. Check OTP eligibility
  2. Send/verify OTP
  3. Preview fees
  4. Create withdrawal

Limits: GET /super-agent/portal-withdrawal-limits


6. Fraud & Communication

  • Fraud: filter by shop, profit analysis, resolve
  • Broadcast: receive via bell, send if can_delegate_popups
  • Popup: modes once / sticky_daily

7. Comparison with Agent Portal

FeatureSuper AgentAgent
Agent management✅ Create, suspend, rates
Move shop/player
Shop management✅ System-wide✅ Own shops
Create shop
Game mappings (agent level)✅ (shop level)
Provider feesRead-onlyRead-only

Implementation notes

  1. Dev port 3003 — avoids clash with admin (3000); note agent also uses 3003 in .env.example.
  2. API prefix /super-agent-auth and /super-agent/* — not /agent-auth.
  3. Repo README may be outdated — prefer actual code.
  4. Backend CORS: add domain to domains table or DISABLE_CORS=true for dev.