FynxAPI hujjatlari

Telegram Stars, Premium, Gift, PUBG UC va virtual raqamlarni o‘z loyihangizdan soting. REST · JSON · UTF-8. Barcha summalar so‘mda.

Boshlash

1) Kabinetda ro‘yxatdan o‘ting. 2) Balansni to‘ldiring. 3) API kalit yarating. 4) So‘rovlarni o‘z serveringizdan yuboring.

Bazaviy manzil:

{{BASE}}

Muvaffaqiyatda {"ok":true,"result":{...}}, xatoda {"ok":false,"code":"...","message":"..."}. HTTP statusni ham tekshiring.

Autentifikatsiya

X-API-Key: SIZNING_KALITINGIZ
# yoki
Authorization: Bearer SIZNING_KALITINGIZ

Kalitni brauzer yoki mobil ilova ichiga yozmang. So‘rovlar faqat serveringizdan yuborilsin. Kalit sizib chiqsa, kabinetdan yangilang: eski kalit darhol ishlamay qoladi.

curl '{{BASE}}/balance' -H 'X-API-Key: SIZNING_KALITINGIZ'

Umumiy limit: daqiqasiga 120 so‘rov. Xaridlar: 10 soniyada 5 ta. 429 bo‘lsa Retry-After sarlavhasiga amal qiling.

Xavfsiz xarid (idempotency)

Har bir xarid so‘roviga noyob X-Idempotency-Key yuboring (1–128 belgi: A-Z a-z 0-9 . _ : -). Tarmoq uzilsa, aynan o‘sha kalit va parametrlar bilan qayta yuboring: pul ikki marta yechilmaydi, avvalgi natija qaytadi. Kalit boshqa parametrlar bilan ishlatilsa, IDEMPOTENCY_CONFLICT keladi.

REQUEST_IN_PROGRESS kelsa, yangi xarid yubormang: javobdagi order_id bilan GET /order/{id} orqali holatni tekshiring.

Umumiy

GET/pricing (kalitsiz)

{"ok":true,"result":{
  "stars":{"unit_uzs":201.96,"min_amount":50,"max_amount":1000000},
  "premium":[{"months":3,"price_uzs":162000},{"months":6,"price_uzs":216000},{"months":12,"price_uzs":383292}],
  "gift":{"list_endpoint":"/gifts"},"uc":{"list_endpoint":"/uc/tariffs"},"numbers":{"list_endpoint":"/numbers/countries"}}}

GET/balance

{"ok":true,"result":{"user_id":"tg123456","balance_uzs":500000,"balance_text":"500 000"}}

POST/getInfo

Telegram username mavjudligini tekshiradi.

curl -X POST '{{BASE}}/getInfo' -H 'X-API-Key: KEY' -H 'Content-Type: application/json' -d '{"username":"durov"}'

Stars va Premium

POST/stars/buy

ParametrTuriIzoh
usernamestringMajburiy. 4–32 belgi, @ bilan yoki usiz.
amountintegerMajburiy. 50 dan 1 000 000 gacha.
curl -X POST '{{BASE}}/stars/buy' \
 -H 'X-API-Key: KEY' -H 'X-Idempotency-Key: stars-20261022-0001' \
 -H 'Content-Type: application/json' \
 -d '{"username":"durov","amount":100}'

{"ok":true,"result":{"order_id":"5f1c0a...","status":"success","cost_uzs":20196,"balance_uzs":479804,"username":"durov","amount":100}}

POST/premium/buy

ParametrTuriIzoh
usernamestringMajburiy.
durationintegerMajburiy. Faqat 3, 6 yoki 12 (oy).

Gift

GET/gifts

Mavjud sovg‘alar va narxlar. Katalogni xarid oldidan oling.

{"ok":true,"result":[{"gift_id":"5170233102089322756","title":"Bear","emoji":"🧸","stars":15,"price_uzs":3110,"purchasable":true}]}

POST/gift/buy

ParametrTuriIzoh
usernamestringMajburiy.
gift_idstringMajburiy. /gifts dagi ID.
commentstringIxtiyoriy, 128 belgigacha.
anonymousbooleanIxtiyoriy.

PUBG Mobile UC

GET/uc/tariffs

{"ok":true,"result":{"tariffs":[{"tariff_id":9,"uc_amount":660,"bonus_uc":60,"total_uc":720,"price_uzs":141610,"currency":"UZS"}],"currency":"UZS"}}

POST/uc/buy

ParametrTuriIzoh
account_idstringMajburiy. 6–12 xonali PUBG ID.
tariff_idintegerMajburiy. /uc/tariffs dagi ID.

Virtual raqam

GET/numbers/countries?server=1|2|3

{"ok":true,"result":[{"code":"UZ","name":"O‘zbekiston","server":1,"price_uzs":9575}]}

POST/numbers/buy

ParametrTuriIzoh
country_codestringMajburiy. Ikki harf: UZ, RU, US.
serverintegerIxtiyoriy. Yuborilmasa eng arzon server tanlanadi.
{"ok":true,"result":{"order_id":"5f1c0a...","status":"success","cost_uzs":9575,"balance_uzs":470000,"country_code":"UZ","server":1,"phone":"+998901234567"}}

GET/numbers/code/{order_id}

SMS kodni oladi. Kod kelguncha status: "waiting", so‘ng "finished". 5–10 soniyada bir marta so‘rang.

{"ok":true,"result":{"order_id":"5f1c0a...","status":"finished","phone":"+998901234567","code":"12345","password":""}}

Buyurtmalar

GET/order/{order_id}

status: processing, success yoki failed. Xato bo‘lsa refunded:true bo‘lib, pul balansga qaytariladi.

GET/orders?limit=20

Oxirgi buyurtmalar (1–100).

Xatolar

HTTPKodMa’nosi
400VALIDATION_ERRORParametr noto‘g‘ri yoki xizmat mavjud emas.
401UNAUTHORIZEDKalit yo‘q yoki noto‘g‘ri.
402INSUFFICIENT_BALANCEBalans yetarli emas. Pul yechilmaydi.
404ORDER_NOT_FOUND / NOT_FOUNDBuyurtma yoki endpoint topilmadi.
409IDEMPOTENCY_CONFLICTKalit boshqa parametrlar bilan ishlatilgan.
409REQUEST_IN_PROGRESSNatija aniq emas. Yangi xarid yubormang, /order/{id} ni tekshiring.
429RATE_LIMITEDSo‘rovlar ko‘p. Retry-After ni kuting.
502/503PROVIDER_ERROR / SERVICE_UNAVAILABLEXizmat xatosi. refunded:true bo‘lsa pul qaytarilgan.
{"ok":false,"code":"INSUFFICIENT_BALANCE","message":"Balans yetarli emas. Kerak: 20 196 so'm, mavjud: 10 000 so'm","refunded":false}

Misol (PHP)

$ch = curl_init('{{BASE}}/stars/buy');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 180,
  CURLOPT_HTTPHEADER => ['X-API-Key: KEY', 'X-Idempotency-Key: ' . $orderId, 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => json_encode(['username' => 'durov', 'amount' => 100]),
]);
$res = json_decode(curl_exec($ch), true);

Timeoutni kamida 180 soniya qiling: ba’zi xizmatlar ko‘proq vaqt oladi.