★ API

API Telegram Stars: guida rapida in PHP

Una funzione cURL compatta da inserire in qualsiasi progetto o bot PHP.

Consegna automaticala maggior parte degli ordini in pochi minuti
Controllo del nome utenteprima del pagamento
Prezzi pubblicigli stessi sul sito e via API
Registro pubblicoogni ordine riceve un TxId
<?php
function ps($method, $path, $body = null, $extra = []) {
  $ch = curl_init("https://paystars.uz/api/v1$path");
  $h = array_merge(["X-API-Key: " . getenv("PAYSTARS_API_KEY"), "Content-Type: application/json"], $extra);
  curl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => $method, CURLOPT_HTTPHEADER => $h,
    CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => $body ? json_encode($body) : null]);
  return json_decode(curl_exec($ch), true);
}
$chk = ps("POST", "/check-username", ["username" => "durov", "kind" => "stars"]);
$order = ps("POST", "/stars/buy", ["username" => "durov", "quantity" => 50,
  "verification_token" => $chk["verification_token"]], ["Idempotency-Key: " . bin2hex(random_bytes(16))]);
print_r(ps("GET", "/order/" . $order["order_id"]));
  • Tieni la chiave API in una variabile d'ambiente, mai nel codice.
  • Premium funziona allo stesso modo con /premium/buy e months: 3, 6 o 12.

Domande frequenti

C'è un ambiente di prova?

Durante l'integrazione usa piccoli ordini reali (50 Stars); la chiave di idempotenza rende sicuri i tentativi ripetuti.

Quali linguaggi sono supportati?

Qualsiasi linguaggio con HTTPS. Vedi le guide rapide per Python, Node.js e PHP.

Le chiavi API scadono?

No. Le chiavi restano valide finché non le revochi nel pannello.

Posso pagare in USD?

Sì — ricarica il saldo USD con USDT (TON, BEP20 o TRC20) e invia currency=USD.

Pronto a ordinare?

Accedi con Telegram — il tuo saldo StarKerak funziona sul sito, nella WebApp e tramite l'API.