AITOOLSUBS RESELLER API — v1 ===================================== Sell our tools inside your own Telegram bot. Every order is paid from your prepaid wallet balance in our bot, and the codes/links come back instantly in the API response. Visual setup guide: https://aitoolsubs.com/reseller-api 1. SETUP -------- 1) Open our bot → API Key → Generate API Key. Copy the key (shown once). 2) Top up your wallet in our bot (Deposit → Binance Pay / Cryptomus). Orders are refused when your balance is too low — nothing is charged. 3) Store the key as a secret in your bot (env var), never in public code. Base URL: https://aitoolsubs.com/api/public/reseller Auth: Authorization: Bearer ats_live_xxxxxxxxxxxxxxxx Format: JSON. Prices in USDT. Limit: 60 requests per minute per key. 2. ENDPOINTS ------------ GET https://aitoolsubs.com/api/public/reseller/products → { "products": [ { "id", "name", "product", "plan", "price", "currency", "stock", "full_warranty", "needs_email" } ] } GET https://aitoolsubs.com/api/public/reseller/stock?product_id= → { "product_id", "stock", "price" } GET https://aitoolsubs.com/api/public/reseller/balance → { "balance": 25.40, "currency": "USDT" } POST https://aitoolsubs.com/api/public/reseller/order body: { "product_id": "", "quantity": 1, "external_order_id": "your-unique-id-123", "email": "only for needs_email plans" } → { "status": "delivered", "order_id": "4521", "external_order_id", "quantity": 1, "amount": 3.5, "balance": 21.9, "items": [ { "type": "code"|"link"|"file", "value": "...", "name"? } ] } status "processing" = manual plan (e.g. invite by email); items come empty and are sent later by our team. GET https://aitoolsubs.com/api/public/reseller/order?external_order_id=your-unique-id-123 → same shape as POST /order IMPORTANT: always send a unique external_order_id per customer order. Retrying with the same id never charges twice — you get the original delivery back ("idempotent_replay": true). 3. ERRORS --------- 400 bad request 401 invalid key 402 insufficient balance 403 key blocked 404 not found 409 out of stock 429 rate limited 500 server error Body: { "error": "message" } 4. EXAMPLE (Node.js / Telegraf / grammY) ---------------------------------------- const API = "https://aitoolsubs.com/api/public/reseller"; const KEY = process.env.AITOOLSUBS_API_KEY; async function api(path, init = {}) { const res = await fetch(API + path, { ...init, headers: { Authorization: "Bearer " + KEY, "Content-Type": "application/json" }, }); const data = await res.json(); if (!res.ok) throw new Error(data.error || res.status); return data; } // list products for your menu const { products } = await api("/products"); // when your customer pays you: const order = await api("/order", { method: "POST", body: JSON.stringify({ product_id, quantity: 1, external_order_id: "tg_" + userId + "_" + Date.now() }), }); for (const item of order.items) await ctx.reply(item.value); 5. EXAMPLE (Python) ------------------- import requests, os API = "https://aitoolsubs.com/api/public/reseller" H = {"Authorization": "Bearer " + os.environ["AITOOLSUBS_API_KEY"]} products = requests.get(API + "/products", headers=H).json()["products"] r = requests.post(API + "/order", headers=H, json={ "product_id": products[0]["id"], "quantity": 1, "external_order_id": "order-1001"}) print(r.json()) 6. cURL ------- curl -H "Authorization: Bearer $KEY" https://aitoolsubs.com/api/public/reseller/balance Support: contact us from the Support button in our bot.