Reseller developer guide

aitoolsubs Reseller API

Put our live AI tool catalog inside your own bot or app. You make the sale; we handle stock, charging, and instant digital delivery.

Your app01
aitoolsubs API02
Instant delivery03

01 — Setup map

From zero to first delivery

1

Step 01

Open the bot

Choose API Key from the menu and generate your private reseller key.

2

Step 02

Lock the key away

Save it as AITOOLSUBS_API_KEY in your server's secret or environment settings.

3

Step 03

Fund your wallet

Deposit in the bot. Every successful API order is charged from this prepaid balance.

4

Step 04

Load live products

Fetch /products to show current plans, reseller prices, delivery type, and stock.

5

Step 05

Create the order

Send the selected product, quantity, and one unique external_order_id.

6

Step 06

Deliver the result

Send every returned code, link, or file to your buyer. Poll processing orders later.

02 — Working code

Connect your codebase

Keep the key server-side
typescript
const API = "https://aitoolsubs.com/api/public/reseller";
const KEY = process.env.AITOOLSUBS_API_KEY;

async function reseller(path: string, init: RequestInit = {}) {
  const response = await fetch(API + path, {
    ...init,
    headers: {
      Authorization: `Bearer ${KEY}`,
      "Content-Type": "application/json",
      ...init.headers,
    },
  });
  const data = await response.json();
  if (!response.ok) throw new Error(data.error ?? `HTTP ${response.status}`);
  return data;
}

const { products } = await reseller("/products");
const { balance } = await reseller("/balance");
const stock = await reseller("/stock?product_id=" + products[0].id);

const order = await reseller("/order", {
  method: "POST",
  body: JSON.stringify({
    product_id: products[0].id,
    quantity: 1,
    external_order_id: `tg_${chatId}_${paymentId}`,
  }),
});

for (const item of order.items) await deliverToCustomer(item);

03 — API reference

Five endpoints. One predictable flow.

Safe retries

Reuse the same external_order_id and the original delivery returns without another charge.

USDT pricing

Prices include your reseller discount and every order uses your prepaid bot wallet.

60 requests/min

The limit applies per API key. Back off after a 429 before trying again.

04 — AI-assisted setup

Build it with your AI coding tool

Open your project, choose your assistant, and paste the prepared prompt. It includes the security and retry rules that matter.

Claude

Ask Claude to inspect your existing bot before changing it.

Gemini

Give Gemini this prompt with your server-side project open.

Codex

Use from the repository root so Codex can test the full flow.

Lovable

Best for adding the reseller flow to a full-stack web app.

Replit

Save the key in Secrets before asking the Agent to connect it.

Other AI tools

This prompt works with any coding assistant that can edit your server.

05 — Go live

Launch checklist

  • API key is stored in server secrets
  • Products and balance load successfully
  • Every checkout has a stable external order ID
  • Code, link, file, and processing results are handled
  • 402, 409, 429, and 500 responses have clear fallbacks
  • A low-value test order reads back through your customer UI

Troubleshooting

When a request stops

Ready for your first API order?

Generate your key in Telegram, fund the wallet, and use the examples above to connect your store.