★ API

Telegram Stars API: Node.js quickstart

Node 18+ has fetch built in — no extra packages needed.

Automatic deliverymost orders in minutes
Username checkbefore you pay
Open pricessame on site, bot, API
Public ledgerevery order gets a TxId
const API = "https://paystars.uz/api/v1";
const H = { "X-API-Key": process.env.PAYSTARS_API_KEY, "Content-Type": "application/json" };

const chk = await (await fetch(`${API}/check-username`, { method: "POST", headers: H,
  body: JSON.stringify({ username: "durov", kind: "stars" }) })).json();
const order = await (await fetch(`${API}/stars/buy`, { method: "POST",
  headers: { ...H, "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({ username: "durov", quantity: 50, verification_token: chk.verification_token }) })).json();
console.log(await (await fetch(`${API}/order/${order.order_id}`, { headers: H })).json());
  • Generate the Idempotency-Key once per business order and persist it.
  • Use currency: "USD" and max_usd to pay from the USD balance.

Frequently asked questions

Is there a sandbox?

Use small real orders (50 Stars) while integrating; the idempotency key makes retries safe.

Which languages are supported?

Any language with HTTPS. See the Python, Node.js and PHP quickstarts.

Do API keys expire?

No. Keys stay valid until you revoke them in the dashboard.

Can I pay in USD?

Yes — top up the USD balance with USDT (TON or BEP20) and send currency=USD.

Ready to order?

Sign in with Telegram — your StarKerak balance works on the site, in the WebApp and through the API.