-
Notifications
You must be signed in to change notification settings - Fork 0
09 Sales Bot API EN
loopy-iri edited this page Jun 25, 2026
·
1 revision
🇬🇧 English · 🇮🇷 فارسی
The external sales bot owns the money/wallet logic; the panel only manages bytes/time/status. The bot talks to the panel via REST API and webhooks.
All /api/v1/... routes are protected by a Bearer token:
Authorization: Bearer <PANEL_TOKEN>
Interactive docs (Swagger): http://PANEL_IP:8080/docs.
- A user buys in the bot.
- Bot →
POST /api/v1/customers(if new;external_ref= the user's id in the bot). - Bot →
POST /api/v1/customers/{id}/subscriptionswithplan_idandnode_id→ getsapi_keyandnode_address(only once). - Bot delivers to the user:
node_address(gRPC), the node certificate, andapi_key. - Tracks usage via webhook or
GET /api/v1/customers/{id}/usage. - On renew/topup:
renewortopup-quota. On debt:suspend/disable.
| Action | Method & path |
|---|---|
| Create customer | POST /api/v1/customers |
| Create subscription (customer key) | POST /api/v1/customers/{id}/subscriptions |
| Customer connection info (gRPC/cert/inbounds) | GET /api/v1/subscriptions/{id}/connection |
| Node detail (host/ports/cert) | GET /api/v1/nodes/{id} |
| Node shareable inbounds | GET /api/v1/nodes/{id}/inbounds |
| Live node config | GET /api/v1/nodes/{id}/config |
| Customer usage (+overage) | GET /api/v1/customers/{id}/usage |
| Suspend/resume subscription |
POST /api/v1/subscriptions/{id}/suspend | /resume
|
| Add quota | POST /api/v1/subscriptions/{id}/topup-quota |
| Renew | POST /api/v1/subscriptions/{id}/renew |
| Enable/disable customer |
POST /api/v1/customers/{id}/enable | /disable
|
| Create plan/node |
POST /api/v1/plans | /api/v1/nodes
|
Register an endpoint:
curl -X POST http://PANEL_IP:8080/api/v1/webhooks \
-H "Authorization: Bearer $PANEL_TOKEN" -H "Content-Type: application/json" \
-d '{"url":"https://bot.example.com/hook","secret":"<SHARED_SECRET>","events":"*"}'- The panel signs each event body with HMAC-SHA256 (using
secret) in the signature header. - The bot must recompute and verify the signature with the same secret to reject forgeries.
- Use these events to deduct the wallet when thresholds/overage are crossed.
- Keep the panel token and webhook secrets private.
- Put the panel behind TLS.
- The customer
api_keyis returned only once at subscription creation; deliver it securely (it can't be retrieved again; if lost, delete and recreate the subscription).
اپراتور
- ۱) نصب پنل
- ۲) نصب نود
- ۳) افزودن نود و فروش
- تنظیم هستهی نود (Xray)
- استفادهی شخصی + فروش
- آپدیت و نگهداری
- عیبیابی
مشتری
توسعهدهنده
Operator
- 1) Install the panel
- 2) Install a node
- 3) Add a node & sell
- Configure the node core (Xray)
- Personal use + selling
- Update & maintenance
- Troubleshooting
Customer
Developer