1. System Overview
Architecture: Client-server system with HighLevel CRM integration, distributing real-time signals via API polling (100ms) to customer EAs.
graph TB
TV[TradingView Alert] -->|Webhook| SERVER[Central Server]
HL[HighLevel CRM] -->|Auto Sync| SERVER
SERVER -->|Signals via API| EA1[Client EA - License 1]
SERVER -->|Signals via API| EA2[Client EA - License 2]
SERVER -->|Signals via API| EA3[Support/Admin EA - Test/Use]
ADMIN[๐ Admin] -->|Full Control| SERVER
SUPPORT[๐ง Support] -->|Limited Access| SERVER
CLIENT[๐ค Client] -->|Self-Manage| SERVER
SERVER --> DB[(Database)]
SERVER --> REDIS[(Redis Cache)]
style SERVER fill:#4CAF50,color:#fff
style ADMIN fill:#f44336,color:#fff
style SUPPORT fill:#2196F3,color:#fff
style CLIENT fill:#9C27B0,color:#fff
style DB fill:#FF9800,color:#fff
style REDIS fill:#FF5722,color:#fff
Main Components
| Component |
Role |
Technology |
| TradingView |
Send alerts when signals trigger |
HTTPS Webhook |
| HighLevel CRM |
Customer & order management |
REST API Sync |
| Central Server |
Process logic, distribute signals |
FastAPI + PostgreSQL + Redis |
| Client EA |
Execute trades on MT4/MT5 |
MQL5 + WebRequest (polling 100ms) |
| Client Portal |
Management interface for clients |
React + TypeScript |
2. User Roles & Permissions
Admin (Full Access)
Dashboard Access:
- View all customers (purchased & not_purchased)
- Filter by: purchase_status, account_status, subscription_status
- View full email & phone numbers
- Revenue reports (weekly/monthly)
- System metrics
Client Management:
- Add/Edit/Delete customers
- Verify new customers manually
- Override auto-renewal
- Bulk renewal for multiple customers
- View complete purchase history
Credentials:
- Unlimited personal credentials
- Can create test signals for development
- View all client credentials
Support (Limited Access)
Dashboard Access:
- View assigned customers only
- Filter by status
- View masked email & phone (
abc***123@โขโขโข.com)
- Search all customer data
Client Management:
- Create new customer on HighLevel โ Refresh โ Verify
- Edit customer info (name, notes)
- Update subscription status
- Cannot delete customers
Credentials:
- Max 20 credentials personal
- For real trading/testing (not fake test)
- Completely separate from client credentials
Client (Self-Service)
Dashboard Access:
- View own subscription status
- View purchased products
- View signal history
Credentials:
- Max 5 licenses MT4/MT5
- Add/remove licenses self-service
- View API keys & Webhook URLs (with re-authentication)
- Copy webhook URL for TradingView setup
Products:
- View purchased products
- View expiry dates
- View auto-renewal status
- Cannot purchase in portal (redirect to sales page)
3. Status System
Important: The system has 3 separate status types to manage customer lifecycle.
3.1. Purchase Status
| Status |
Meaning |
When |
| purchased |
Customer has purchased product |
After successful payment |
| not_purchased |
Customer hasn't purchased (lead or expired) |
New record or after expiration |
3.2. Account Status
| Status |
Meaning |
Next Action |
| new |
Purchased but hasn't set password |
Waiting for client to verify email & set password |
| verified |
Password set, can login |
Client can access portal |
| active |
Subscription is active |
Receiving signals |
| expired |
Subscription has expired |
Needs renewal to continue |
3.3. Subscription Status
| Status |
Meaning |
Auto-Renewal |
| active |
Currently using service |
Can auto-renew |
| trial |
On trial period |
No auto-renew |
| cancelled |
Cancelled |
No auto-renew |
| expired |
Expired |
No auto-renew |
4. Client Registration Flows
2 Registration Methods: Client self-registration (no approval needed) OR Support manual creation.
4.1. Flow 1: Self-Registration (No Support approval)
sequenceDiagram
participant C as Client
participant HL as HighLevel
participant SYS as System
participant EMAIL as Email Service
participant PORTAL as Client Portal
C->>HL: 1. Purchase product
HL->>SYS: 2. Webhook: New purchase
SYS->>SYS: 3. Create customer record
Note over SYS: purchase_status: purchased
account_status: new
HL->>C: 4. Send invoice email
Note over HL,C: Email contains link:
example.com/lets-verify
C->>PORTAL: 5. Click verify link
PORTAL->>C: 6. Enter email
PORTAL->>EMAIL: 7. Generate & send OTP
EMAIL->>C: 8. Receive OTP (6 digits)
C->>PORTAL: 9. Enter OTP
PORTAL->>SYS: 10. Verify OTP
SYS->>PORTAL: 11. OTP valid
C->>PORTAL: 12. Set password
PORTAL->>SYS: 13. Hash & save password
Note over SYS: account_status: verified
PORTAL->>C: 14. Success! Redirect to login
C->>PORTAL: 15. Login
PORTAL->>C: 16. Access Dashboard
Key Points:
- No Support approval - fully automated
- Client completes setup independently
- OTP expires after 10 minutes
- Password requirements: min 8 chars, 1 uppercase, 1 number, 1 special char
4.2. Flow 2: Support Creates Customer (Manual)
sequenceDiagram
participant C as Client
participant SUP as Support
participant HL as HighLevel
participant SYS as System
participant EMAIL as Email Service
participant PORTAL as Client Portal
C->>SUP: 1. Request service (phone/email)
SUP->>HL: 2. Create customer record manually
Note over HL: Fill: name, email, phone, product
SUP->>SYS: 3. Click "Refresh Data"
SYS->>HL: 4. Fetch new records
HL->>SYS: 5. Return new customer data
SYS->>SYS: 6. Create customer record
Note over SYS: purchase_status: not_purchased
account_status: new
SUP->>SYS: 7. Find customer in list
SUP->>SYS: 8. Click "Send Verify Link"
SYS->>EMAIL: 9. Send verification email
Note over EMAIL: example.com/lets-verify?token=xxx
EMAIL->>C: 10. Receive verify email
C->>PORTAL: 11. Click verify link
PORTAL->>C: 12. Enter OTP from email
C->>PORTAL: 13. Enter OTP
PORTAL->>SYS: 14. Verify OTP
C->>PORTAL: 15. Set password
PORTAL->>SYS: 16. Hash & save password
Note over SYS: account_status: verified
purchase_status: purchased
PORTAL->>C: 17. Success! Redirect to login
C->>PORTAL: 18. Login
C->>PORTAL: 19. Add MT4/MT5 licenses
Key Points:
- Support creates on HighLevel first
- Refresh data to sync to system
- Support clicks "Send Verify Link" - system sends email automatically
- Client receives email and completes verification + password setup
- High security - Support never knows client's password
5. Admin Features
5.1. Dashboard with Filters
graph LR
DASH[Admin Dashboard] --> FILTER[Filters]
FILTER --> F1[Purchase Status]
FILTER --> F2[Account Status]
FILTER --> F3[Subscription Status]
FILTER --> F4[Date Range]
FILTER --> F5[Product Type]
style DASH fill:#f44336,color:#fff
style FILTER fill:#FF9800,color:#fff
5.2. Product Management
Features: Admin can sync products from HighLevel and configure auto-renewal for each product individually.
Main Functions:
- Sync product list from HighLevel
- View all products
- Enable/disable auto-renewal per product
- View number of active customers
- Display price from HighLevel (read-only)
5.3. Bulk Renewal
Powerful Feature: Admin can select multiple customers and renew them all at once - useful for combo purchases or promotions.
Bulk Renewal Process:
flowchart TD
START[Admin Dashboard] --> SELECT[Select customers to renew]
SELECT --> CHECK[โ Checkbox: select multiple]
CHECK --> BTN[Click Bulk Renew button]
BTN --> MODAL[Show configuration popup]
MODAL --> CONFIG{Configure renewal}
CONFIG --> C1[Select product to renew]
CONFIG --> C2[Enter days: 30/60/90]
CONFIG --> C3[Note reason for renewal]
CONFIG --> C4[Send email notification?]
C1 --> PREVIEW[Preview list]
C2 --> PREVIEW
C3 --> PREVIEW
C4 --> PREVIEW
PREVIEW --> CONFIRM{Confirm?}
CONFIRM -->|Cancel| CANCEL[Close popup]
CONFIRM -->|OK| PROCESS[Process bulk renewal]
PROCESS --> LOOP[Loop each customer]
LOOP --> UPDATE1[Update subscription_end]
UPDATE1 --> UPDATE2[Update HighLevel]
UPDATE2 --> UPDATE3[Log audit trail]
UPDATE3 --> EMAIL{Send email?}
EMAIL -->|Yes| SEND[Send notification email]
EMAIL -->|No| SKIP[Skip]
SEND --> NEXT[Next customer]
SKIP --> NEXT
NEXT --> DONE{End of list?}
DONE -->|No| LOOP
DONE -->|Yes| RESULT[Display results]
RESULT --> SUMMARY[Success: X customers
Failed: Y customers
Total: Z customers]
style START fill:#f44336,color:#fff
style PROCESS fill:#2196F3,color:#fff
style RESULT fill:#4CAF50,color:#fff
Main Features:
| Feature |
Description |
| Multiple Selection |
Checkbox per customer, or "Select all" on page |
| Pre-Filter |
Filter by product/status then bulk select |
| Flexible Configuration |
Select specific product + renewal days |
| Preview |
Review list before execution |
| Parallel Processing |
Fast processing with background job |
| Detailed Report |
Success/Failure/Reason for each customer |
| Audit Trail |
Log: who, when, renewed whom, how many days |
Use Cases:
- Combo Promotion: 50 customers buy 3-month combo โ renew all 90 days at once
- Monthly Bonus: Give extra 7 days to all active customers
- Issue Compensation: Server down 2 days โ Add 2 days to affected group
- Enterprise: Company buys 20 licenses โ Renew all at once
5.4. Revenue Reports
| Report Type |
Content |
Display |
| Total Revenue |
This week, This month, Compare with last period |
Line Chart |
| Customers |
New customers, Active, Churned |
Bar Chart |
| By Product |
Revenue per product |
Pie Chart |
5.5. Layout Customization
Layout Builder: Admin can customize the dashboard interface for Clients and workspace for Support using drag & drop tools.
Available Widgets:
- Subscription Status Card
- Signals Today Counter
- License Usage Gauge
- Quick Actions Panel
- Recent Signals Table
- Product Expiry Alert
6. Support Features
6.1. Dashboard with Masked Data
Security: Support only sees masked email and phone numbers to protect customer information.
| Information |
Admin Sees |
Support Sees |
| Email |
customer (full address) |
cus***mer (masked) |
| Phone |
+00 000 000 000 |
+00 ***000*** |
| Name |
Full display |
Full display |
| Status |
Full display |
Full display |
6.2. Customer Verification Process
Steps:
- Support creates customer record on HighLevel
- Click "Refresh Data" button on dashboard
- System syncs and displays new customer
- Support clicks "Verify Customer"
- System automatically updates status
- Support contacts customer to provide login information
6.3. Personal Credentials (20 max)
- Support can create up to 20 credentials of their own
- Used for real trading or system testing
- Completely separate from client credentials
- Does not affect customer quota
7. Client Portal Features
7.1. Dashboard Overview
graph TD
subgraph DASHBOARD["๐ CLIENT DASHBOARD"]
D1[Welcome, Customer Name]
D2[Account Status: verified]
D3[Subscription Status: active]
D4[Expires: Jan 15, 2025]
end
subgraph STATS["๐ QUICK STATS"]
S1[Signals Today: 5]
S2[Signals This Week: 35]
S3[Licenses: 3/5 used]
S4[Auto-Renewal: ON]
end
style DASHBOARD fill:#e3f2fd
style STATS fill:#e8f5e9
7.2. Products Tab
Active Products:
Trendline Pro 2.0
โข Status: โ Active
โข Purchased: Dec 15, 2024
โข Expires: Jan 15, 2025 (30 days left)
โข Auto-renewal: โ
ON
Download EA |
View Details
Expired Products:
Breakout Strategy
โข Status: โ Expired
โข Purchased: Nov 1, 2024
โข Expired: Dec 1, 2024
Renew Subscription โ (redirect to sales page)
8. Credentials Management
8.1. Quota Per Role
| Role |
Quota |
Purpose |
Separate? |
| Client |
5 licenses |
MT4/MT5 licenses for trading |
- |
| Support |
20 credentials |
Testing & personal use |
โ
Separate from clients |
| Admin |
Unlimited |
Development & production |
โ
Separate from clients |
8.2. Client Add License Flow
Steps:
- Client logs into portal
- Go to "Credentials" tab
- Click "+ Add License" button
- Fill form: Platform (MT4/MT5), Account ID, Broker, Label
- System validates (check quota, duplicates)
- If valid: Create API key + Webhook URL
- Display credentials (client needs to copy immediately)
- Client sets up TradingView alert + EA
8.3. API Key View Security
Re-authentication: When client wants to view API key again, must re-authenticate with password OR OTP via email.
Security Flow:
- Client clicks "View API Key"
- System requires: Enter password OR Enter OTP from email
- If correct: Display full API key for 30 seconds
- After 30 seconds: Auto-hide again
- Log: IP, time, action in audit trail
9. Purchase History
9.1. Access
- Admin: View all purchase history
- Support: View history of assigned customers
- Client: No access (redirect to sales page to view invoices)
9.2. Data Source
Auto Sync: System syncs purchase history from HighLevel every 5 minutes via cron job.
9.3. Display Columns
| Column |
Description |
| Date |
Purchase date |
| Customer Name |
Full name |
| Email |
Admin: full | Support: masked |
| Product |
Product name purchased |
| Amount |
Order value |
| Status |
completed / refunded / cancelled |
| HighLevel Order ID |
Order ID from HighLevel |
9.4. Filters
- Date range
- Product
- Price range
- Customer name
- Order status
9.5. Data Export
Export CSV: Admin can export all purchase history to CSV file for analysis or archiving.
10. Product Management
10.1. Sync from HighLevel
How it works:
- Admin clicks "Sync from HighLevel" button
- System calls HighLevel API:
GET /products
- Compare with local database
- Add new products, update changed information
- Display sync results
10.2. Product Information
| Field |
Source |
Can Admin Edit? |
| Product name |
HighLevel |
โ Read-only |
| Price |
HighLevel |
โ Read-only |
| Description |
HighLevel |
โ Read-only |
| Auto-renewal |
System |
โ
Can enable/disable |
| Renewal days |
System |
โ
Can set (30/60/90) |
10.3. Auto-Renewal Configuration
Renewal Rules: Admin can configure auto-renewal for each product individually.
Parameters:
- Enable/Disable: Toggle ON/OFF
- Renewal days: 30, 60, or 90 days
- Email notification: Yes/No
- Condition: Only renew when
payment_status = paid on HighLevel
11. Revenue Reports
11.1. Total Revenue
| Period |
Revenue |
Comparison |
| This Week |
$โข,โขโขโข |
+12% โฒ |
| This Month |
$โข,โขโขโข |
+15% โฒ |
11.2. Customers
| Metric |
Count |
Change |
| New this week |
8 |
+2 vs last week |
| New this month |
35 |
+10 vs last month |
| Currently active |
120 |
- |
11.3. Revenue by Product
| Product |
Revenue This Month |
% of Total |
| Trendline Pro |
$โข,โขโขโข |
66% |
| Breakout Strategy |
$โข,โขโขโข |
34% |
11.4. Charts
- Line Chart: Revenue trend over last 30 days
- Bar Chart: New customers per week
- Pie Chart: Revenue distribution by product
12. Layout Customization
Layout Builder: Admin can customize dashboard interface for Clients and workspace for Support using visual drag & drop tools.
12.1. Client Dashboard Customization
Available Widgets:
| Widget |
Description |
Size |
| Subscription Status Card |
Display status and expiry date |
4x2 |
| Signals Counter |
Signals today/week |
4x2 |
| License Gauge |
3/5 licenses used |
4x2 |
| Quick Actions Panel |
Buttons: Add License, View API Keys |
6x2 |
| Recent Signals Table |
Last 10 signals |
12x4 |
| Expiry Alert |
Products expiring soon |
6x2 |
Actions:
- Drag & Drop: Move widgets to desired position
- Resize: Drag corner to resize widget
- Show/Hide: Toggle visibility for each widget
- Reorder: Drag to rearrange widgets
12.2. Support Workspace Customization
Customer Table Configuration:
| Column |
Display |
Width |
Masked? |
| Customer Name |
โ |
200px |
โ |
| Email |
โ |
250px |
โ
Masked |
| Phone |
โ |
150px |
โ
Masked |
| Status |
โ |
120px |
โ |
| Subscription Expires |
โ |
150px |
โ |
Default Filters:
- Show active customers first
- Hide expired > 90 days
- Sort by expiry date (nearest first)
13. Database Schema
Note: This schema shows main tables only. See original markdown file for complete schema with all indexes and relationships.
13.1. Main Tables
-- USERS & AUTHENTICATION
users (Admin/Support)
โโโ id, email, password_hash, role (admin/support)
client_users (Client accounts)
โโโ id, customer_id, email, password_hash
โโโ account_status (new/verified/active/expired)
-- CUSTOMERS
customers
โโโ id, name, email, phone
โโโ purchase_status (purchased/not_purchased)
โโโ subscription_status (active/trial/cancelled/expired)
โโโ subscription_start, subscription_end
โโโ highlevel_id
-- PRODUCTS
products
โโโ id, name, highlevel_product_id, price
โโโ auto_renewal_enabled, auto_renewal_days
customer_products (Many-to-many relationship)
โโโ customer_id, product_id
โโโ purchase_date, expiry_date, auto_renewal
-- PURCHASE HISTORY
purchase_history
โโโ customer_id, product_name, amount
โโโ purchase_date, highlevel_order_id, status
-- CREDENTIALS
client_licenses (Max 5 per client)
โโโ customer_id, platform (MT4/MT5), account_id
โโโ api_key_hash, webhook_url, is_active
support_credentials (Max 20 per support)
โโโ support_user_id, platform, account_id
โโโ api_key_hash, webhook_url, is_active
admin_credentials (Unlimited)
โโโ admin_user_id, platform, account_id
โโโ api_key_hash, webhook_url, is_active
-- SIGNALS
signals
โโโ symbol, action, entry_price, stop_loss
โโโ take_profit_1, take_profit_2, take_profit_3
signal_deliveries
โโโ signal_id, customer_id, license_id
โโโ delivered_at, status (delivered/failed/pending)
-- SECURITY
otp_codes
โโโ email, code_hash, purpose
โโโ expires_at, attempts, used
-- LAYOUT CUSTOMIZATION
layout_settings
โโโ role, view_name, config (JSON)
โโโ created_by, is_active
-- AUDIT LOGS
audit_logs
โโโ user_id, user_type, action
โโโ resource_type, ip_address, created_at
13.2. Important Indexes
idx_customers_email - Fast search by email
idx_customers_purchase_status - Filter by purchase status
idx_client_licenses_api_key_hash - Fast API key authentication
idx_signals_sent_at - Filter signals by time
idx_purchase_history_date - Revenue reports by date
14. Workflow Diagrams
14.1. Auto-Renewal Workflow
Schedule: Cron job runs daily at 00:00 to check and auto-renew.
flowchart TD
START([Daily Cron 00:00]) --> CHECK[Query customers]
CHECK --> QUERY{subscription_end
= today OR tomorrow?}
QUERY -->|No| END1[Skip]
QUERY -->|Yes| GET[Get customer details]
GET --> PURCHASE{purchase_status?}
PURCHASE -->|not_purchased| SKIP[Skip auto-renewal]
PURCHASE -->|purchased| PRODUCT[Get customer products]
PRODUCT --> LOOP[Loop each product]
LOOP --> AUTO{Product
auto_renewal_enabled?}
AUTO -->|No| SKIP2[Skip this product]
AUTO -->|Yes| PAYMENT{Payment status
from HighLevel?}
PAYMENT -->|paid| EXTEND[Extend subscription]
PAYMENT -->|unpaid/failed| REVOKE[Revoke access]
EXTEND --> EXT_DB[Update database]
EXT_DB --> EXT_DATE[subscription_end += 30 days]
EXT_DATE --> EXT_HL[Update HighLevel]
EXT_HL --> EXT_EMAIL[Send renewal email]
EXT_EMAIL --> LOG1[Log: Renewed successfully]
REVOKE --> REV_DB[Update database]
REV_DB --> REV_STATUS[subscription_status: expired]
REV_STATUS --> REV_LICENSE[Deactivate all licenses]
REV_LICENSE --> REV_HL[Update HighLevel]
REV_HL --> REV_EMAIL[Send expiry email]
REV_EMAIL --> LOG2[Log: Expired]
LOG1 --> END2[Complete]
LOG2 --> END2
SKIP --> END2
SKIP2 --> END2
END1 --> END2
style START fill:#4CAF50,color:#fff
style EXTEND fill:#2196F3,color:#fff
style REVOKE fill:#f44336,color:#fff
14.2. Signal Distribution Workflow
Real-time: EA polls every 100ms to receive signals immediately when available.
sequenceDiagram
participant TV as TradingView
participant SERVER as Server
participant REDIS as Redis Cache
participant DB as Database
participant EA as Client EA
TV->>SERVER: POST /webhook Alert
SERVER->>SERVER: Validate webhook
SERVER->>DB: Save to signals table
SERVER->>DB: Get active customers
DB->>SERVER: Return list
loop Each Active Customer
SERVER->>DB: Get customer licenses
loop Each License
SERVER->>REDIS: Store signal
Note over REDIS: TTL: 60 seconds
SERVER->>DB: Log to signal_deliveries
end
end
Note over EA: EA polls every 100ms
EA->>SERVER: GET /signal/{api_key}
SERVER->>REDIS: Check key
alt Signal exists
REDIS->>SERVER: Return signal
SERVER->>REDIS: Delete key
SERVER->>DB: Update: delivered
SERVER->>EA: Return signal JSON
EA->>EA: Execute trade
else No signal
SERVER->>EA: Return {}
end
15. Security Features
15.1. Password Requirements
- Minimum 8 characters
- At least 1 uppercase letter (A-Z)
- At least 1 lowercase letter (a-z)
- At least 1 number (0-9)
- At least 1 special character (!@#$%^&*)
- Cannot be same as email
- Cannot be common password
15.2. OTP System
| Attribute |
Value |
| Length |
6 digits |
| Expiration |
10 minutes |
| Max attempts |
3 times |
| New OTP after fail |
Auto-generate new |
| Rate limit |
Max 5 OTP/hour/email |
15.3. API Key Security
- Generation: 32-byte random string (
secrets.token_urlsafe)
- Storage: SHA-256 hash only (never store plain key)
- Transmission: HTTPS only
- Rotation: Admin can regenerate keys
- Revocation: Instant (mark as deleted)
15.4. Session Security
| Mechanism |
Description |
| JWT Token |
Expires after 24 hours |
| Refresh Token |
Expires after 30 days |
| HttpOnly Cookie |
Prevents XSS attacks |
| Secure Flag |
HTTPS only |
| SameSite=Strict |
Prevents CSRF attacks |
| IP Binding |
Detect session hijacking |
| Device Fingerprinting |
Alert on new device login |
15.5. Rate Limiting
| Endpoint |
Limit |
| Login |
Max 5 times / 15 minutes / IP |
| API (EA) |
10 requests / second / API key |
| OTP Request |
Max 5 times / hour / email |
| Password Reset |
Max 3 times / day / email |
16. API Endpoints
16.1. Public Endpoints (No authentication)
POST /api/v1/webhook
- Receive alerts from TradingView
- Header: X-Webhook-Signature (HMAC validation)
POST /api/v1/verify/email
- Send email to get OTP
- Rate limit: 5/hour
POST /api/v1/verify/otp
- Verify OTP code
- Rate limit: 3 attempts
POST /api/v1/verify/password
- Set password after OTP verification
16.2. Client Endpoints (JWT authentication)
GET /api/v1/signal/{api_key}
- EA polls for signals
- Rate limit: 10/second
- Return: JSON signal or {}
GET /api/v1/client/dashboard
GET /api/v1/client/products
GET /api/v1/client/licenses
POST /api/v1/client/licenses
DELETE /api/v1/client/licenses/{id}
GET /api/v1/client/signals/history
GET /api/v1/client/settings
PUT /api/v1/client/settings
16.3. Support Endpoints (JWT + Role check)
GET /api/v1/support/customers
- Email & phone masked
- Assigned customers only
GET /api/v1/support/customers/{id}
PUT /api/v1/support/customers/{id}
POST /api/v1/support/customers/sync
POST /api/v1/support/customers/{id}/verify
GET /api/v1/support/credentials
POST /api/v1/support/credentials
DELETE /api/v1/support/credentials/{id}
GET /api/v1/support/purchase-history
16.4. Admin Endpoints (JWT + Admin role)
GET /api/v1/admin/customers
- Full email & phone visibility
- All customers
GET /api/v1/admin/customers/{id}
POST /api/v1/admin/customers
PUT /api/v1/admin/customers/{id}
DELETE /api/v1/admin/customers/{id}
GET /api/v1/admin/products
POST /api/v1/admin/products/sync
PUT /api/v1/admin/products/{id}
GET /api/v1/admin/reports/revenue
GET /api/v1/admin/reports/customers
GET /api/v1/admin/purchase-history
GET /api/v1/admin/layouts
PUT /api/v1/admin/layouts/{role}
GET /api/v1/admin/credentials
POST /api/v1/admin/credentials
POST /api/v1/admin/bulk-renew
- Bulk renewal
- Body: {
"customer_ids": [1, 2, 3, ...],
"product_id": 5,
"days": 30,
"reason": "Combo promotion Q1",
"send_email": true
}
- Return: {
"success": 45,
"failed": 2,
"total": 47,
"details": [...]
}
โ