API Documentation

Telegram Stars sotib olish (Fragment integratsiyasi)

← Bosh sahifa
POST GET https://api.pixy.uz/stars/buy

Ushbu endpoint orqali foydalanuvchining TON hamyonidan to'lov qilinib, ko'rsatilgan username ga Telegram Stars sotib olinadi.

Request Body (JSON)

Parameter Type Required Description
username string Yes Telegram username (@ siz)
amount int Yes Stars miqdori (min: 50)
seed string Yes Mnemonik fraza (12/24 so'z)
order_id string Opt Buyurtma ID si

Example Request

curl -X POST "https://api.pixy.uz/stars/buy" \
-H "Content-Type: application/json" \
-d '{
  "username": "monk",
  "amount": 50,
  "seed": "apple banana cherry ...",
  "order_id": "ORD-001"
}'

Success Response

{
  "ok": true,
  "message": "Order successfully processed and Stars sent.",
  "order_id": "ORD-001",
  "username": "monk",
  "stars_amount": 50,
  "cost": 0.5
}

Error Responses

400

VALIDATION_ERROR

JSON xato, username yo'q yoki amount noto'g'ri.

400

INSUFFICIENT_FUNDS

Hamyonda to'lov va komissiya uchun yetarli TON yo'q.

400

WALLET_VM_ERROR

Seed fraza xato yoki hamyon versiyasi mos kelmadi.

400

FRAGMENT_API_ERROR

Fragment user topolmadi yoki xizmat rad etildi.

503

FRAGMENT_TIMEOUT

Fragment serveri javob bermadi.

400

USER_TRANSFER_FAIL

Toncenter yoki Blockchain tarmog'i xatosi.

500

CRITICAL_SERVER_ERROR

Serverning ichki kutilmagan xatosi.