================================================================ LITEROUTER RESELLER API - QUICK START GUIDE ================================================================ You have been granted API access to activate and manage user plans and permanent credits on behalf of LiteRouter. Keep your secret key private and do not share it with anyone. ---------------------------------------------------------------- YOUR CREDENTIALS ---------------------------------------------------------------- API Base URL : https://literouter.com Secret Key : (provided separately) ---------------------------------------------------------------- AVAILABLE ENDPOINTS ---------------------------------------------------------------- 1. Activate / Upgrade / Renew a Plan POST /tier_upgrade.php Top Up Permanent Credits POST /tier_upgrade.php 2. View Your Activation History GET /tier_upgrade_history.php ---------------------------------------------------------------- 1. ACTIVATE / UPGRADE / RENEW A PLAN, OR TOP UP CREDITS ---------------------------------------------------------------- Method : POST URL : https://literouter.com/tier_upgrade.php Header : Authorization: Bearer YOUR_SECRET_KEY Header : Content-Type: application/json Request Body: { "entries": [ { "identifier": "user@example.com", "plan": "pro" }, { "identifier": "johndoe", "plan": "elite" }, { "identifier": "janedoe", "topup_usd": 10 } ] } - identifier : user's email OR username (email is checked first) - plan : standard / plus / pro / elite / ultimate / paramount / majestic / sovereign / nebula / galaxy / cosmos - topup_usd : permanent credits to add, in whole US dollars ($1 = 5,000 credits, from $3 to $500) Each entry has either "plan" or "topup_usd", not both. Quote first (dry run): Add "dry_run": true next to "entries" to see what a request would do and cost before you charge your customer. Every entry is checked and priced exactly like a real request, but nothing is changed and nothing is billed. Each result then has: status QUOTE (or SKIPPED / FAILED with the reason, as usual) amount_usd the price you would be billed would_be OK, UPGRADED, RENEWED or TOPPED_UP current_plan the user's plan now current_expires when the current plan ends (GMT+7), null on basic days_used days of the current plan used (prorated upgrades) new_expires the expiry after the request (GMT+7) Send the same request again without "dry_run" to apply it. A price can change if a day passes in between. Plan rules: - Upgrade : allowed anytime (lower -> higher tier). If the user is in the middle of a paid plan, the price is prorated: the unused part of the current plan is taken off the new plan's price. Price = new plan price - ((30 - days used) / 30) x current plan price rounded up to whole dollars, at least $1. The user gets a fresh 30 days of the new plan. Example: Pro ($10) bought 10 days ago, upgraded to Elite ($13): 13 - (20/30 x 10) = 6.33 -> $7. - Downgrade : NOT allowed - Renewal : allowed only if the current plan expires within 3 days. New expiry = current expiry + 30 days. If already expired, new expiry = today + 30 days. Renewals are full price. - Same plan with more than 3 days remaining -> request is skipped. Top-up rules: - Credits are added to the user's permanent credit balance. They do not expire and do not change the user's plan. - Each top-up returns a reference (for example "rs-R1-1a2b3c4d5e"). - Sending the same top-up again adds the credits again. If a request fails or times out, check your history before retrying. Example (Windows CMD - single line): curl -X POST "https://literouter.com/tier_upgrade.php" -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_SECRET_KEY" -d "{\"entries\":[{\"identifier\":\"user@example.com\",\"plan\":\"pro\"}]}" curl -X POST "https://literouter.com/tier_upgrade.php" -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_SECRET_KEY" -d "{\"entries\":[{\"identifier\":\"user@example.com\",\"topup_usd\":10}]}" Example quote (Windows CMD - single line): curl -X POST "https://literouter.com/tier_upgrade.php" -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_SECRET_KEY" -d "{\"dry_run\":true,\"entries\":[{\"identifier\":\"user@example.com\",\"plan\":\"elite\"}]}" Example (Linux / Mac): curl -X POST "https://literouter.com/tier_upgrade.php" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_SECRET_KEY" \ -d '{ "entries": [ { "identifier": "user@example.com", "plan": "pro" }, { "identifier": "user@example.com", "topup_usd": 10 } ] }' Response status values: OK - plan activated (from basic/free) UPGRADED - plan upgraded to a higher tier RENEWED - plan renewed (within 3-day renewal window) TOPPED_UP - permanent credits added QUOTE - dry run only: what would happen and its price; nothing changed SKIPPED - no changes made (see reason field) FAILED - validation error or user not found ERROR - unexpected server/database error Each result also has "amount_usd": what you are billed for it. ---------------------------------------------------------------- 2. VIEW YOUR ACTIVATION HISTORY ---------------------------------------------------------------- Method : GET URL : https://literouter.com/tier_upgrade_history.php Header : Authorization: Bearer YOUR_SECRET_KEY Query Parameters (all optional): date_from - start date, format YYYY-MM-DD (GMT+7) date_to - end date, format YYYY-MM-DD (GMT+7) plan - filter by plan name (e.g. pro), or "topup" for credit top-ups only page - page number, default 1 per_page - results per page, default 20, max 100 You will only see records made using YOUR secret key. Top-ups are listed with plan "topup" and their reference as invoice_number. A new top-up can take about a minute to appear. Examples (Windows CMD - single line): All history: curl -X GET "https://literouter.com/tier_upgrade_history.php" -H "Authorization: Bearer YOUR_SECRET_KEY" Filter by date: curl -X GET "https://literouter.com/tier_upgrade_history.php?date_from=2026-03-01&date_to=2026-03-31" -H "Authorization: Bearer YOUR_SECRET_KEY" Filter by date + plan: curl -X GET "https://literouter.com/tier_upgrade_history.php?date_from=2026-03-01&date_to=2026-03-31&plan=pro" -H "Authorization: Bearer YOUR_SECRET_KEY" Top-ups only: curl -X GET "https://literouter.com/tier_upgrade_history.php?plan=topup" -H "Authorization: Bearer YOUR_SECRET_KEY" With pagination: curl -X GET "https://literouter.com/tier_upgrade_history.php?page=2&per_page=10" -H "Authorization: Bearer YOUR_SECRET_KEY" ---------------------------------------------------------------- PLAN REFERENCE ---------------------------------------------------------------- Plan Price (USD) --------- ----------- Standard $3 Plus $6 Pro $10 Elite $13 Ultimate $17 Paramount $30 Majestic $43 Sovereign $56 Nebula $112 Galaxy $224 Cosmos $336 Permanent credits: $1 = 5,000 credits ($3 to $500 per top-up) ---------------------------------------------------------------- NOTES ---------------------------------------------------------------- - All timestamps are returned in both UTC and GMT+7 (WIB). - Dates for history filtering use GMT+7. - If your key is invalid or missing, you will receive HTTP 401. - You may pass multiple entries in one request (bulk activation). - Plans and top-ups are billed together in your reseller balance. - For any issues, contact your LiteRouter administrator. ================================================================