Prerequisites
- You are the bot owner (OWNER_TELEGRAM_ID) — /extend is owner-only
- The target user's license email
- Admin dashboard access at
/admin/licenses(for UI mode)
Walkthrough
When to extend a license
Extensions are free gestures you grant to keep customers happy and nodes running. Typical use cases:
- Payment delay — bank transfer clearing or Stripe hold (7 days)
- Trial evaluation — prospect needs more time to decide (14–30 days)
- Referral reward — thank a customer who brought a new node (30 days)
- Bug-bounty compensation — reward for a responsibly disclosed issue
- Partner pilot / enterprise eval — up to 90 days
Payment vs extension
Extensions are free — they do not move DZIT or charge the wallet. Use /up for paid renewals.
Issue an extension via the bot
Open @biznode_bot on Telegram. Send:
Examples:
The bot POSTs to api_license_extend.php on the VPS, which updates the license row and writes an entry to the license_extensions audit table. You get back a confirmation with the new expiry.
Issue via the dashboard
Prefer clicking? Open https://<admin>/admin/licenses (linked from the orange Admin Tools dropdown). You'll see every license with its expiry date.
- Click +30d / +60d / +90d for instant grants
- Click Custom… to enter any day count (1–90) and a reason
- The License Manager writes the same audit trail as the bot command
Same endpoint under the hood
Both paths call POST /api_license_extend.php — so bot and dashboard stay in sync and dedupe naturally.
The 90-day-per-call rule
Each call adds up to 90 days. The system rejects any single request larger than that. Why?
- Safety rail — prevents typos like
/extend bob@biz.com 3000from nuking billing - Audit clarity — multiple small extensions tell a clearer story than one giant one
- No hard cap overall — you can re-extend as many times as needed
Client-side pickup behaviour
Client nodes are event-driven — they do not poll. When you extend, the client picks up the new expiry on:
- Boot — every service start checks the license
- Daily 09:00 UTC — scheduled via APScheduler (
_run_daily_license_check) - Urgency mode — when <7 days remain, checks bump to every 6 hours so extensions land fast
- Offline — cached value is used; after 7 days offline without contact, a fail-open grace kicks in so the bot never dies from a network blip
Audit trail — license_extensions table
Every extension — whether from bot or dashboard — writes a row to the license_extensions table on the VPS:
Fields captured:
- admin_id — the Telegram user ID (or dashboard session user) that issued the grant
- reason — free-text explanation provided with the request
- source —
botordashboard - new_expiry — ISO timestamp after the extension was applied
Alerting
The scheduler runs _run_license_expiry_alerts daily at 08:00 UTC and sends the owner a Telegram list of any licenses expiring in 7 / 3 / 1 days — so you never miss a renewal window.
Endpoints reference
- POST
/api_license_extend.php— admin only, requiresX-Admin-Keyheader, body{email, days, reason, admin_id} - GET
/api_license_check.php?email=<email>— public, returns current expiry and days remaining - GET
/api_licenses_list.php— admin, full license list used by the dashboard and expiry-alert job
Next Steps
Try /extend now
Open @biznode_bot and run /extend <email> <days> [reason]. You must be the registered bot owner.