Main bot wallet API, version 1.2.0. Safe for reseller automation with per-user controls.
Base URL: https://rexoprime.com
Swagger UI: https://rexoprime.com/api/swagger/
OpenAPI JSON: https://rexoprime.com/api/telegram-buyer/openapi.json
If you are new: read this page first, then use Swagger to run real test calls.
Use this exact base URL in reseller panels:
https://rexoprime.com
A tgb_... key issued by Rexo Prime AI Tool Shop only validates on https://rexoprime.com. Do not send it to any other site.
| External panel field | Value |
|---|---|
| API name | Rexo Prime AI Tool Shop |
| Base URL | https://rexoprime.com |
| Products | GET /api/telegram-buyer/products |
| Balance | GET /api/telegram-buyer/balance |
| Purchase | POST /api/telegram-buyer/purchase |
| Overrides | GET/PUT/DELETE /api/telegram-buyer/products/<id>/overrides |
Browser integrations are supported. CORS is enabled for buyer API routes only.
Allowed product browse, own balance check, own wallet purchases.
Blocked admin data, other users, seller products, bypass attempts.
You can send the buyer key in one of these ways:
| Method | Example |
|---|---|
| Query | ?key=tgb_xxx |
| Query alias | ?api_key=tgb_xxx, ?apiKey=tgb_xxx, or ?token=tgb_xxx |
| Header | X-API-Key: tgb_xxx |
| Bearer | Authorization: Bearer tgb_xxx |
Key is tied to one buyer account. Rotate if leaked.
GET /api/telegram-buyer/products
Optional query params: category_id, q
Returns only main-bot products the key owner can buy.
GET /api/telegram-buyer/balance
Returns wallet + totals + effective API profile settings.
POST /api/telegram-buyer/purchase
JSON body fields:
| Field | Required | Type | Description |
|---|---|---|---|
| key / api_key | yes | string | Buyer API key. You can also send it as a header. |
| product_id | yes | integer/string | Main product ID from the products endpoint. Numeric strings are accepted. |
| quantity | no | integer | Default 1, must pass user + product limits. |
| client_order_id | no | string | Your external reference for reconciliation. |
| resell_unit_price | no | number | Optional reseller metadata, allowed only when enabled for that API user. |
| emails | seat only | array/string | Seat products require exactly one email per quantity. Alias: customer_email. |
| target_telegram_id | premium only | integer/string | Telegram Premium recipient numeric Telegram user ID. Best for Bot Stars delivery. |
| target_username / username | premium only | string | Telegram Premium recipient @username. Best for LegalKeys third-party API delivery. |
Per-user policy can also block purchase by daily spend limit, product allowlist, discount/commission profile, or purchase-disabled flag.
GET /api/telegram-buyer/order/{order_id}
Check an order after purchase. Read delivery_status and stop polling once final is true.
| delivery_status | final | Meaning |
|---|---|---|
| processing | false | Paid; automatic delivery is in progress. Poll again after poll_after_seconds. |
| manual | false | Paid; waiting for manual delivery. Poll again later. |
| delivered | true | Done. The goods are in delivered_items / deliveredAccounts. |
| failed | true | The order will not be delivered. Treat it as cancelled on your side. |
For a failed order, refunded is true when the money went back to your balance, with refund_amount and refunded_at. message carries a short explanation you can show to your staff. A failed order never becomes delivered later, so do not retry it: place a new order if you still need the product.
Customise what your API returns for each main-catalog product — your own name, description, flat price, and bulk (quantity) pricing. Overrides apply everywhere (this API, the bot, the website, and the Mini App).
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /api/telegram-buyer/products/<id>/overrides | Your override + the main bot defaults. |
| PUT | /api/telegram-buyer/products/<id>/overrides | Set/update (also POST / PATCH). |
| DELETE | /api/telegram-buyer/products/<id>/overrides | Clear all overrides for this product. |
| GET | /api/telegram-buyer/overrides | List all your overrides in one call. |
PUT / POST / PATCH JSON body — all optional; omit a key to leave it unchanged, send "" to clear:
| Field | Type | Description |
|---|---|---|
| custom_name | string | Your product name (independent of price). Max 300. |
| custom_description | string | Your product description. Max 4000. |
| custom_price | number | Flat price your customers pay. Must be ≥ the base price (mark-up only). 0/empty = use the shop's price. |
| custom_bulk_tiers | string | Your OWN quantity pricing, one tier per line: 1-9 -> 4.50 (also 10+ -> 3.50, exact 5 -> 4.00). Every tier ≥ the base price. Empty = no bulk override. |
Pricing precedence: your bulk tiers > your flat price > the shop's own pricing (the shop's own bulk tiers apply automatically when you set no override). A price/tier below base is rejected (below_base_price / bulk_below_base); a malformed tier list is rejected (invalid_bulk_tiers). Stock is always live from the catalog.
curl -X PUT "https://rexoprime.com/api/telegram-buyer/products/123/overrides" \
-H "X-API-Key: tgb_xxxxxxxxx" -H "Content-Type: application/json" \
-d '{"custom_name":"My Product","custom_bulk_tiers":"1-9 -> 4.50\n10-49 -> 4.00\n50+ -> 3.50"}'
Every product includes Rexo Prime AI Tool Shop-native fields and compatibility fields so common reseller panels can read it.
| Field | Meaning |
|---|---|
| product_id, id, _id | Same product identifier. Use it in purchase. |
| name, product_name | Product title. |
| price, pricing, walletPricing | Effective per-unit API price at quantity 1, after your commission/discount. |
| base_price | Per-unit price before your API commission/discount. |
| pricing_mode | fixed = one price at any quantity. bulk = quantity tiers apply (see promotions). |
| promotions | Quantity (bulk) price tiers. Array of { type:"bulk_price", minQty, maxQty?, price, label }. For a quantity Q, the per-unit price is the tier with the highest minQty ≤ Q (and Q ≤ maxQty when present); if none match, the base price is used. maxQty is omitted on an open-ended top tier (e.g. 50+). Empty [] when the product has no bulk pricing. Tier price is the base per-unit (before your commission/discount) — the exact charged unit price for your quantity comes back in the purchase response (unit_price). |
| bulk_tiers_text | The same tiers as human-readable text, one per line (e.g. 1-9 -> 0.60, 10-49 -> 0.55, 50+ -> 0.50). Empty when not a bulk product. |
| min_purchase_quantity, max_purchase_quantity | Order quantity limits (0 = no limit). |
| stock, stats.available | Available stock. |
| requiresCustomerEmail | True for seat/manual-email products. |
| requiresTelegramUserId | True for Telegram Premium products. Send either target_telegram_id or target_username. |
| delivery_mode | Always automatic: manual-delivery products are not offered through the API. |
The promotions array and bulk_tiers_text already reflect your per-product override when you set one (see Per-product overrides above); otherwise they carry the shop's own bulk pricing.
{
"product_id": 42,
"name": "Gemini Pro 18 month 5TB",
"price": 0.60,
"base_price": 0.60,
"pricing_mode": "bulk",
"bulk_tiers_text": "1-9 -> 0.60\n10-49 -> 0.55\n50+ -> 0.50",
"promotions": [
{ "type": "bulk_price", "minQty": 1, "maxQty": 9, "price": 0.60, "label": "1-9 -> 0.60" },
{ "type": "bulk_price", "minQty": 10, "maxQty": 49, "price": 0.55, "label": "10-49 -> 0.55" },
{ "type": "bulk_price", "minQty": 50, "price": 0.50, "label": "50+ -> 0.50" }
],
"stock": 733,
"min_purchase_quantity": 0,
"max_purchase_quantity": 100,
"delivery_mode": "automatic"
}
Buying 25 units here charges 0.55/unit (the 10-49 tier). You don't have to compute it — send your quantity to /purchase and the response returns the exact unit_price and totals.
curl -G "https://rexoprime.com/api/telegram-buyer/products" \
--data-urlencode "key=tgb_xxxxxxxxx"
curl "https://rexoprime.com/api/telegram-buyer/products" \
-H "X-API-Key: tgb_xxxxxxxxx"
curl -G "https://rexoprime.com/api/telegram-buyer/balance" \
--data-urlencode "key=tgb_xxxxxxxxx"
curl -X POST "https://rexoprime.com/api/telegram-buyer/purchase" \
-H "Content-Type: application/json" \
-d '{
"key":"tgb_xxxxxxxxx",
"product_id":42,
"quantity":2,
"client_order_id":"my-order-10021",
"resell_unit_price":19.99
}'
curl -X POST "https://rexoprime.com/api/telegram-buyer/purchase" \
-H "Content-Type: application/json" \
-d '{
"key":"tgb_xxxxxxxxx",
"product_id":123,
"quantity":2,
"emails":["buyer1@example.com","buyer2@example.com"]
}'
import requests
BASE = "https://rexoprime.com"
KEY = "tgb_xxxxxxxxx"
products = requests.get(
f"{BASE}/api/telegram-buyer/products",
params={"key": KEY},
timeout=20,
).json()
balance = requests.get(
f"{BASE}/api/telegram-buyer/balance",
params={"key": KEY},
timeout=20,
).json()
purchase = requests.post(
f"{BASE}/api/telegram-buyer/purchase",
json={
"key": KEY,
"product_id": 42,
"quantity": 1,
"client_order_id": "erp-5562"
},
timeout=25,
).json()
print(products)
print(balance)
print(purchase)
CORS is enabled for buyer API routes, so reseller panels can call the API from a browser app.
const BASE = "https://rexoprime.com";
const KEY = "tgb_xxxxxxxxx";
const products = await fetch(`${BASE}/api/telegram-buyer/products?key=${encodeURIComponent(KEY)}`)
.then(r => r.json());
const purchase = await fetch(`${BASE}/api/telegram-buyer/purchase`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
key: KEY,
product_id: products.products[0].product_id,
quantity: 1,
client_order_id: "web-order-1001"
})
}).then(r => r.json());
Success:
{
"success": true,
"version": "1.2.0",
"order_id": 1721,
"product_id": 42,
"quantity": 1,
"base_unit_price": 10.0,
"price_after_commission": 9.5,
"unit_price": 9.5,
"commission_percent": 5.0,
"commission_total": 0.5,
"discount_percent": 0.0,
"discount_total": 0.0,
"new_balance": 120.25
}
Error:
{
"success": false,
"message": "Insufficient wallet balance.",
"status": "insufficient_balance"
}
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Invalid request body or field values |
| 401 | Invalid key |
| 403 | Banned user, paused API, forbidden scope, or blocked IP |
| 409 | Insufficient balance / out-of-stock / limit exceeded |
| 413 | Request body too large |
| 429 | Rate limit exceeded |
| 503 | Buyer API disabled by admin |
No API is absolutely attack-proof. Keep strict user limits, rotate keys, and monitor API logs in admin.
Yes. They can resell externally at any price. Optionally they may send resell_unit_price metadata if admin enabled it for that user. Markup cap is admin-controlled.
Yes. Purchases only use wallet balance already in the main bot account.
No. This API is main bot only.
Most common cause: the base URL is wrong. Use https://rexoprime.com, not another provider domain. If the URL is correct, check that the API key is copied exactly and that the user is not paused, banned, IP-blocked, or rate-limited.