REXO PRIME RESELLER API — SETUP & CODE GUIDE ========================================================= Sell our live catalogue of AI tools and digital subscriptions in your own bot, website or app. You make the sale; we handle stock, charging and delivery. Visual guide: https://rexoprime.com/api/docs Full reference: https://rexoprime.com/api/docs/reference/ OpenAPI spec: https://rexoprime.com/api/telegram-buyer/openapi.json Base URL: https://rexoprime.com/api/telegram-buyer Auth: X-API-Key: tgb_xxxxxxxxxxxxxxxx (or Authorization: Bearer tgb_...) Format: JSON. Prices in USDT. Every answer has "success": true or false. Limits: 120 reads and 40 orders a minute per key. 1. SETUP -------- 1) Get your key: in @rexoprimeshop_bot tap Bot API -> Get API Key (https://t.me/rexoprimeshop_bot?start=api), or sign in on the website and open Account -> API (https://rexoprime.com/account/api). 2) Save it as REXOPRIME_API_KEY in your server's secrets. Never put it in a browser or mobile app, a public repository or a URL. 3) Top up your wallet in the bot or on the website (Binance Pay, USDT, bKash or card), from 0.10 USDT. Every API order is paid from this balance. Top-ups are not part of the API. 4) GET /products: every product you can buy by API, with its id, your price, stock, quantity limits and what the buyer has to give. 5) POST /purchase with product_id, quantity and one unique client_order_id per customer order (plus the buyer's details when the product asks). 6) Send every line of delivered_items to your buyer. Not delivered yet? Ask GET /orders/{order_id} until "final" is true, or use the webhook. 2. ENDPOINTS ------------ GET https://rexoprime.com/api/telegram-buyer/products -> {"success": true, "products": [{"id", "name", "price", "currency", "stock", "infinite_stock", "min_purchase_quantity", "max_purchase_quantity" (0 = no limit), "requiresCustomerDetails", "customer_details_prompt", "requiresTelegramUsername", "description"}]} GET https://rexoprime.com/api/telegram-buyer/balance -> {"success": true, "balance": 25.4, "currency": "USDT", "api_profile": {...}} POST https://rexoprime.com/api/telegram-buyer/purchase body: {"product_id": 13, "quantity": 1, "client_order_id": "order-1001", "customer_payload": {"custom_details": "buyer@gmail.com"}} -> {"success": true, "order_id": 1234, "orderCode": "REXO7K3M9QP2", "delivery_status": "delivered" | "processing", "delivered_items": ["one line per unit"], "poll_after_seconds": 0, "total_price": 1.0, "balance": 24.4} The call waits up to 12 seconds for a delivery that is not instant; ?wait=0 answers at once, ?wait=55 waits longest. GET https://rexoprime.com/api/telegram-buyer/orders/{order_id} (or /orders/REXO7K3M9QP2) -> {"success": true, "delivery_status": "processing" | "manual" | "delivered" | "failed", "final": false, "delivered_items": [...], "refunded": false, "refund_amount": 0, "message": "...", "poll_after_seconds": 5} POST https://rexoprime.com/api/telegram-buyer/webhook (optional) body: {"webhook_url": "https://your-server/hook"} -> the signing secret, ONCE. Each callback: X-Signature: sha256=HMAC_SHA256(secret, raw_body). Verify it, and expect the same delivery more than once. 3. RULES THAT MATTER -------------------- - One client_order_id per customer order, the same on every retry (after a timeout too). A repeat answers {"success": true, "duplicate": true, "order_id": N} and is never charged twice. idempotency_key and an Idempotency-Key header work the same. - requiresCustomerDetails: ask the buyer customer_details_prompt and send the answer exactly as typed in customer_payload.custom_details. It is checked before anything is charged. - Telegram Premium / Stars (requiresTelegramUsername): send the recipient's @username as "username". For Stars, quantity is the number of Stars (from 50). - delivery_status: delivered = done; processing = ask again after poll_after_seconds; manual = our team delivers it by hand, check every few minutes; failed = it will not be delivered ("refunded": true means the money is back on your wallet). - Only products we deliver automatically are sold by API. If a paid order cannot be delivered, we deliver it by hand or refund it in full to your wallet. A refused call is never charged. - "price" in /products is exactly what you pay, your reseller discount included. 4. ERRORS --------- Body: {"success": false, "message": "...", "status": ""} 400 missing or invalid details: custom_details_required, custom_details_invalid_email, custom_details_invalid_link, telegram_username_required, or a quantity outside the limits 401 invalid key (or the wrong base URL: our keys work only on https://rexoprime.com) 403 not allowed: manual_delivery_not_available, a product your key may not buy, or a paused key 404 product not found (off sale or a wrong id: reload /products) 409 insufficient_balance (top up), out_of_stock / product_not_available, limit_exceeded, daily_spend_limit_reached 429 too many requests: wait, then retry with the same client_order_id 503 the API is switched off for a moment: try again later 5. EXAMPLE (Python) ------------------- import os, time, requests API = "https://rexoprime.com/api/telegram-buyer" HEADERS = {"X-API-Key": os.environ["REXOPRIME_API_KEY"]} def rexo(method, path, **kw): r = requests.request(method, API + path, headers=HEADERS, timeout=60, **kw) data = r.json() if not r.ok or data.get("success") is False: raise RuntimeError(data.get("status") or data.get("message") or "HTTP %s" % r.status_code) return data products = rexo("GET", "/products")["products"] order = rexo("POST", "/purchase", json={ "product_id": products[0]["id"], "quantity": 1, "client_order_id": "order-1001"}) for _ in range(24): if order.get("delivery_status") == "delivered" or order.get("final"): break time.sleep(order.get("poll_after_seconds") or 5) order = rexo("GET", "/orders/%s" % order["order_id"]) print(order.get("delivery_status"), order.get("delivered_items")) 6. cURL ------- curl -s -H "X-API-Key: $KEY" "https://rexoprime.com/api/telegram-buyer/balance" curl -s -X POST "https://rexoprime.com/api/telegram-buyer/purchase" -H "X-API-Key: $KEY" \ -H "Content-Type: application/json" \ -d '{"product_id": 13, "quantity": 1, "client_order_id": "order-1001"}' 7. LAUNCH CHECKLIST ------------------- [ ] The API key is stored in your server's secrets [ ] Products and balance load successfully [ ] Every checkout has its own stable client_order_id [ ] Delivered, processing, manual and failed results are handled [ ] 400, 409, 429 and 503 answers have clear fallbacks [ ] A low-value test order reads back through your customer screens